llvm.org GIT mirror llvm / c6ef277
create a new MCParser library and move some stuff into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94129 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
22 changed file(s) with 376 addition(s) and 378 deletion(s). Raw diff Collapse all Expand all
+0
-161
include/llvm/MC/MCAsmLexer.h less more
None //===-- llvm/MC/MCAsmLexer.h - Abstract Asm Lexer Interface -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMLEXER_H
10 #define LLVM_MC_MCASMLEXER_H
11
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/System/DataTypes.h"
14 #include "llvm/Support/SMLoc.h"
15
16 namespace llvm {
17 class MCAsmLexer;
18 class MCInst;
19 class Target;
20
21 /// AsmToken - Target independent representation for an assembler token.
22 class AsmToken {
23 public:
24 enum TokenKind {
25 // Markers
26 Eof, Error,
27
28 // String values.
29 Identifier,
30 String,
31
32 // Integer values.
33 Integer,
34
35 // No-value.
36 EndOfStatement,
37 Colon,
38 Plus, Minus, Tilde,
39 Slash, // '/'
40 LParen, RParen, LBrac, RBrac, LCurly, RCurly,
41 Star, Comma, Dollar, Equal, EqualEqual,
42
43 Pipe, PipePipe, Caret,
44 Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash,
45 Less, LessEqual, LessLess, LessGreater,
46 Greater, GreaterEqual, GreaterGreater
47 };
48
49 TokenKind Kind;
50
51 /// A reference to the entire token contents; this is always a pointer into
52 /// a memory buffer owned by the source manager.
53 StringRef Str;
54
55 int64_t IntVal;
56
57 public:
58 AsmToken() {}
59 AsmToken(TokenKind _Kind, StringRef _Str, int64_t _IntVal = 0)
60 : Kind(_Kind), Str(_Str), IntVal(_IntVal) {}
61
62 TokenKind getKind() const { return Kind; }
63 bool is(TokenKind K) const { return Kind == K; }
64 bool isNot(TokenKind K) const { return Kind != K; }
65
66 SMLoc getLoc() const;
67
68 /// getStringContents - Get the contents of a string token (without quotes).
69 StringRef getStringContents() const {
70 assert(Kind == String && "This token isn't a string!");
71 return Str.slice(1, Str.size() - 1);
72 }
73
74 /// getIdentifier - Get the identifier string for the current token, which
75 /// should be an identifier or a string. This gets the portion of the string
76 /// which should be used as the identifier, e.g., it does not include the
77 /// quotes on strings.
78 StringRef getIdentifier() const {
79 if (Kind == Identifier)
80 return getString();
81 return getStringContents();
82 }
83
84 /// getString - Get the string for the current token, this includes all
85 /// characters (for example, the quotes on strings) in the token.
86 ///
87 /// The returned StringRef points into the source manager's memory buffer, and
88 /// is safe to store across calls to Lex().
89 StringRef getString() const { return Str; }
90
91 // FIXME: Don't compute this in advance, it makes every token larger, and is
92 // also not generally what we want (it is nicer for recovery etc. to lex 123br
93 // as a single token, then diagnose as an invalid number).
94 int64_t getIntVal() const {
95 assert(Kind == Integer && "This token isn't an integer!");
96 return IntVal;
97 }
98 };
99
100 /// MCAsmLexer - Generic assembler lexer interface, for use by target specific
101 /// assembly lexers.
102 class MCAsmLexer {
103 /// The current token, stored in the base class for faster access.
104 AsmToken CurTok;
105
106 /// The location and description of the current error
107 SMLoc ErrLoc;
108 std::string Err;
109
110 MCAsmLexer(const MCAsmLexer &); // DO NOT IMPLEMENT
111 void operator=(const MCAsmLexer &); // DO NOT IMPLEMENT
112 protected: // Can only create subclasses.
113 MCAsmLexer();
114
115 virtual AsmToken LexToken() = 0;
116
117 void SetError(const SMLoc &errLoc, const std::string &err) {
118 ErrLoc = errLoc;
119 Err = err;
120 }
121
122 public:
123 virtual ~MCAsmLexer();
124
125 /// Lex - Consume the next token from the input stream and return it.
126 ///
127 /// The lexer will continuosly return the end-of-file token once the end of
128 /// the main input file has been reached.
129 const AsmToken &Lex() {
130 return CurTok = LexToken();
131 }
132
133 /// getTok - Get the current (last) lexed token.
134 const AsmToken &getTok() {
135 return CurTok;
136 }
137
138 /// getErrLoc - Get the current error location
139 const SMLoc &getErrLoc() {
140 return ErrLoc;
141 }
142
143 /// getErr - Get the current error string
144 const std::string &getErr() {
145 return Err;
146 }
147
148 /// getKind - Get the kind of current token.
149 AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
150
151 /// is - Check if the current token has kind \arg K.
152 bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
153
154 /// isNot - Check if the current token has kind \arg K.
155 bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
156 };
157
158 } // End llvm namespace
159
160 #endif
+0
-88
include/llvm/MC/MCAsmParser.h less more
None //===-- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ---*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMPARSER_H
10 #define LLVM_MC_MCASMPARSER_H
11
12 #include "llvm/System/DataTypes.h"
13
14 namespace llvm {
15 class AsmToken;
16 class MCAsmLexer;
17 class MCContext;
18 class MCExpr;
19 class MCStreamer;
20 class MCValue;
21 class SMLoc;
22 class Twine;
23
24 /// MCAsmParser - Generic assembler parser interface, for use by target specific
25 /// assembly parsers.
26 class MCAsmParser {
27 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
28 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
29 protected: // Can only create subclasses.
30 MCAsmParser();
31
32 public:
33 virtual ~MCAsmParser();
34
35 virtual MCAsmLexer &getLexer() = 0;
36
37 virtual MCContext &getContext() = 0;
38
39 /// getSteamer - Return the output streamer for the assembler.
40 virtual MCStreamer &getStreamer() = 0;
41
42 /// Warning - Emit a warning at the location \arg L, with the message \arg
43 /// Msg.
44 virtual void Warning(SMLoc L, const Twine &Msg) = 0;
45
46 /// Warning - Emit an error at the location \arg L, with the message \arg
47 /// Msg.
48 ///
49 /// \return The return value is always true, as an idiomatic convenience to
50 /// clients.
51 virtual bool Error(SMLoc L, const Twine &Msg) = 0;
52
53 /// Lex - Get the next AsmToken in the stream, possibly handling file
54 /// inclusion first.
55 virtual const AsmToken &Lex() = 0;
56
57 /// getTok - Get the current AsmToken from the stream.
58 const AsmToken &getTok();
59
60 /// ParseExpression - Parse an arbitrary expression.
61 ///
62 /// @param Res - The value of the expression. The result is undefined
63 /// on error.
64 /// @result - False on success.
65 virtual bool ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
66 bool ParseExpression(const MCExpr *&Res);
67
68 /// ParseParenExpression - Parse an arbitrary expression, assuming that an
69 /// initial '(' has already been consumed.
70 ///
71 /// @param Res - The value of the expression. The result is undefined
72 /// on error.
73 /// @result - False on success.
74 virtual bool ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
75
76 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
77 /// absolute value.
78 ///
79 /// @param Res - The value of the absolute expression. The result is undefined
80 /// on error.
81 /// @result - False on success.
82 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
83 };
84
85 } // End llvm namespace
86
87 #endif
+0
-33
include/llvm/MC/MCParsedAsmOperand.h less more
None //===-- llvm/MC/MCParsedAsmOperand.h - Asm Parser Operand -------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMOPERAND_H
10 #define LLVM_MC_MCASMOPERAND_H
11
12 namespace llvm {
13 class SMLoc;
14
15 /// MCParsedAsmOperand - This abstract class represents a source-level assembly
16 /// instruction operand. It should be subclassed by target-specific code. This
17 /// base class is used by target-independent clients and is the interface
18 /// between parsing an asm instruction and recognizing it.
19 class MCParsedAsmOperand {
20 public:
21 MCParsedAsmOperand() {}
22 virtual ~MCParsedAsmOperand() {}
23
24 /// getStartLoc - Get the location of the first token of this operand.
25 virtual SMLoc getStartLoc() const;
26 /// getEndLoc - Get the location of the last token of this operand.
27 virtual SMLoc getEndLoc() const;
28 };
29
30 } // end namespace llvm.
31
32 #endif
0 //===-- llvm/MC/MCAsmLexer.h - Abstract Asm Lexer Interface -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMLEXER_H
10 #define LLVM_MC_MCASMLEXER_H
11
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/System/DataTypes.h"
14 #include "llvm/Support/SMLoc.h"
15
16 namespace llvm {
17 class MCAsmLexer;
18 class MCInst;
19 class Target;
20
21 /// AsmToken - Target independent representation for an assembler token.
22 class AsmToken {
23 public:
24 enum TokenKind {
25 // Markers
26 Eof, Error,
27
28 // String values.
29 Identifier,
30 String,
31
32 // Integer values.
33 Integer,
34
35 // No-value.
36 EndOfStatement,
37 Colon,
38 Plus, Minus, Tilde,
39 Slash, // '/'
40 LParen, RParen, LBrac, RBrac, LCurly, RCurly,
41 Star, Comma, Dollar, Equal, EqualEqual,
42
43 Pipe, PipePipe, Caret,
44 Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash,
45 Less, LessEqual, LessLess, LessGreater,
46 Greater, GreaterEqual, GreaterGreater
47 };
48
49 TokenKind Kind;
50
51 /// A reference to the entire token contents; this is always a pointer into
52 /// a memory buffer owned by the source manager.
53 StringRef Str;
54
55 int64_t IntVal;
56
57 public:
58 AsmToken() {}
59 AsmToken(TokenKind _Kind, StringRef _Str, int64_t _IntVal = 0)
60 : Kind(_Kind), Str(_Str), IntVal(_IntVal) {}
61
62 TokenKind getKind() const { return Kind; }
63 bool is(TokenKind K) const { return Kind == K; }
64 bool isNot(TokenKind K) const { return Kind != K; }
65
66 SMLoc getLoc() const;
67
68 /// getStringContents - Get the contents of a string token (without quotes).
69 StringRef getStringContents() const {
70 assert(Kind == String && "This token isn't a string!");
71 return Str.slice(1, Str.size() - 1);
72 }
73
74 /// getIdentifier - Get the identifier string for the current token, which
75 /// should be an identifier or a string. This gets the portion of the string
76 /// which should be used as the identifier, e.g., it does not include the
77 /// quotes on strings.
78 StringRef getIdentifier() const {
79 if (Kind == Identifier)
80 return getString();
81 return getStringContents();
82 }
83
84 /// getString - Get the string for the current token, this includes all
85 /// characters (for example, the quotes on strings) in the token.
86 ///
87 /// The returned StringRef points into the source manager's memory buffer, and
88 /// is safe to store across calls to Lex().
89 StringRef getString() const { return Str; }
90
91 // FIXME: Don't compute this in advance, it makes every token larger, and is
92 // also not generally what we want (it is nicer for recovery etc. to lex 123br
93 // as a single token, then diagnose as an invalid number).
94 int64_t getIntVal() const {
95 assert(Kind == Integer && "This token isn't an integer!");
96 return IntVal;
97 }
98 };
99
100 /// MCAsmLexer - Generic assembler lexer interface, for use by target specific
101 /// assembly lexers.
102 class MCAsmLexer {
103 /// The current token, stored in the base class for faster access.
104 AsmToken CurTok;
105
106 /// The location and description of the current error
107 SMLoc ErrLoc;
108 std::string Err;
109
110 MCAsmLexer(const MCAsmLexer &); // DO NOT IMPLEMENT
111 void operator=(const MCAsmLexer &); // DO NOT IMPLEMENT
112 protected: // Can only create subclasses.
113 MCAsmLexer();
114
115 virtual AsmToken LexToken() = 0;
116
117 void SetError(const SMLoc &errLoc, const std::string &err) {
118 ErrLoc = errLoc;
119 Err = err;
120 }
121
122 public:
123 virtual ~MCAsmLexer();
124
125 /// Lex - Consume the next token from the input stream and return it.
126 ///
127 /// The lexer will continuosly return the end-of-file token once the end of
128 /// the main input file has been reached.
129 const AsmToken &Lex() {
130 return CurTok = LexToken();
131 }
132
133 /// getTok - Get the current (last) lexed token.
134 const AsmToken &getTok() {
135 return CurTok;
136 }
137
138 /// getErrLoc - Get the current error location
139 const SMLoc &getErrLoc() {
140 return ErrLoc;
141 }
142
143 /// getErr - Get the current error string
144 const std::string &getErr() {
145 return Err;
146 }
147
148 /// getKind - Get the kind of current token.
149 AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
150
151 /// is - Check if the current token has kind \arg K.
152 bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
153
154 /// isNot - Check if the current token has kind \arg K.
155 bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
156 };
157
158 } // End llvm namespace
159
160 #endif
0 //===-- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ---*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMPARSER_H
10 #define LLVM_MC_MCASMPARSER_H
11
12 #include "llvm/System/DataTypes.h"
13
14 namespace llvm {
15 class AsmToken;
16 class MCAsmLexer;
17 class MCContext;
18 class MCExpr;
19 class MCStreamer;
20 class MCValue;
21 class SMLoc;
22 class Twine;
23
24 /// MCAsmParser - Generic assembler parser interface, for use by target specific
25 /// assembly parsers.
26 class MCAsmParser {
27 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
28 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
29 protected: // Can only create subclasses.
30 MCAsmParser();
31
32 public:
33 virtual ~MCAsmParser();
34
35 virtual MCAsmLexer &getLexer() = 0;
36
37 virtual MCContext &getContext() = 0;
38
39 /// getSteamer - Return the output streamer for the assembler.
40 virtual MCStreamer &getStreamer() = 0;
41
42 /// Warning - Emit a warning at the location \arg L, with the message \arg
43 /// Msg.
44 virtual void Warning(SMLoc L, const Twine &Msg) = 0;
45
46 /// Warning - Emit an error at the location \arg L, with the message \arg
47 /// Msg.
48 ///
49 /// \return The return value is always true, as an idiomatic convenience to
50 /// clients.
51 virtual bool Error(SMLoc L, const Twine &Msg) = 0;
52
53 /// Lex - Get the next AsmToken in the stream, possibly handling file
54 /// inclusion first.
55 virtual const AsmToken &Lex() = 0;
56
57 /// getTok - Get the current AsmToken from the stream.
58 const AsmToken &getTok();
59
60 /// ParseExpression - Parse an arbitrary expression.
61 ///
62 /// @param Res - The value of the expression. The result is undefined
63 /// on error.
64 /// @result - False on success.
65 virtual bool ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
66 bool ParseExpression(const MCExpr *&Res);
67
68 /// ParseParenExpression - Parse an arbitrary expression, assuming that an
69 /// initial '(' has already been consumed.
70 ///
71 /// @param Res - The value of the expression. The result is undefined
72 /// on error.
73 /// @result - False on success.
74 virtual bool ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
75
76 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
77 /// absolute value.
78 ///
79 /// @param Res - The value of the absolute expression. The result is undefined
80 /// on error.
81 /// @result - False on success.
82 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
83 };
84
85 } // End llvm namespace
86
87 #endif
0 //===-- llvm/MC/MCParsedAsmOperand.h - Asm Parser Operand -------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_MC_MCASMOPERAND_H
10 #define LLVM_MC_MCASMOPERAND_H
11
12 namespace llvm {
13 class SMLoc;
14
15 /// MCParsedAsmOperand - This abstract class represents a source-level assembly
16 /// instruction operand. It should be subclassed by target-specific code. This
17 /// base class is used by target-independent clients and is the interface
18 /// between parsing an asm instruction and recognizing it.
19 class MCParsedAsmOperand {
20 public:
21 MCParsedAsmOperand() {}
22 virtual ~MCParsedAsmOperand() {}
23
24 /// getStartLoc - Get the location of the first token of this operand.
25 virtual SMLoc getStartLoc() const;
26 /// getEndLoc - Get the location of the last token of this operand.
27 virtual SMLoc getEndLoc() const;
28 };
29
30 } // end namespace llvm.
31
32 #endif
11 MCAsmInfo.cpp
22 MCAsmInfoCOFF.cpp
33 MCAsmInfoDarwin.cpp
4 MCAsmLexer.cpp
5 MCAsmParser.cpp
64 MCAsmStreamer.cpp
75 MCAssembler.cpp
86 MCCodeEmitter.cpp
1917 MCStreamer.cpp
2018 MCSymbol.cpp
2119 MCValue.cpp
22 TargetAsmParser.cpp
2320 )
+0
-23
lib/MC/MCAsmLexer.cpp less more
None //===-- MCAsmLexer.cpp - Abstract Asm Lexer Interface ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/MC/MCAsmLexer.h"
10 #include "llvm/Support/SourceMgr.h"
11
12 using namespace llvm;
13
14 MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()) {
15 }
16
17 MCAsmLexer::~MCAsmLexer() {
18 }
19
20 SMLoc AsmToken::getLoc() const {
21 return SMLoc::getFromPointer(Str.data());
22 }
+0
-35
lib/MC/MCAsmParser.cpp less more
None //===-- MCAsmParser.cpp - Abstract Asm Parser Interface -------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/MC/MCAsmParser.h"
10 #include "llvm/MC/MCAsmLexer.h"
11 #include "llvm/MC/MCParsedAsmOperand.h"
12 #include "llvm/Support/SourceMgr.h"
13 using namespace llvm;
14
15 MCAsmParser::MCAsmParser() {
16 }
17
18 MCAsmParser::~MCAsmParser() {
19 }
20
21 const AsmToken &MCAsmParser::getTok() {
22 return getLexer().getTok();
23 }
24
25 bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
26 SMLoc L;
27 return ParseExpression(Res, L);
28 }
29
30 /// getStartLoc - Get the location of the first token of this operand.
31 SMLoc MCParsedAsmOperand::getStartLoc() const { return SMLoc(); }
32 SMLoc MCParsedAsmOperand::getEndLoc() const { return SMLoc(); }
33
34
0 //===-- MCAsmLexer.cpp - Abstract Asm Lexer Interface ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/MC/MCParser/MCAsmLexer.h"
10 #include "llvm/Support/SourceMgr.h"
11
12 using namespace llvm;
13
14 MCAsmLexer::MCAsmLexer() : CurTok(AsmToken::Error, StringRef()) {
15 }
16
17 MCAsmLexer::~MCAsmLexer() {
18 }
19
20 SMLoc AsmToken::getLoc() const {
21 return SMLoc::getFromPointer(Str.data());
22 }
0 //===-- MCAsmParser.cpp - Abstract Asm Parser Interface -------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/MC/MCParser/MCAsmParser.h"
10 #include "llvm/MC/MCParser/MCAsmLexer.h"
11 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
12 #include "llvm/Support/SourceMgr.h"
13 using namespace llvm;
14
15 MCAsmParser::MCAsmParser() {
16 }
17
18 MCAsmParser::~MCAsmParser() {
19 }
20
21 const AsmToken &MCAsmParser::getTok() {
22 return getLexer().getTok();
23 }
24
25 bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
26 SMLoc L;
27 return ParseExpression(Res, L);
28 }
29
30 /// getStartLoc - Get the location of the first token of this operand.
31 SMLoc MCParsedAsmOperand::getStartLoc() const { return SMLoc(); }
32 SMLoc MCParsedAsmOperand::getEndLoc() const { return SMLoc(); }
33
34
0 //===-- TargetAsmParser.cpp - Target Assembly Parser -----------------------==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/Target/TargetAsmParser.h"
10 using namespace llvm;
11
12 TargetAsmParser::TargetAsmParser(const Target &T)
13 : TheTarget(T)
14 {
15 }
16
17 TargetAsmParser::~TargetAsmParser() {
18 }
99 LEVEL = ../..
1010 LIBRARYNAME = LLVMMC
1111 BUILD_ARCHIVE := 1
12 PARALLEL_DIRS := MCParser
1213
1314 include $(LEVEL)/Makefile.common
1415
+0
-19
lib/MC/TargetAsmParser.cpp less more
None //===-- TargetAsmParser.cpp - Target Assembly Parser -----------------------==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/Target/TargetAsmParser.h"
10 using namespace llvm;
11
12 TargetAsmParser::TargetAsmParser(const Target &T)
13 : TheTarget(T)
14 {
15 }
16
17 TargetAsmParser::~TargetAsmParser() {
18 }
77 //===----------------------------------------------------------------------===//
88
99 #include "ARM.h"
10 #include "llvm/ADT/SmallVector.h"
11 #include "llvm/ADT/Twine.h"
12 #include "llvm/MC/MCAsmLexer.h"
13 #include "llvm/MC/MCAsmParser.h"
14 #include "llvm/MC/MCParsedAsmOperand.h"
10 #include "llvm/MC/MCParser/MCAsmLexer.h"
11 #include "llvm/MC/MCParser/MCAsmParser.h"
12 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
1513 #include "llvm/MC/MCStreamer.h"
1614 #include "llvm/MC/MCExpr.h"
1715 #include "llvm/MC/MCInst.h"
16 #include "llvm/Target/TargetRegistry.h"
17 #include "llvm/Target/TargetAsmParser.h"
1818 #include "llvm/Support/Compiler.h"
1919 #include "llvm/Support/SourceMgr.h"
20 #include "llvm/Target/TargetRegistry.h"
21 #include "llvm/Target/TargetAsmParser.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/Twine.h"
2222 using namespace llvm;
2323
2424 namespace {
1010 #include "X86.h"
1111 #include "llvm/ADT/SmallVector.h"
1212 #include "llvm/ADT/Twine.h"
13 #include "llvm/MC/MCAsmLexer.h"
14 #include "llvm/MC/MCAsmParser.h"
1513 #include "llvm/MC/MCStreamer.h"
1614 #include "llvm/MC/MCExpr.h"
1715 #include "llvm/MC/MCInst.h"
18 #include "llvm/MC/MCParsedAsmOperand.h"
16 #include "llvm/MC/MCParser/MCAsmLexer.h"
17 #include "llvm/MC/MCParser/MCAsmParser.h"
18 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
1919 #include "llvm/Support/SourceMgr.h"
2020 #include "llvm/Target/TargetRegistry.h"
2121 #include "llvm/Target/TargetAsmParser.h"
1414 #define ASMLEXER_H
1515
1616 #include "llvm/ADT/StringRef.h"
17 #include "llvm/MC/MCAsmLexer.h"
17 #include "llvm/MC/MCParser/MCAsmLexer.h"
1818 #include "llvm/MC/MCAsmInfo.h"
1919 #include "llvm/System/DataTypes.h"
2020 #include
1717 #include "llvm/MC/MCContext.h"
1818 #include "llvm/MC/MCExpr.h"
1919 #include "llvm/MC/MCInst.h"
20 #include "llvm/MC/MCParsedAsmOperand.h"
2120 #include "llvm/MC/MCSectionMachO.h"
2221 #include "llvm/MC/MCStreamer.h"
2322 #include "llvm/MC/MCSymbol.h"
2423 #include "llvm/MC/MCValue.h"
24 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
2525 #include "llvm/Support/Compiler.h"
2626 #include "llvm/Support/SourceMgr.h"
2727 #include "llvm/Support/raw_ostream.h"
1616 #include
1717 #include "AsmLexer.h"
1818 #include "AsmCond.h"
19 #include "llvm/MC/MCAsmParser.h"
19 #include "llvm/MC/MCParser/MCAsmParser.h"
2020 #include "llvm/MC/MCSectionMachO.h"
2121 #include "llvm/MC/MCStreamer.h"
2222 #include "llvm/MC/MCAsmInfo.h"
None set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC)
0 set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC MCParser)
11
22 add_llvm_tool(llvm-mc
33 llvm-mc.cpp
1818 # early so we can set up LINK_COMPONENTS before including Makefile.rules
1919 include $(LEVEL)/Makefile.config
2020
21 LINK_COMPONENTS := $(TARGETS_TO_BUILD) MC support
21 LINK_COMPONENTS := $(TARGETS_TO_BUILD) MCParser MC support
2222
2323 include $(LLVM_SRC_ROOT)/Makefile.rules
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/MC/MCAsmLexer.h"
14 #include "llvm/MC/MCParser/MCAsmLexer.h"
1515 #include "llvm/MC/MCContext.h"
1616 #include "llvm/MC/MCCodeEmitter.h"
1717 #include "llvm/MC/MCInstPrinter.h"