llvm.org GIT mirror llvm / a7cfc08
Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135833 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 8 years ago
40 changed file(s) with 357 addition(s) and 360 deletion(s). Raw diff Collapse all Expand all
0 //===-- llvm/MC/TargetAsmBackend.h - Target Asm Backend ---------*- 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_TARGET_TARGETASMBACKEND_H
10 #define LLVM_TARGET_TARGETASMBACKEND_H
11
12 #include "llvm/MC/MCDirectives.h"
13 #include "llvm/MC/MCFixup.h"
14 #include "llvm/MC/MCFixupKindInfo.h"
15 #include "llvm/Support/DataTypes.h"
16
17 namespace llvm {
18 class MCELFObjectTargetWriter;
19 class MCFixup;
20 class MCInst;
21 class MCObjectWriter;
22 class MCSection;
23 template
24 class SmallVectorImpl;
25 class raw_ostream;
26
27 /// TargetAsmBackend - Generic interface to target specific assembler backends.
28 class TargetAsmBackend {
29 TargetAsmBackend(const TargetAsmBackend &); // DO NOT IMPLEMENT
30 void operator=(const TargetAsmBackend &); // DO NOT IMPLEMENT
31 protected: // Can only create subclasses.
32 TargetAsmBackend();
33
34 unsigned HasReliableSymbolDifference : 1;
35
36 public:
37 virtual ~TargetAsmBackend();
38
39 /// createObjectWriter - Create a new MCObjectWriter instance for use by the
40 /// assembler backend to emit the final object file.
41 virtual MCObjectWriter *createObjectWriter(raw_ostream &OS) const = 0;
42
43 /// createELFObjectTargetWriter - Create a new ELFObjectTargetWriter to enable
44 /// non-standard ELFObjectWriters.
45 virtual MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
46 assert(0 && "createELFObjectTargetWriter is not supported by asm backend");
47 return 0;
48 }
49
50 /// hasReliableSymbolDifference - Check whether this target implements
51 /// accurate relocations for differences between symbols. If not, differences
52 /// between symbols will always be relocatable expressions and any references
53 /// to temporary symbols will be assumed to be in the same atom, unless they
54 /// reside in a different section.
55 ///
56 /// This should always be true (since it results in fewer relocations with no
57 /// loss of functionality), but is currently supported as a way to maintain
58 /// exact object compatibility with Darwin 'as' (on non-x86_64). It should
59 /// eventually should be eliminated.
60 bool hasReliableSymbolDifference() const {
61 return HasReliableSymbolDifference;
62 }
63
64 /// doesSectionRequireSymbols - Check whether the given section requires that
65 /// all symbols (even temporaries) have symbol table entries.
66 virtual bool doesSectionRequireSymbols(const MCSection &Section) const {
67 return false;
68 }
69
70 /// isSectionAtomizable - Check whether the given section can be split into
71 /// atoms.
72 ///
73 /// \see MCAssembler::isSymbolLinkerVisible().
74 virtual bool isSectionAtomizable(const MCSection &Section) const {
75 return true;
76 }
77
78 /// @name Target Fixup Interfaces
79 /// @{
80
81 /// getNumFixupKinds - Get the number of target specific fixup kinds.
82 virtual unsigned getNumFixupKinds() const = 0;
83
84 /// getFixupKindInfo - Get information on a fixup kind.
85 virtual const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const;
86
87 /// @}
88
89 /// ApplyFixup - Apply the \arg Value for given \arg Fixup into the provided
90 /// data fragment, at the offset specified by the fixup and following the
91 /// fixup kind as appropriate.
92 virtual void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
93 uint64_t Value) const = 0;
94
95 /// @}
96
97 /// @name Target Relaxation Interfaces
98 /// @{
99
100 /// MayNeedRelaxation - Check whether the given instruction may need
101 /// relaxation.
102 ///
103 /// \param Inst - The instruction to test.
104 virtual bool MayNeedRelaxation(const MCInst &Inst) const = 0;
105
106 /// RelaxInstruction - Relax the instruction in the given fragment to the next
107 /// wider instruction.
108 ///
109 /// \param Inst - The instruction to relax, which may be the same as the
110 /// output.
111 /// \parm Res [output] - On return, the relaxed instruction.
112 virtual void RelaxInstruction(const MCInst &Inst, MCInst &Res) const = 0;
113
114 /// @}
115
116 /// WriteNopData - Write an (optimal) nop sequence of Count bytes to the given
117 /// output. If the target cannot generate such a sequence, it should return an
118 /// error.
119 ///
120 /// \return - True on success.
121 virtual bool WriteNopData(uint64_t Count, MCObjectWriter *OW) const = 0;
122
123 /// HandleAssemblerFlag - Handle any target-specific assembler flags.
124 /// By default, do nothing.
125 virtual void HandleAssemblerFlag(MCAssemblerFlag Flag) {}
126 };
127
128 } // End llvm namespace
129
130 #endif
0 //===-- llvm/Target/TargetAsmLexer.h - Target Assembly Lexer ----*- 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_TARGET_TARGETASMLEXER_H
10 #define LLVM_TARGET_TARGETASMLEXER_H
11
12 #include "llvm/MC/MCParser/MCAsmLexer.h"
13
14 namespace llvm {
15 class Target;
16
17 /// TargetAsmLexer - Generic interface to target specific assembly lexers.
18 class TargetAsmLexer {
19 /// The current token
20 AsmToken CurTok;
21
22 /// The location and description of the current error
23 SMLoc ErrLoc;
24 std::string Err;
25
26 TargetAsmLexer(const TargetAsmLexer &); // DO NOT IMPLEMENT
27 void operator=(const TargetAsmLexer &); // DO NOT IMPLEMENT
28 protected: // Can only create subclasses.
29 TargetAsmLexer(const Target &);
30
31 virtual AsmToken LexToken() = 0;
32
33 void SetError(const SMLoc &errLoc, const std::string &err) {
34 ErrLoc = errLoc;
35 Err = err;
36 }
37
38 /// TheTarget - The Target that this machine was created for.
39 const Target &TheTarget;
40 MCAsmLexer *Lexer;
41
42 public:
43 virtual ~TargetAsmLexer();
44
45 const Target &getTarget() const { return TheTarget; }
46
47 /// InstallLexer - Set the lexer to get tokens from lower-level lexer \arg L.
48 void InstallLexer(MCAsmLexer &L) {
49 Lexer = &L;
50 }
51
52 MCAsmLexer *getLexer() {
53 return Lexer;
54 }
55
56 /// Lex - Consume the next token from the input stream and return it.
57 const AsmToken &Lex() {
58 return CurTok = LexToken();
59 }
60
61 /// getTok - Get the current (last) lexed token.
62 const AsmToken &getTok() {
63 return CurTok;
64 }
65
66 /// getErrLoc - Get the current error location
67 const SMLoc &getErrLoc() {
68 return ErrLoc;
69 }
70
71 /// getErr - Get the current error string
72 const std::string &getErr() {
73 return Err;
74 }
75
76 /// getKind - Get the kind of current token.
77 AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
78
79 /// is - Check if the current token has kind \arg K.
80 bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
81
82 /// isNot - Check if the current token has kind \arg K.
83 bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
84 };
85
86 } // End llvm namespace
87
88 #endif
0 //===-- llvm/Target/TargetAsmParser.h - Target Assembly Parser --*- 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_TARGET_TARGETPARSER_H
10 #define LLVM_TARGET_TARGETPARSER_H
11
12 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
13
14 namespace llvm {
15 class MCStreamer;
16 class StringRef;
17 class SMLoc;
18 class AsmToken;
19 class MCParsedAsmOperand;
20 template class SmallVectorImpl;
21
22 /// TargetAsmParser - Generic interface to target specific assembly parsers.
23 class TargetAsmParser : public MCAsmParserExtension {
24 TargetAsmParser(const TargetAsmParser &); // DO NOT IMPLEMENT
25 void operator=(const TargetAsmParser &); // DO NOT IMPLEMENT
26 protected: // Can only create subclasses.
27 TargetAsmParser();
28
29 /// AvailableFeatures - The current set of available features.
30 unsigned AvailableFeatures;
31
32 public:
33 virtual ~TargetAsmParser();
34
35 unsigned getAvailableFeatures() const { return AvailableFeatures; }
36 void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
37
38 virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
39 SMLoc &EndLoc) = 0;
40
41 /// ParseInstruction - Parse one assembly instruction.
42 ///
43 /// The parser is positioned following the instruction name. The target
44 /// specific instruction parser should parse the entire instruction and
45 /// construct the appropriate MCInst, or emit an error. On success, the entire
46 /// line should be parsed up to and including the end-of-statement token. On
47 /// failure, the parser is not required to read to the end of the line.
48 //
49 /// \param Name - The instruction name.
50 /// \param NameLoc - The source location of the name.
51 /// \param Operands [out] - The list of parsed operands, this returns
52 /// ownership of them to the caller.
53 /// \return True on failure.
54 virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
55 SmallVectorImpl &Operands) = 0;
56
57 /// ParseDirective - Parse a target specific assembler directive
58 ///
59 /// The parser is positioned following the directive name. The target
60 /// specific directive parser should parse the entire directive doing or
61 /// recording any target specific work, or return true and do nothing if the
62 /// directive is not target specific. If the directive is specific for
63 /// the target, the entire line is parsed up to and including the
64 /// end-of-statement token and false is returned.
65 ///
66 /// \param DirectiveID - the identifier token of the directive.
67 virtual bool ParseDirective(AsmToken DirectiveID) = 0;
68
69 /// MatchAndEmitInstruction - Recognize a series of operands of a parsed
70 /// instruction as an actual MCInst and emit it to the specified MCStreamer.
71 /// This returns false on success and returns true on failure to match.
72 ///
73 /// On failure, the target parser is responsible for emitting a diagnostic
74 /// explaining the match failure.
75 virtual bool
76 MatchAndEmitInstruction(SMLoc IDLoc,
77 SmallVectorImpl &Operands,
78 MCStreamer &Out) = 0;
79
80 };
81
82 } // End llvm namespace
83
84 #endif
+0
-131
include/llvm/Target/TargetAsmBackend.h less more
None //===-- llvm/Target/TargetAsmBackend.h - Target Asm Backend -----*- 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_TARGET_TARGETASMBACKEND_H
10 #define LLVM_TARGET_TARGETASMBACKEND_H
11
12 #include "llvm/MC/MCDirectives.h"
13 #include "llvm/MC/MCFixup.h"
14 #include "llvm/MC/MCFixupKindInfo.h"
15 #include "llvm/Support/DataTypes.h"
16
17 namespace llvm {
18 class MCELFObjectTargetWriter;
19 class MCFixup;
20 class MCInst;
21 class MCObjectWriter;
22 class MCSection;
23 template
24 class SmallVectorImpl;
25 class raw_ostream;
26
27 /// TargetAsmBackend - Generic interface to target specific assembler backends.
28 class TargetAsmBackend {
29 TargetAsmBackend(const TargetAsmBackend &); // DO NOT IMPLEMENT
30 void operator=(const TargetAsmBackend &); // DO NOT IMPLEMENT
31 protected: // Can only create subclasses.
32 TargetAsmBackend();
33
34 unsigned HasReliableSymbolDifference : 1;
35
36 public:
37 virtual ~TargetAsmBackend();
38
39 /// createObjectWriter - Create a new MCObjectWriter instance for use by the
40 /// assembler backend to emit the final object file.
41 virtual MCObjectWriter *createObjectWriter(raw_ostream &OS) const = 0;
42
43 /// createELFObjectTargetWriter - Create a new ELFObjectTargetWriter to enable
44 /// non-standard ELFObjectWriters.
45 virtual MCELFObjectTargetWriter *createELFObjectTargetWriter() const {
46 assert(0 && "createELFObjectTargetWriter is not supported by asm backend");
47 return 0;
48 }
49
50 /// hasReliableSymbolDifference - Check whether this target implements
51 /// accurate relocations for differences between symbols. If not, differences
52 /// between symbols will always be relocatable expressions and any references
53 /// to temporary symbols will be assumed to be in the same atom, unless they
54 /// reside in a different section.
55 ///
56 /// This should always be true (since it results in fewer relocations with no
57 /// loss of functionality), but is currently supported as a way to maintain
58 /// exact object compatibility with Darwin 'as' (on non-x86_64). It should
59 /// eventually should be eliminated.
60 bool hasReliableSymbolDifference() const {
61 return HasReliableSymbolDifference;
62 }
63
64 /// doesSectionRequireSymbols - Check whether the given section requires that
65 /// all symbols (even temporaries) have symbol table entries.
66 virtual bool doesSectionRequireSymbols(const MCSection &Section) const {
67 return false;
68 }
69
70 /// isSectionAtomizable - Check whether the given section can be split into
71 /// atoms.
72 ///
73 /// \see MCAssembler::isSymbolLinkerVisible().
74 virtual bool isSectionAtomizable(const MCSection &Section) const {
75 return true;
76 }
77
78 /// @name Target Fixup Interfaces
79 /// @{
80
81 /// getNumFixupKinds - Get the number of target specific fixup kinds.
82 virtual unsigned getNumFixupKinds() const = 0;
83
84 /// getFixupKindInfo - Get information on a fixup kind.
85 virtual const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const;
86
87 /// @}
88
89 /// ApplyFixup - Apply the \arg Value for given \arg Fixup into the provided
90 /// data fragment, at the offset specified by the fixup and following the
91 /// fixup kind as appropriate.
92 virtual void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
93 uint64_t Value) const = 0;
94
95 /// @}
96
97 /// @name Target Relaxation Interfaces
98 /// @{
99
100 /// MayNeedRelaxation - Check whether the given instruction may need
101 /// relaxation.
102 ///
103 /// \param Inst - The instruction to test.
104 virtual bool MayNeedRelaxation(const MCInst &Inst) const = 0;
105
106 /// RelaxInstruction - Relax the instruction in the given fragment to the next
107 /// wider instruction.
108 ///
109 /// \param Inst - The instruction to relax, which may be the same as the
110 /// output.
111 /// \parm Res [output] - On return, the relaxed instruction.
112 virtual void RelaxInstruction(const MCInst &Inst, MCInst &Res) const = 0;
113
114 /// @}
115
116 /// WriteNopData - Write an (optimal) nop sequence of Count bytes to the given
117 /// output. If the target cannot generate such a sequence, it should return an
118 /// error.
119 ///
120 /// \return - True on success.
121 virtual bool WriteNopData(uint64_t Count, MCObjectWriter *OW) const = 0;
122
123 /// HandleAssemblerFlag - Handle any target-specific assembler flags.
124 /// By default, do nothing.
125 virtual void HandleAssemblerFlag(MCAssemblerFlag Flag) {}
126 };
127
128 } // End llvm namespace
129
130 #endif
+0
-89
include/llvm/Target/TargetAsmLexer.h less more
None //===-- llvm/Target/TargetAsmLexer.h - Target Assembly Lexer ----*- 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_TARGET_TARGETASMLEXER_H
10 #define LLVM_TARGET_TARGETASMLEXER_H
11
12 #include "llvm/MC/MCParser/MCAsmLexer.h"
13
14 namespace llvm {
15 class Target;
16
17 /// TargetAsmLexer - Generic interface to target specific assembly lexers.
18 class TargetAsmLexer {
19 /// The current token
20 AsmToken CurTok;
21
22 /// The location and description of the current error
23 SMLoc ErrLoc;
24 std::string Err;
25
26 TargetAsmLexer(const TargetAsmLexer &); // DO NOT IMPLEMENT
27 void operator=(const TargetAsmLexer &); // DO NOT IMPLEMENT
28 protected: // Can only create subclasses.
29 TargetAsmLexer(const Target &);
30
31 virtual AsmToken LexToken() = 0;
32
33 void SetError(const SMLoc &errLoc, const std::string &err) {
34 ErrLoc = errLoc;
35 Err = err;
36 }
37
38 /// TheTarget - The Target that this machine was created for.
39 const Target &TheTarget;
40 MCAsmLexer *Lexer;
41
42 public:
43 virtual ~TargetAsmLexer();
44
45 const Target &getTarget() const { return TheTarget; }
46
47 /// InstallLexer - Set the lexer to get tokens from lower-level lexer \arg L.
48 void InstallLexer(MCAsmLexer &L) {
49 Lexer = &L;
50 }
51
52 MCAsmLexer *getLexer() {
53 return Lexer;
54 }
55
56 /// Lex - Consume the next token from the input stream and return it.
57 const AsmToken &Lex() {
58 return CurTok = LexToken();
59 }
60
61 /// getTok - Get the current (last) lexed token.
62 const AsmToken &getTok() {
63 return CurTok;
64 }
65
66 /// getErrLoc - Get the current error location
67 const SMLoc &getErrLoc() {
68 return ErrLoc;
69 }
70
71 /// getErr - Get the current error string
72 const std::string &getErr() {
73 return Err;
74 }
75
76 /// getKind - Get the kind of current token.
77 AsmToken::TokenKind getKind() const { return CurTok.getKind(); }
78
79 /// is - Check if the current token has kind \arg K.
80 bool is(AsmToken::TokenKind K) const { return CurTok.is(K); }
81
82 /// isNot - Check if the current token has kind \arg K.
83 bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
84 };
85
86 } // End llvm namespace
87
88 #endif
+0
-85
include/llvm/Target/TargetAsmParser.h less more
None //===-- llvm/Target/TargetAsmParser.h - Target Assembly Parser --*- 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_TARGET_TARGETPARSER_H
10 #define LLVM_TARGET_TARGETPARSER_H
11
12 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
13
14 namespace llvm {
15 class MCStreamer;
16 class StringRef;
17 class SMLoc;
18 class AsmToken;
19 class MCParsedAsmOperand;
20 template class SmallVectorImpl;
21
22 /// TargetAsmParser - Generic interface to target specific assembly parsers.
23 class TargetAsmParser : public MCAsmParserExtension {
24 TargetAsmParser(const TargetAsmParser &); // DO NOT IMPLEMENT
25 void operator=(const TargetAsmParser &); // DO NOT IMPLEMENT
26 protected: // Can only create subclasses.
27 TargetAsmParser();
28
29 /// AvailableFeatures - The current set of available features.
30 unsigned AvailableFeatures;
31
32 public:
33 virtual ~TargetAsmParser();
34
35 unsigned getAvailableFeatures() const { return AvailableFeatures; }
36 void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
37
38 virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
39 SMLoc &EndLoc) = 0;
40
41 /// ParseInstruction - Parse one assembly instruction.
42 ///
43 /// The parser is positioned following the instruction name. The target
44 /// specific instruction parser should parse the entire instruction and
45 /// construct the appropriate MCInst, or emit an error. On success, the entire
46 /// line should be parsed up to and including the end-of-statement token. On
47 /// failure, the parser is not required to read to the end of the line.
48 //
49 /// \param Name - The instruction name.
50 /// \param NameLoc - The source location of the name.
51 /// \param Operands [out] - The list of parsed operands, this returns
52 /// ownership of them to the caller.
53 /// \return True on failure.
54 virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
55 SmallVectorImpl &Operands) = 0;
56
57 /// ParseDirective - Parse a target specific assembler directive
58 ///
59 /// The parser is positioned following the directive name. The target
60 /// specific directive parser should parse the entire directive doing or
61 /// recording any target specific work, or return true and do nothing if the
62 /// directive is not target specific. If the directive is specific for
63 /// the target, the entire line is parsed up to and including the
64 /// end-of-statement token and false is returned.
65 ///
66 /// \param DirectiveID - the identifier token of the directive.
67 virtual bool ParseDirective(AsmToken DirectiveID) = 0;
68
69 /// MatchAndEmitInstruction - Recognize a series of operands of a parsed
70 /// instruction as an actual MCInst and emit it to the specified MCStreamer.
71 /// This returns false on success and returns true on failure to match.
72 ///
73 /// On failure, the target parser is responsible for emitting a diagnostic
74 /// explaining the match failure.
75 virtual bool
76 MatchAndEmitInstruction(SMLoc IDLoc,
77 SmallVectorImpl &Operands,
78 MCStreamer &Out) = 0;
79
80 };
81
82 } // End llvm namespace
83
84 #endif
2222 #include "llvm/MC/MCStreamer.h"
2323 #include "llvm/MC/MCSubtargetInfo.h"
2424 #include "llvm/MC/MCSymbol.h"
25 #include "llvm/Target/TargetAsmParser.h"
25 #include "llvm/MC/TargetAsmParser.h"
2626 #include "llvm/Target/TargetMachine.h"
2727 #include "llvm/Target/TargetRegistry.h"
2828 #include "llvm/ADT/OwningPtr.h"
3838 WinCOFFObjectWriter.cpp
3939 SubtargetFeature.cpp
4040 TargetAsmBackend.cpp
41 TargetAsmLexer.cpp
4142 )
4243
4344 add_subdirectory(MCParser)
1919 #include "llvm/MC/MCExpr.h"
2020 #include "llvm/MC/MCSectionELF.h"
2121 #include "llvm/MC/MCValue.h"
22 #include "llvm/MC/TargetAsmBackend.h"
2223 #include "llvm/Support/Debug.h"
2324 #include "llvm/Support/ErrorHandling.h"
2425 #include "llvm/Support/ELF.h"
25 #include "llvm/Target/TargetAsmBackend.h"
26 #include "llvm/ADT/StringSwitch.h"
2726 #include "llvm/Support/CommandLine.h"
2827 #include "llvm/ADT/Statistic.h"
28 #include "llvm/ADT/StringSwitch.h"
2929
3030 #include "../Target/X86/X86FixupKinds.h"
3131 #include "../Target/ARM/MCTargetDesc/ARMFixupKinds.h"
1818 #include "llvm/MC/MCSectionCOFF.h"
1919 #include "llvm/MC/MCSectionMachO.h"
2020 #include "llvm/MC/MCSymbol.h"
21 #include "llvm/MC/TargetAsmBackend.h"
2122 #include "llvm/ADT/OwningPtr.h"
2223 #include "llvm/ADT/SmallString.h"
2324 #include "llvm/ADT/StringExtras.h"
2627 #include "llvm/Support/MathExtras.h"
2728 #include "llvm/Support/Format.h"
2829 #include "llvm/Support/FormattedStream.h"
29 #include "llvm/Target/TargetAsmBackend.h"
3030 #include "llvm/Target/TargetLoweringObjectFile.h"
3131 #include
3232 using namespace llvm;
1717 #include "llvm/MC/MCSymbol.h"
1818 #include "llvm/MC/MCValue.h"
1919 #include "llvm/MC/MCDwarf.h"
20 #include "llvm/MC/TargetAsmBackend.h"
2021 #include "llvm/ADT/OwningPtr.h"
2122 #include "llvm/ADT/Statistic.h"
2223 #include "llvm/ADT/StringExtras.h"
2526 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/Support/raw_ostream.h"
2728 #include "llvm/Target/TargetRegistry.h"
28 #include "llvm/Target/TargetAsmBackend.h"
2929
3030 using namespace llvm;
3131
2727 #include "llvm/MC/MCParser/AsmLexer.h"
2828 #include "llvm/MC/MCParser/MCAsmParser.h"
2929 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
30 #include "llvm/MC/TargetAsmLexer.h"
31 #include "llvm/MC/TargetAsmParser.h"
3032 #include "llvm/Support/MemoryBuffer.h"
3133 #include "llvm/Support/MemoryObject.h"
3234 #include "llvm/Support/SourceMgr.h"
33 #include "llvm/Target/TargetAsmLexer.h"
34 #include "llvm/Target/TargetAsmParser.h"
3535 #include "llvm/Target/TargetRegistry.h"
3636 #include "llvm/Target/TargetMachine.h"
3737 #include "llvm/Target/TargetRegisterInfo.h"
1414 #include "llvm/MC/MCAssembler.h"
1515 #include "llvm/MC/MCELFSymbolFlags.h"
1616 #include "llvm/MC/MCFixupKindInfo.h"
17 #include "llvm/MC/TargetAsmBackend.h"
1718 #include "llvm/Support/ELF.h"
18 #include "llvm/Target/TargetAsmBackend.h"
1919
2020 namespace llvm {
2121
2020 #include "llvm/MC/MCSection.h"
2121 #include "llvm/MC/MCSymbol.h"
2222 #include "llvm/MC/MCValue.h"
23 #include "llvm/MC/TargetAsmBackend.h"
2324 #include "llvm/Support/Debug.h"
2425 #include "llvm/Support/ELF.h"
2526 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/Support/raw_ostream.h"
27 #include "llvm/Target/TargetAsmBackend.h"
2828
2929 using namespace llvm;
3030
1515 #include "llvm/MC/MCContext.h"
1616 #include "llvm/MC/MCSymbol.h"
1717 #include "llvm/MC/MCValue.h"
18 #include "llvm/MC/TargetAsmBackend.h"
1819 #include "llvm/Support/Debug.h"
1920 #include "llvm/Support/raw_ostream.h"
20 #include "llvm/Target/TargetAsmBackend.h"
2121 using namespace llvm;
2222
2323 namespace {
1919 #include "llvm/MC/MCMachOSymbolFlags.h"
2020 #include "llvm/MC/MCSectionMachO.h"
2121 #include "llvm/MC/MCDwarf.h"
22 #include "llvm/MC/TargetAsmBackend.h"
2223 #include "llvm/Support/Dwarf.h"
2324 #include "llvm/Support/ErrorHandling.h"
2425 #include "llvm/Support/raw_ostream.h"
25 #include "llvm/Target/TargetAsmBackend.h"
2626
2727 using namespace llvm;
2828
1616 #include "llvm/MC/MCDwarf.h"
1717 #include "llvm/MC/MCExpr.h"
1818 #include "llvm/MC/MCSymbol.h"
19 #include "llvm/Target/TargetAsmBackend.h"
19 #include "llvm/MC/TargetAsmBackend.h"
2020 using namespace llvm;
2121
2222 MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
2727 #include "llvm/MC/MCStreamer.h"
2828 #include "llvm/MC/MCSymbol.h"
2929 #include "llvm/MC/MCDwarf.h"
30 #include "llvm/MC/TargetAsmParser.h"
3031 #include "llvm/Support/CommandLine.h"
3132 #include "llvm/Support/MathExtras.h"
3233 #include "llvm/Support/MemoryBuffer.h"
3334 #include "llvm/Support/SourceMgr.h"
3435 #include "llvm/Support/raw_ostream.h"
35 #include "llvm/Target/TargetAsmParser.h"
3636 #include
3737 #include
3838 using namespace llvm;
1515 #include "llvm/MC/MCSectionCOFF.h"
1616 #include "llvm/MC/MCStreamer.h"
1717 #include "llvm/MC/MCExpr.h"
18 #include "llvm/Target/TargetAsmParser.h"
18 #include "llvm/MC/TargetAsmParser.h"
1919 #include "llvm/Support/COFF.h"
2020 using namespace llvm;
2121
77 //===----------------------------------------------------------------------===//
88
99 #include "llvm/MC/MCParser/MCAsmParser.h"
10 #include "llvm/ADT/Twine.h"
1110 #include "llvm/MC/MCParser/MCAsmLexer.h"
1211 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
12 #include "llvm/MC/TargetAsmParser.h"
1313 #include "llvm/Support/SourceMgr.h"
1414 #include "llvm/Support/raw_ostream.h"
1515 #include "llvm/Support/Debug.h"
16 #include "llvm/Target/TargetAsmParser.h"
16 #include "llvm/ADT/Twine.h"
1717 using namespace llvm;
1818
1919 MCAsmParser::MCAsmParser() : TargetParser(0), ShowParsedOperands(0) {
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmParser.h"
9 #include "llvm/MC/TargetAsmParser.h"
1010 using namespace llvm;
1111
1212 TargetAsmParser::TargetAsmParser()
1818 #include "llvm/MC/MCSymbol.h"
1919 #include "llvm/MC/MCMachOSymbolFlags.h"
2020 #include "llvm/MC/MCValue.h"
21 #include "llvm/MC/TargetAsmBackend.h"
2122 #include "llvm/Object/MachOFormat.h"
2223 #include "llvm/Support/ErrorHandling.h"
23 #include "llvm/Target/TargetAsmBackend.h"
2424
2525 #include
2626 using namespace llvm;
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmBackend.h"
9 #include "llvm/MC/TargetAsmBackend.h"
1010 using namespace llvm;
1111
1212 TargetAsmBackend::TargetAsmBackend()
0 //===-- llvm/MC/TargetAsmLexer.cpp - Target Assembly Lexer ----------------===//
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/TargetAsmLexer.h"
10 using namespace llvm;
11
12 TargetAsmLexer::TargetAsmLexer(const Target &T) : TheTarget(T), Lexer(NULL) {}
13 TargetAsmLexer::~TargetAsmLexer() {}
2323 #include "llvm/MC/MCCodeEmitter.h"
2424 #include "llvm/MC/MCSectionCOFF.h"
2525 #include "llvm/MC/MCWin64EH.h"
26 #include "llvm/MC/TargetAsmBackend.h"
2627 #include "llvm/Target/TargetRegistry.h"
27 #include "llvm/Target/TargetAsmBackend.h"
2828 #include "llvm/ADT/StringMap.h"
2929
3030 #include "llvm/Support/COFF.h"
1212 #include "llvm/MC/MCAsmInfo.h"
1313 #include "llvm/MC/MCParser/MCAsmLexer.h"
1414 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
15 #include "llvm/MC/TargetAsmLexer.h"
1516
16 #include "llvm/Target/TargetAsmLexer.h"
1717 #include "llvm/Target/TargetMachine.h" // FIXME
1818 #include "llvm/Target/TargetRegistry.h"
1919
2020 #include "llvm/MC/MCExpr.h"
2121 #include "llvm/MC/MCInst.h"
2222 #include "llvm/MC/MCSubtargetInfo.h"
23 #include "llvm/MC/TargetAsmParser.h"
2324 #include "llvm/Target/TargetRegistry.h"
24 #include "llvm/Target/TargetAsmParser.h"
2525 #include "llvm/Support/SourceMgr.h"
2626 #include "llvm/Support/raw_ostream.h"
2727 #include "llvm/ADT/OwningPtr.h"
1818 #include "llvm/MC/MCObjectWriter.h"
1919 #include "llvm/MC/MCSectionELF.h"
2020 #include "llvm/MC/MCSectionMachO.h"
21 #include "llvm/MC/TargetAsmBackend.h"
2122 #include "llvm/Object/MachOFormat.h"
2223 #include "llvm/Support/ELF.h"
2324 #include "llvm/Support/ErrorHandling.h"
2425 #include "llvm/Support/raw_ostream.h"
25 #include "llvm/Target/TargetAsmBackend.h"
2626 using namespace llvm;
2727
2828 namespace {
1616 #include "llvm/MC/MCFixup.h"
1717 #include "llvm/MC/MCFixupKindInfo.h"
1818 #include "llvm/MC/MCValue.h"
19 #include "llvm/MC/TargetAsmBackend.h"
1920 #include "llvm/Object/MachOFormat.h"
2021 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Target/TargetAsmBackend.h"
2222 using namespace llvm;
2323 using namespace llvm::object;
2424
0 add_llvm_library(LLVMTarget
11 Mangler.cpp
22 Target.cpp
3 TargetAsmLexer.cpp
43 TargetData.cpp
54 TargetELFWriterInfo.cpp
65 TargetFrameLowering.cpp
1616 #include "llvm/MC/MCAsmInfo.h"
1717 #include "llvm/MC/MCParser/MCAsmLexer.h"
1818 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
19 #include "llvm/MC/TargetAsmLexer.h"
1920
20 #include "llvm/Target/TargetAsmLexer.h"
2121 #include "llvm/Target/TargetMachine.h" // FIXME
2222 #include "llvm/Target/TargetRegistry.h"
2323
1616 #include "llvm/MC/MCStreamer.h"
1717 #include "llvm/MC/MCExpr.h"
1818 #include "llvm/MC/MCInst.h"
19 #include "llvm/MC/TargetAsmParser.h"
1920 #include "llvm/Target/TargetRegistry.h"
20 #include "llvm/Target/TargetAsmParser.h"
2121 #include "llvm/Support/SourceMgr.h"
2222 #include "llvm/Support/raw_ostream.h"
2323 #include "llvm/ADT/OwningPtr.h"
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmBackend.h"
9 #include "llvm/MC/TargetAsmBackend.h"
1010 #include "MBlaze.h"
1111 #include "MBlazeELFWriterInfo.h"
1212 #include "llvm/ADT/Twine.h"
2323 #include "llvm/Support/ErrorHandling.h"
2424 #include "llvm/Support/raw_ostream.h"
2525 #include "llvm/Target/TargetRegistry.h"
26 #include "llvm/Target/TargetAsmBackend.h"
2726 using namespace llvm;
2827
2928 static unsigned getFixupKindSize(unsigned Kind) {
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmBackend.h"
9 #include "llvm/MC/TargetAsmBackend.h"
1010 #include "PPC.h"
1111 #include "PPCFixupKinds.h"
1212 #include "llvm/MC/MCMachObjectWriter.h"
+0
-14
lib/Target/TargetAsmLexer.cpp less more
None //===-- llvm/Target/TargetAsmLexer.cpp - Target Assembly Lexer ------------===//
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/TargetAsmLexer.h"
10 using namespace llvm;
11
12 TargetAsmLexer::TargetAsmLexer(const Target &T) : TheTarget(T), Lexer(NULL) {}
13 TargetAsmLexer::~TargetAsmLexer() {}
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/ADT/SmallVector.h"
10 #include "llvm/ADT/StringExtras.h"
11 #include "llvm/Target/TargetAsmLexer.h"
12 #include "llvm/Target/TargetRegistry.h"
139 #include "llvm/MC/MCAsmInfo.h"
1410 #include "llvm/MC/MCParser/MCAsmLexer.h"
1511 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
12 #include "llvm/MC/TargetAsmLexer.h"
13 #include "llvm/Target/TargetRegistry.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/ADT/StringExtras.h"
1616 #include "X86.h"
1717
1818 using namespace llvm;
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmParser.h"
9 #include "llvm/MC/TargetAsmParser.h"
1010 #include "X86.h"
1111 #include "X86Subtarget.h"
1212 #include "llvm/Target/TargetRegistry.h"
13 #include "llvm/Target/TargetAsmParser.h"
1413 #include "llvm/MC/MCStreamer.h"
1514 #include "llvm/MC/MCExpr.h"
1615 #include "llvm/MC/MCInst.h"
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Target/TargetAsmBackend.h"
9 #include "llvm/MC/TargetAsmBackend.h"
1010 #include "X86.h"
1111 #include "X86FixupKinds.h"
1212 #include "llvm/ADT/Twine.h"
2525 #include "llvm/Support/ErrorHandling.h"
2626 #include "llvm/Support/raw_ostream.h"
2727 #include "llvm/Target/TargetRegistry.h"
28 #include "llvm/Target/TargetAsmBackend.h"
2928 using namespace llvm;
3029
3130 // Option to allow disabling arithmetic relaxation to workaround PR9807, which
2323 #include "llvm/MC/MCStreamer.h"
2424 #include "llvm/MC/MCSubtargetInfo.h"
2525 #include "llvm/MC/SubtargetFeature.h"
26 #include "llvm/Target/TargetAsmBackend.h"
27 #include "llvm/Target/TargetAsmParser.h"
26 #include "llvm/MC/TargetAsmBackend.h"
27 #include "llvm/MC/TargetAsmParser.h"
2828 #include "llvm/Target/TargetData.h"
2929 #include "llvm/Target/TargetRegistry.h"
3030 #include "llvm/Target/TargetSelect.h"
3737 #include "llvm/MC/MCSubtargetInfo.h"
3838 #include "llvm/MC/MCSymbol.h"
3939 #include "llvm/MC/SubtargetFeature.h"
40 #include "llvm/Target/TargetAsmParser.h"
40 #include "llvm/MC/TargetAsmParser.h"
4141 #include "llvm/Target/TargetMachine.h"
4242 #include "llvm/Target/TargetRegisterInfo.h"
4343 #include "llvm/Target/TargetRegistry.h"