Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2011-07-26 00:24:13 +00:00
parent fcf5a8341f
commit 94b9550a32
34 changed files with 159 additions and 159 deletions

View File

@ -36,7 +36,7 @@ public:
// Real values. // Real values.
Real, Real,
// Register values (stored in IntVal). Only used by TargetAsmLexer. // Register values (stored in IntVal). Only used by MCTargetAsmLexer.
Register, Register,
// No-value. // No-value.

View File

@ -20,11 +20,11 @@ class MCAsmParserExtension;
class MCContext; class MCContext;
class MCExpr; class MCExpr;
class MCStreamer; class MCStreamer;
class MCTargetAsmParser;
class SMLoc; class SMLoc;
class SourceMgr; class SourceMgr;
class StringRef; class StringRef;
class Target; class Target;
class TargetAsmParser;
class Twine; class Twine;
/// MCAsmParser - Generic assembler parser interface, for use by target specific /// MCAsmParser - Generic assembler parser interface, for use by target specific
@ -37,7 +37,7 @@ private:
MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
void operator=(const MCAsmParser &); // DO NOT IMPLEMENT void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
TargetAsmParser *TargetParser; MCTargetAsmParser *TargetParser;
unsigned ShowParsedOperands : 1; unsigned ShowParsedOperands : 1;
@ -60,8 +60,8 @@ public:
/// getStreamer - Return the output streamer for the assembler. /// getStreamer - Return the output streamer for the assembler.
virtual MCStreamer &getStreamer() = 0; virtual MCStreamer &getStreamer() = 0;
TargetAsmParser &getTargetParser() const { return *TargetParser; } MCTargetAsmParser &getTargetParser() const { return *TargetParser; }
void setTargetParser(TargetAsmParser &P); void setTargetParser(MCTargetAsmParser &P);
bool getShowParsedOperands() const { return ShowParsedOperands; } bool getShowParsedOperands() const { return ShowParsedOperands; }
void setShowParsedOperands(bool Value) { ShowParsedOperands = Value; } void setShowParsedOperands(bool Value) { ShowParsedOperands = Value; }

View File

@ -1,4 +1,4 @@
//===-- llvm/Target/TargetAsmLexer.h - Target Assembly Lexer ----*- C++ -*-===// //===-- llvm/MC/MCTargetAsmLexer.h - Target Assembly Lexer ------*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,16 +7,16 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVM_MC_TARGETASMLEXER_H #ifndef LLVM_MC_MCTARGETASMLEXER_H
#define LLVM_MC_TARGETASMLEXER_H #define LLVM_MC_MCTARGETASMLEXER_H
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
namespace llvm { namespace llvm {
class Target; class Target;
/// TargetAsmLexer - Generic interface to target specific assembly lexers. /// MCTargetAsmLexer - Generic interface to target specific assembly lexers.
class TargetAsmLexer { class MCTargetAsmLexer {
/// The current token /// The current token
AsmToken CurTok; AsmToken CurTok;
@ -24,10 +24,10 @@ class TargetAsmLexer {
SMLoc ErrLoc; SMLoc ErrLoc;
std::string Err; std::string Err;
TargetAsmLexer(const TargetAsmLexer &); // DO NOT IMPLEMENT MCTargetAsmLexer(const MCTargetAsmLexer &); // DO NOT IMPLEMENT
void operator=(const TargetAsmLexer &); // DO NOT IMPLEMENT void operator=(const MCTargetAsmLexer &); // DO NOT IMPLEMENT
protected: // Can only create subclasses. protected: // Can only create subclasses.
TargetAsmLexer(const Target &); MCTargetAsmLexer(const Target &);
virtual AsmToken LexToken() = 0; virtual AsmToken LexToken() = 0;
@ -41,7 +41,7 @@ protected: // Can only create subclasses.
MCAsmLexer *Lexer; MCAsmLexer *Lexer;
public: public:
virtual ~TargetAsmLexer(); virtual ~MCTargetAsmLexer();
const Target &getTarget() const { return TheTarget; } const Target &getTarget() const { return TheTarget; }

View File

@ -1,4 +1,4 @@
//===-- llvm/Target/TargetAsmParser.h - Target Assembly Parser --*- C++ -*-===// //===-- llvm/MC/MCTargetAsmParser.h - Target Assembly Parser ----*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -20,18 +20,18 @@ class AsmToken;
class MCParsedAsmOperand; class MCParsedAsmOperand;
template <typename T> class SmallVectorImpl; template <typename T> class SmallVectorImpl;
/// TargetAsmParser - Generic interface to target specific assembly parsers. /// MCTargetAsmParser - Generic interface to target specific assembly parsers.
class TargetAsmParser : public MCAsmParserExtension { class MCTargetAsmParser : public MCAsmParserExtension {
TargetAsmParser(const TargetAsmParser &); // DO NOT IMPLEMENT MCTargetAsmParser(const MCTargetAsmParser &); // DO NOT IMPLEMENT
void operator=(const TargetAsmParser &); // DO NOT IMPLEMENT void operator=(const MCTargetAsmParser &); // DO NOT IMPLEMENT
protected: // Can only create subclasses. protected: // Can only create subclasses.
TargetAsmParser(); MCTargetAsmParser();
/// AvailableFeatures - The current set of available features. /// AvailableFeatures - The current set of available features.
unsigned AvailableFeatures; unsigned AvailableFeatures;
public: public:
virtual ~TargetAsmParser(); virtual ~MCTargetAsmParser();
unsigned getAvailableFeatures() const { return AvailableFeatures; } unsigned getAvailableFeatures() const { return AvailableFeatures; }
void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; } void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }

View File

@ -28,9 +28,11 @@ namespace llvm {
class AsmPrinter; class AsmPrinter;
class Module; class Module;
class MCAssembler; class MCAssembler;
class MCAsmBackend;
class MCAsmInfo; class MCAsmInfo;
class MCAsmParser; class MCAsmParser;
class MCCodeEmitter; class MCCodeEmitter;
class MCCodeGenInfo;
class MCContext; class MCContext;
class MCDisassembler; class MCDisassembler;
class MCInstPrinter; class MCInstPrinter;
@ -38,10 +40,8 @@ namespace llvm {
class MCRegisterInfo; class MCRegisterInfo;
class MCStreamer; class MCStreamer;
class MCSubtargetInfo; class MCSubtargetInfo;
class MCCodeGenInfo; class MCTargetAsmLexer;
class MCAsmBackend; class MCTargetAsmParser;
class TargetAsmLexer;
class TargetAsmParser;
class TargetMachine; class TargetMachine;
class raw_ostream; class raw_ostream;
class formatted_raw_ostream; class formatted_raw_ostream;
@ -87,10 +87,10 @@ namespace llvm {
typedef AsmPrinter *(*AsmPrinterCtorTy)(TargetMachine &TM, typedef AsmPrinter *(*AsmPrinterCtorTy)(TargetMachine &TM,
MCStreamer &Streamer); MCStreamer &Streamer);
typedef MCAsmBackend *(*MCAsmBackendCtorTy)(const Target &T, StringRef TT); typedef MCAsmBackend *(*MCAsmBackendCtorTy)(const Target &T, StringRef TT);
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T, typedef MCTargetAsmLexer *(*MCAsmLexerCtorTy)(const Target &T,
const MCRegisterInfo &MRI, const MCRegisterInfo &MRI,
const MCAsmInfo &MAI); const MCAsmInfo &MAI);
typedef TargetAsmParser *(*AsmParserCtorTy)(MCSubtargetInfo &STI, typedef MCTargetAsmParser *(*MCAsmParserCtorTy)(MCSubtargetInfo &STI,
MCAsmParser &P); MCAsmParser &P);
typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T); typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T);
typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T, typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T,
@ -163,13 +163,13 @@ namespace llvm {
/// MCAsmBackend, if registered. /// MCAsmBackend, if registered.
MCAsmBackendCtorTy MCAsmBackendCtorFn; MCAsmBackendCtorTy MCAsmBackendCtorFn;
/// AsmLexerCtorFn - Construction function for this target's TargetAsmLexer, /// MCAsmLexerCtorFn - Construction function for this target's
/// if registered. /// MCTargetAsmLexer, if registered.
AsmLexerCtorTy AsmLexerCtorFn; MCAsmLexerCtorTy MCAsmLexerCtorFn;
/// AsmParserCtorFn - Construction function for this target's /// MCAsmParserCtorFn - Construction function for this target's
/// TargetAsmParser, if registered. /// MCTargetAsmParser, if registered.
AsmParserCtorTy AsmParserCtorFn; MCAsmParserCtorTy MCAsmParserCtorFn;
/// AsmPrinterCtorFn - Construction function for this target's AsmPrinter, /// AsmPrinterCtorFn - Construction function for this target's AsmPrinter,
/// if registered. /// if registered.
@ -223,11 +223,11 @@ namespace llvm {
/// hasMCAsmBackend - Check if this target supports .o generation. /// hasMCAsmBackend - Check if this target supports .o generation.
bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != 0; } bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != 0; }
/// hasAsmLexer - Check if this target supports .s lexing. /// hasMCAsmLexer - Check if this target supports .s lexing.
bool hasAsmLexer() const { return AsmLexerCtorFn != 0; } bool hasMCAsmLexer() const { return MCAsmLexerCtorFn != 0; }
/// hasAsmParser - Check if this target supports .s parsing. /// hasAsmParser - Check if this target supports .s parsing.
bool hasAsmParser() const { return AsmParserCtorFn != 0; } bool hasMCAsmParser() const { return MCAsmParserCtorFn != 0; }
/// hasAsmPrinter - Check if this target supports .s printing. /// hasAsmPrinter - Check if this target supports .s printing.
bool hasAsmPrinter() const { return AsmPrinterCtorFn != 0; } bool hasAsmPrinter() const { return AsmPrinterCtorFn != 0; }
@ -331,24 +331,24 @@ namespace llvm {
return MCAsmBackendCtorFn(*this, Triple); return MCAsmBackendCtorFn(*this, Triple);
} }
/// createAsmLexer - Create a target specific assembly lexer. /// createMCAsmLexer - Create a target specific assembly lexer.
/// ///
TargetAsmLexer *createAsmLexer(const MCRegisterInfo &MRI, MCTargetAsmLexer *createMCAsmLexer(const MCRegisterInfo &MRI,
const MCAsmInfo &MAI) const { const MCAsmInfo &MAI) const {
if (!AsmLexerCtorFn) if (!MCAsmLexerCtorFn)
return 0; return 0;
return AsmLexerCtorFn(*this, MRI, MAI); return MCAsmLexerCtorFn(*this, MRI, MAI);
} }
/// createAsmParser - Create a target specific assembly parser. /// createMCAsmParser - Create a target specific assembly parser.
/// ///
/// \arg Parser - The target independent parser implementation to use for /// \arg Parser - The target independent parser implementation to use for
/// parsing and lexing. /// parsing and lexing.
TargetAsmParser *createAsmParser(MCSubtargetInfo &STI, MCTargetAsmParser *createMCAsmParser(MCSubtargetInfo &STI,
MCAsmParser &Parser) const { MCAsmParser &Parser) const {
if (!AsmParserCtorFn) if (!MCAsmParserCtorFn)
return 0; return 0;
return AsmParserCtorFn(STI, Parser); return MCAsmParserCtorFn(STI, Parser);
} }
/// createAsmPrinter - Create a target specific assembly printer pass. This /// createAsmPrinter - Create a target specific assembly printer pass. This
@ -618,7 +618,7 @@ namespace llvm {
T.MCAsmBackendCtorFn = Fn; T.MCAsmBackendCtorFn = Fn;
} }
/// RegisterAsmLexer - Register a TargetAsmLexer implementation for the /// RegisterMCAsmLexer - Register a MCTargetAsmLexer implementation for the
/// given target. /// given target.
/// ///
/// Clients are responsible for ensuring that registration doesn't occur /// Clients are responsible for ensuring that registration doesn't occur
@ -626,24 +626,24 @@ namespace llvm {
/// this is done by initializing all targets at program startup. /// this is done by initializing all targets at program startup.
/// ///
/// @param T - The target being registered. /// @param T - The target being registered.
/// @param Fn - A function to construct an AsmLexer for the target. /// @param Fn - A function to construct an MCAsmLexer for the target.
static void RegisterAsmLexer(Target &T, Target::AsmLexerCtorTy Fn) { static void RegisterMCAsmLexer(Target &T, Target::MCAsmLexerCtorTy Fn) {
if (!T.AsmLexerCtorFn) if (!T.MCAsmLexerCtorFn)
T.AsmLexerCtorFn = Fn; T.MCAsmLexerCtorFn = Fn;
} }
/// RegisterAsmParser - Register a TargetAsmParser implementation for the /// RegisterMCAsmParser - Register a MCTargetAsmParser implementation for
/// given target. /// the given target.
/// ///
/// Clients are responsible for ensuring that registration doesn't occur /// Clients are responsible for ensuring that registration doesn't occur
/// while another thread is attempting to access the registry. Typically /// while another thread is attempting to access the registry. Typically
/// this is done by initializing all targets at program startup. /// this is done by initializing all targets at program startup.
/// ///
/// @param T - The target being registered. /// @param T - The target being registered.
/// @param Fn - A function to construct an AsmParser for the target. /// @param Fn - A function to construct an MCTargetAsmParser for the target.
static void RegisterAsmParser(Target &T, Target::AsmParserCtorTy Fn) { static void RegisterMCAsmParser(Target &T, Target::MCAsmParserCtorTy Fn) {
if (!T.AsmParserCtorFn) if (!T.MCAsmParserCtorFn)
T.AsmParserCtorFn = Fn; T.MCAsmParserCtorFn = Fn;
} }
/// RegisterAsmPrinter - Register an AsmPrinter implementation for the given /// RegisterAsmPrinter - Register an AsmPrinter implementation for the given
@ -974,44 +974,45 @@ namespace llvm {
} }
}; };
/// RegisterAsmLexer - Helper template for registering a target specific /// RegisterMCAsmLexer - Helper template for registering a target specific
/// assembly lexer, for use in the target machine initialization /// assembly lexer, for use in the target machine initialization
/// function. Usage: /// function. Usage:
/// ///
/// extern "C" void LLVMInitializeFooAsmLexer() { /// extern "C" void LLVMInitializeFooMCAsmLexer() {
/// extern Target TheFooTarget; /// extern Target TheFooTarget;
/// RegisterAsmLexer<FooAsmLexer> X(TheFooTarget); /// RegisterMCAsmLexer<FooMCAsmLexer> X(TheFooTarget);
/// } /// }
template<class AsmLexerImpl> template<class MCAsmLexerImpl>
struct RegisterAsmLexer { struct RegisterMCAsmLexer {
RegisterAsmLexer(Target &T) { RegisterMCAsmLexer(Target &T) {
TargetRegistry::RegisterAsmLexer(T, &Allocator); TargetRegistry::RegisterMCAsmLexer(T, &Allocator);
} }
private: private:
static TargetAsmLexer *Allocator(const Target &T, const MCRegisterInfo &MRI, static MCTargetAsmLexer *Allocator(const Target &T,
const MCRegisterInfo &MRI,
const MCAsmInfo &MAI) { const MCAsmInfo &MAI) {
return new AsmLexerImpl(T, MRI, MAI); return new MCAsmLexerImpl(T, MRI, MAI);
} }
}; };
/// RegisterAsmParser - Helper template for registering a target specific /// RegisterMCAsmParser - Helper template for registering a target specific
/// assembly parser, for use in the target machine initialization /// assembly parser, for use in the target machine initialization
/// function. Usage: /// function. Usage:
/// ///
/// extern "C" void LLVMInitializeFooAsmParser() { /// extern "C" void LLVMInitializeFooMCAsmParser() {
/// extern Target TheFooTarget; /// extern Target TheFooTarget;
/// RegisterAsmParser<FooAsmParser> X(TheFooTarget); /// RegisterMCAsmParser<FooAsmParser> X(TheFooTarget);
/// } /// }
template<class AsmParserImpl> template<class MCAsmParserImpl>
struct RegisterAsmParser { struct RegisterMCAsmParser {
RegisterAsmParser(Target &T) { RegisterMCAsmParser(Target &T) {
TargetRegistry::RegisterAsmParser(T, &Allocator); TargetRegistry::RegisterMCAsmParser(T, &Allocator);
} }
private: private:
static TargetAsmParser *Allocator(MCSubtargetInfo &STI, MCAsmParser &P) { static MCTargetAsmParser *Allocator(MCSubtargetInfo &STI, MCAsmParser &P) {
return new AsmParserImpl(STI, P); return new MCAsmParserImpl(STI, P);
} }
}; };

View File

@ -23,7 +23,7 @@
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/OwningPtr.h"
@ -121,7 +121,8 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode) const {
STI(TM.getTarget().createMCSubtargetInfo(TM.getTargetTriple(), STI(TM.getTarget().createMCSubtargetInfo(TM.getTargetTriple(),
TM.getTargetCPU(), TM.getTargetCPU(),
TM.getTargetFeatureString())); TM.getTargetFeatureString()));
OwningPtr<TargetAsmParser> TAP(TM.getTarget().createAsmParser(*STI, *Parser)); OwningPtr<MCTargetAsmParser>
TAP(TM.getTarget().createMCAsmParser(*STI, *Parser));
if (!TAP) if (!TAP)
report_fatal_error("Inline asm not supported by this streamer because" report_fatal_error("Inline asm not supported by this streamer because"
" we don't have an asm parser for this target\n"); " we don't have an asm parser for this target\n");

View File

@ -39,7 +39,7 @@ add_llvm_library(LLVMMC
WinCOFFObjectWriter.cpp WinCOFFObjectWriter.cpp
SubtargetFeature.cpp SubtargetFeature.cpp
MCAsmBackend.cpp MCAsmBackend.cpp
TargetAsmLexer.cpp MCTargetAsmLexer.cpp
) )
add_subdirectory(MCParser) add_subdirectory(MCParser)

View File

@ -28,8 +28,8 @@
#include "llvm/MC/MCParser/AsmLexer.h" #include "llvm/MC/MCParser/AsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/TargetAsmLexer.h" #include "llvm/MC/MCTargetAsmLexer.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/MemoryObject.h" #include "llvm/Support/MemoryObject.h"
#include "llvm/Support/SourceMgr.h" #include "llvm/Support/SourceMgr.h"
@ -193,7 +193,7 @@ EDDisassembler::EDDisassembler(CPUKey &key) :
return; return;
GenericAsmLexer.reset(new AsmLexer(*AsmInfo)); GenericAsmLexer.reset(new AsmLexer(*AsmInfo));
SpecificAsmLexer.reset(Tgt->createAsmLexer(*MRI, *AsmInfo)); SpecificAsmLexer.reset(Tgt->createMCAsmLexer(*MRI, *AsmInfo));
SpecificAsmLexer->InstallLexer(*GenericAsmLexer); SpecificAsmLexer->InstallLexer(*GenericAsmLexer);
initMaps(*MRI); initMaps(*MRI);
@ -368,8 +368,8 @@ int EDDisassembler::parseInst(SmallVectorImpl<MCParsedAsmOperand*> &operands,
StringRef triple = tripleFromArch(Key.Arch); StringRef triple = tripleFromArch(Key.Arch);
OwningPtr<MCSubtargetInfo> STI(Tgt->createMCSubtargetInfo(triple, "", "")); OwningPtr<MCSubtargetInfo> STI(Tgt->createMCSubtargetInfo(triple, "", ""));
OwningPtr<TargetAsmParser> TargetParser(Tgt->createAsmParser(*STI, OwningPtr<MCTargetAsmParser>
*genericParser)); TargetParser(Tgt->createMCAsmParser(*STI, *genericParser));
AsmToken OpcodeToken = genericParser->Lex(); AsmToken OpcodeToken = genericParser->Lex();
AsmToken NextToken = genericParser->Lex(); // consume next token, because specificParser expects us to AsmToken NextToken = genericParser->Lex(); // consume next token, because specificParser expects us to

View File

@ -41,11 +41,11 @@ class MCParsedAsmOperand;
class MCRegisterInfo; class MCRegisterInfo;
class MCStreamer; class MCStreamer;
class MCSubtargetInfo; class MCSubtargetInfo;
class MCTargetAsmLexer;
class MCTargetAsmParser;
template <typename T> class SmallVectorImpl; template <typename T> class SmallVectorImpl;
class SourceMgr; class SourceMgr;
class Target; class Target;
class TargetAsmLexer;
class TargetAsmParser;
struct EDInstInfo; struct EDInstInfo;
struct EDInst; struct EDInst;
@ -159,7 +159,7 @@ struct EDDisassembler {
/// The target-specific lexer for use in tokenizing strings, in /// The target-specific lexer for use in tokenizing strings, in
/// target-independent and target-specific portions /// target-independent and target-specific portions
llvm::OwningPtr<llvm::AsmLexer> GenericAsmLexer; llvm::OwningPtr<llvm::AsmLexer> GenericAsmLexer;
llvm::OwningPtr<llvm::TargetAsmLexer> SpecificAsmLexer; llvm::OwningPtr<llvm::MCTargetAsmLexer> SpecificAsmLexer;
/// The guard for the above /// The guard for the above
llvm::sys::Mutex ParserMutex; llvm::sys::Mutex ParserMutex;
/// The LLVM number used for the target disassembly syntax variant /// The LLVM number used for the target disassembly syntax variant

View File

@ -18,6 +18,7 @@
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h" #include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCParser/AsmCond.h" #include "llvm/MC/MCParser/AsmCond.h"
#include "llvm/MC/MCParser/AsmLexer.h" #include "llvm/MC/MCParser/AsmLexer.h"
@ -27,8 +28,7 @@
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/MC/TargetAsmParser.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/MathExtras.h" #include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/MemoryBuffer.h"

View File

@ -7,5 +7,5 @@ add_llvm_library(LLVMMCParser
MCAsmLexer.cpp MCAsmLexer.cpp
MCAsmParser.cpp MCAsmParser.cpp
MCAsmParserExtension.cpp MCAsmParserExtension.cpp
TargetAsmParser.cpp MCTargetAsmParser.cpp
) )

View File

@ -17,7 +17,7 @@
#include "llvm/MC/MCSectionCOFF.h" #include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Support/COFF.h" #include "llvm/Support/COFF.h"
using namespace llvm; using namespace llvm;

View File

@ -10,7 +10,7 @@
#include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Support/SourceMgr.h" #include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
@ -23,7 +23,7 @@ MCAsmParser::MCAsmParser() : TargetParser(0), ShowParsedOperands(0) {
MCAsmParser::~MCAsmParser() { MCAsmParser::~MCAsmParser() {
} }
void MCAsmParser::setTargetParser(TargetAsmParser &P) { void MCAsmParser::setTargetParser(MCTargetAsmParser &P) {
assert(!TargetParser && "Target parser is already initialized!"); assert(!TargetParser && "Target parser is already initialized!");
TargetParser = &P; TargetParser = &P;
TargetParser->Initialize(*this); TargetParser->Initialize(*this);

View File

@ -1,4 +1,4 @@
//===-- TargetAsmParser.cpp - Target Assembly Parser -----------------------==// //===-- MCTargetAsmParser.cpp - Target Assembly Parser ---------------------==//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,13 +7,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
using namespace llvm; using namespace llvm;
TargetAsmParser::TargetAsmParser() MCTargetAsmParser::MCTargetAsmParser()
: AvailableFeatures(0) : AvailableFeatures(0)
{ {
} }
TargetAsmParser::~TargetAsmParser() { MCTargetAsmParser::~MCTargetAsmParser() {
} }

View File

@ -1,4 +1,4 @@
//===-- llvm/MC/TargetAsmLexer.cpp - Target Assembly Lexer ----------------===// //===-- llvm/MC/MCTargetAsmLexer.cpp - Target Assembly Lexer --------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -7,8 +7,10 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/TargetAsmLexer.h" #include "llvm/MC/MCTargetAsmLexer.h"
using namespace llvm; using namespace llvm;
TargetAsmLexer::TargetAsmLexer(const Target &T) : TheTarget(T), Lexer(NULL) {} MCTargetAsmLexer::MCTargetAsmLexer(const Target &T)
TargetAsmLexer::~TargetAsmLexer() {} : TheTarget(T), Lexer(NULL) {
}
MCTargetAsmLexer::~MCTargetAsmLexer() {}

View File

@ -7,13 +7,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "ARM.h" #include "MCTargetDesc/ARMBaseInfo.h"
#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/TargetAsmLexer.h" #include "llvm/MC/MCTargetAsmLexer.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -29,7 +29,7 @@ using namespace llvm;
namespace { namespace {
class ARMBaseAsmLexer : public TargetAsmLexer { class ARMBaseAsmLexer : public MCTargetAsmLexer {
const MCAsmInfo &AsmInfo; const MCAsmInfo &AsmInfo;
const AsmToken &lexDefinite() { const AsmToken &lexDefinite() {
@ -76,7 +76,7 @@ protected:
} }
public: public:
ARMBaseAsmLexer(const Target &T, const MCAsmInfo &MAI) ARMBaseAsmLexer(const Target &T, const MCAsmInfo &MAI)
: TargetAsmLexer(T), AsmInfo(MAI) { : MCTargetAsmLexer(T), AsmInfo(MAI) {
} }
}; };
@ -138,6 +138,6 @@ AsmToken ARMBaseAsmLexer::LexTokenUAL() {
} }
extern "C" void LLVMInitializeARMAsmLexer() { extern "C" void LLVMInitializeARMAsmLexer() {
RegisterAsmLexer<ARMAsmLexer> X(TheARMTarget); RegisterMCAsmLexer<ARMAsmLexer> X(TheARMTarget);
RegisterAsmLexer<ThumbAsmLexer> Y(TheThumbTarget); RegisterMCAsmLexer<ThumbAsmLexer> Y(TheThumbTarget);
} }

View File

@ -7,9 +7,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "ARM.h" #include "MCTargetDesc/ARMBaseInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMAddressingModes.h" #include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMMCExpr.h" #include "MCTargetDesc/ARMMCExpr.h"
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
@ -20,12 +18,14 @@
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h" #include "llvm/MC/MCInst.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/SourceMgr.h" #include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/StringSwitch.h"
@ -37,7 +37,7 @@ namespace {
class ARMOperand; class ARMOperand;
class ARMAsmParser : public TargetAsmParser { class ARMAsmParser : public MCTargetAsmParser {
MCSubtargetInfo &STI; MCSubtargetInfo &STI;
MCAsmParser &Parser; MCAsmParser &Parser;
@ -141,7 +141,7 @@ class ARMAsmParser : public TargetAsmParser {
public: public:
ARMAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser) ARMAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser)
: TargetAsmParser(), STI(_STI), Parser(_Parser) { : MCTargetAsmParser(), STI(_STI), Parser(_Parser) {
MCAsmParserExtension::Initialize(_Parser); MCAsmParserExtension::Initialize(_Parser);
// Initialize the set of available features. // Initialize the set of available features.
@ -2665,8 +2665,8 @@ extern "C" void LLVMInitializeARMAsmLexer();
/// Force static initialization. /// Force static initialization.
extern "C" void LLVMInitializeARMAsmParser() { extern "C" void LLVMInitializeARMAsmParser() {
RegisterAsmParser<ARMAsmParser> X(TheARMTarget); RegisterMCAsmParser<ARMAsmParser> X(TheARMTarget);
RegisterAsmParser<ARMAsmParser> Y(TheThumbTarget); RegisterMCAsmParser<ARMAsmParser> Y(TheThumbTarget);
LLVMInitializeARMAsmLexer(); LLVMInitializeARMAsmLexer();
} }

View File

@ -7,7 +7,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MBlaze.h" #include "MCTargetDesc/MBlazeBaseInfo.h"
#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
@ -17,7 +17,7 @@
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/TargetAsmLexer.h" #include "llvm/MC/MCTargetAsmLexer.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -28,7 +28,7 @@ using namespace llvm;
namespace { namespace {
class MBlazeBaseAsmLexer : public TargetAsmLexer { class MBlazeBaseAsmLexer : public MCTargetAsmLexer {
const MCAsmInfo &AsmInfo; const MCAsmInfo &AsmInfo;
const AsmToken &lexDefinite() { const AsmToken &lexDefinite() {
@ -75,7 +75,7 @@ namespace {
} }
public: public:
MBlazeBaseAsmLexer(const Target &T, const MCAsmInfo &MAI) MBlazeBaseAsmLexer(const Target &T, const MCAsmInfo &MAI)
: TargetAsmLexer(T), AsmInfo(MAI) { : MCTargetAsmLexer(T), AsmInfo(MAI) {
} }
}; };
@ -118,6 +118,6 @@ AsmToken MBlazeBaseAsmLexer::LexTokenUAL() {
} }
extern "C" void LLVMInitializeMBlazeAsmLexer() { extern "C" void LLVMInitializeMBlazeAsmLexer() {
RegisterAsmLexer<MBlazeAsmLexer> X(TheMBlazeTarget); RegisterMCAsmLexer<MBlazeAsmLexer> X(TheMBlazeTarget);
} }

View File

@ -7,17 +7,14 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MBlaze.h" #include "MCTargetDesc/MBlazeBaseInfo.h"
#include "MBlazeSubtarget.h"
#include "MBlazeRegisterInfo.h"
#include "MBlazeISelLowering.h"
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h" #include "llvm/MC/MCInst.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/SourceMgr.h" #include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
@ -30,7 +27,7 @@ using namespace llvm;
namespace { namespace {
struct MBlazeOperand; struct MBlazeOperand;
class MBlazeAsmParser : public TargetAsmParser { class MBlazeAsmParser : public MCTargetAsmParser {
MCAsmParser &Parser; MCAsmParser &Parser;
MCAsmParser &getParser() const { return Parser; } MCAsmParser &getParser() const { return Parser; }
@ -64,7 +61,7 @@ class MBlazeAsmParser : public TargetAsmParser {
public: public:
MBlazeAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser) MBlazeAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser)
: TargetAsmParser(), Parser(_Parser) {} : MCTargetAsmParser(), Parser(_Parser) {}
virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc, virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
SmallVectorImpl<MCParsedAsmOperand*> &Operands); SmallVectorImpl<MCParsedAsmOperand*> &Operands);
@ -558,7 +555,7 @@ extern "C" void LLVMInitializeMBlazeAsmLexer();
/// Force static initialization. /// Force static initialization.
extern "C" void LLVMInitializeMBlazeAsmParser() { extern "C" void LLVMInitializeMBlazeAsmParser() {
RegisterAsmParser<MBlazeAsmParser> X(TheMBlazeTarget); RegisterMCAsmParser<MBlazeAsmParser> X(TheMBlazeTarget);
LLVMInitializeMBlazeAsmLexer(); LLVMInitializeMBlazeAsmLexer();
} }

View File

@ -13,7 +13,8 @@
#define DEBUG_TYPE "asm-printer" #define DEBUG_TYPE "asm-printer"
#include "PPCInstPrinter.h" #include "PPCInstPrinter.h"
#include "PPCPredicates.h" #include "MCTargetDesc/PPCBaseInfo.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h" #include "llvm/MC/MCInst.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"

View File

@ -3,5 +3,6 @@ add_llvm_library(LLVMPowerPCDesc
PPCMCTargetDesc.cpp PPCMCTargetDesc.cpp
PPCMCAsmInfo.cpp PPCMCAsmInfo.cpp
PPCMCCodeEmitter.cpp PPCMCCodeEmitter.cpp
PPCPredicates.cpp
) )
add_dependencies(LLVMPowerPCDesc PowerPCCommonTableGen) add_dependencies(LLVMPowerPCDesc PowerPCCommonTableGen)

View File

@ -14,8 +14,6 @@
#ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H #ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H
#define LLVM_TARGET_POWERPC_PPCPREDICATES_H #define LLVM_TARGET_POWERPC_PPCPREDICATES_H
#include "PPC.h"
namespace llvm { namespace llvm {
namespace PPC { namespace PPC {
/// Predicate - These are "(BI << 5) | BO" for various predicates. /// Predicate - These are "(BI << 5) | BO" for various predicates.

View File

@ -18,9 +18,9 @@
#define DEBUG_TYPE "asmprinter" #define DEBUG_TYPE "asmprinter"
#include "PPC.h" #include "PPC.h"
#include "PPCPredicates.h"
#include "PPCTargetMachine.h" #include "PPCTargetMachine.h"
#include "PPCSubtarget.h" #include "PPCSubtarget.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "llvm/Analysis/DebugInfo.h" #include "llvm/Analysis/DebugInfo.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"

View File

@ -19,7 +19,7 @@
#include "PPC.h" #include "PPC.h"
#include "PPCInstrBuilder.h" #include "PPCInstrBuilder.h"
#include "PPCInstrInfo.h" #include "PPCInstrInfo.h"
#include "PPCPredicates.h" #include "MCTargetDesc/PPCPredicates.h"
#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"

View File

@ -14,8 +14,8 @@
#define DEBUG_TYPE "ppc-codegen" #define DEBUG_TYPE "ppc-codegen"
#include "PPC.h" #include "PPC.h"
#include "PPCPredicates.h"
#include "PPCTargetMachine.h" #include "PPCTargetMachine.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionAnalysis.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h"

View File

@ -14,8 +14,8 @@
#include "PPCISelLowering.h" #include "PPCISelLowering.h"
#include "PPCMachineFunctionInfo.h" #include "PPCMachineFunctionInfo.h"
#include "PPCPerfectShuffle.h" #include "PPCPerfectShuffle.h"
#include "PPCPredicates.h"
#include "PPCTargetMachine.h" #include "PPCTargetMachine.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/VectorExtras.h" #include "llvm/ADT/VectorExtras.h"
#include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/CallingConvLower.h"

View File

@ -15,9 +15,9 @@
#include "PPC.h" #include "PPC.h"
#include "PPCInstrBuilder.h" #include "PPCInstrBuilder.h"
#include "PPCMachineFunctionInfo.h" #include "PPCMachineFunctionInfo.h"
#include "PPCPredicates.h"
#include "PPCTargetMachine.h" #include "PPCTargetMachine.h"
#include "PPCHazardRecognizers.h" #include "PPCHazardRecognizers.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineMemOperand.h"

View File

@ -7,20 +7,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "MCTargetDesc/X86BaseInfo.h"
#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/TargetAsmLexer.h" #include "llvm/MC/MCTargetAsmLexer.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "X86.h"
using namespace llvm; using namespace llvm;
namespace { namespace {
class X86AsmLexer : public TargetAsmLexer { class X86AsmLexer : public MCTargetAsmLexer {
const MCAsmInfo &AsmInfo; const MCAsmInfo &AsmInfo;
bool tentativeIsValid; bool tentativeIsValid;
@ -61,7 +61,7 @@ protected:
} }
public: public:
X86AsmLexer(const Target &T, const MCRegisterInfo &MRI, const MCAsmInfo &MAI) X86AsmLexer(const Target &T, const MCRegisterInfo &MRI, const MCAsmInfo &MAI)
: TargetAsmLexer(T), AsmInfo(MAI), tentativeIsValid(false) { : MCTargetAsmLexer(T), AsmInfo(MAI), tentativeIsValid(false) {
} }
}; };
@ -160,6 +160,6 @@ AsmToken X86AsmLexer::LexTokenIntel() {
} }
extern "C" void LLVMInitializeX86AsmLexer() { extern "C" void LLVMInitializeX86AsmLexer() {
RegisterAsmLexer<X86AsmLexer> X(TheX86_32Target); RegisterMCAsmLexer<X86AsmLexer> X(TheX86_32Target);
RegisterAsmLexer<X86AsmLexer> Y(TheX86_64Target); RegisterMCAsmLexer<X86AsmLexer> Y(TheX86_64Target);
} }

View File

@ -7,9 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/MC/TargetAsmParser.h" #include "MCTargetDesc/X86BaseInfo.h"
#include "X86.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "X86Subtarget.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCExpr.h"
@ -32,7 +31,7 @@ using namespace llvm;
namespace { namespace {
struct X86Operand; struct X86Operand;
class X86ATTAsmParser : public TargetAsmParser { class X86ATTAsmParser : public MCTargetAsmParser {
MCSubtargetInfo &STI; MCSubtargetInfo &STI;
MCAsmParser &Parser; MCAsmParser &Parser;
@ -75,7 +74,7 @@ private:
public: public:
X86ATTAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser) X86ATTAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser)
: TargetAsmParser(), STI(sti), Parser(parser) { : MCTargetAsmParser(), STI(sti), Parser(parser) {
// Initialize the set of available features. // Initialize the set of available features.
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
@ -1130,8 +1129,8 @@ extern "C" void LLVMInitializeX86AsmLexer();
// Force static initialization. // Force static initialization.
extern "C" void LLVMInitializeX86AsmParser() { extern "C" void LLVMInitializeX86AsmParser() {
RegisterAsmParser<X86ATTAsmParser> X(TheX86_32Target); RegisterMCAsmParser<X86ATTAsmParser> X(TheX86_32Target);
RegisterAsmParser<X86ATTAsmParser> Y(TheX86_64Target); RegisterMCAsmParser<X86ATTAsmParser> Y(TheX86_64Target);
LLVMInitializeX86AsmLexer(); LLVMInitializeX86AsmLexer();
} }

View File

@ -14,9 +14,9 @@
#include "X86InstComments.h" #include "X86InstComments.h"
#include "MCTargetDesc/X86MCTargetDesc.h" #include "MCTargetDesc/X86MCTargetDesc.h"
#include "Utils/X86ShuffleDecode.h"
#include "llvm/MC/MCInst.h" #include "llvm/MC/MCInst.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "../Utils/X86ShuffleDecode.h"
using namespace llvm; using namespace llvm;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -24,8 +24,8 @@
#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/SubtargetFeature.h"
#include "llvm/MC/TargetAsmParser.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetSelect.h" #include "llvm/Target/TargetSelect.h"
#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/OwningPtr.h"
@ -394,7 +394,7 @@ static int AssembleInput(const char *ProgName) {
OwningPtr<MCAsmParser> Parser(createMCAsmParser(*TheTarget, SrcMgr, Ctx, OwningPtr<MCAsmParser> Parser(createMCAsmParser(*TheTarget, SrcMgr, Ctx,
*Str.get(), *MAI)); *Str.get(), *MAI));
OwningPtr<TargetAsmParser> TAP(TheTarget->createAsmParser(*STI, *Parser)); OwningPtr<MCTargetAsmParser> TAP(TheTarget->createMCAsmParser(*STI, *Parser));
if (!TAP) { if (!TAP) {
errs() << ProgName errs() << ProgName
<< ": error: this target does not support assembly parsing.\n"; << ": error: this target does not support assembly parsing.\n";

View File

@ -38,7 +38,7 @@
#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/SubtargetFeature.h"
#include "llvm/MC/TargetAsmParser.h" #include "llvm/MC/MCTargetAsmParser.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetRegistry.h"
@ -626,8 +626,8 @@ bool LTOModule::addAsmGlobalSymbols(MCContext &Context) {
createMCSubtargetInfo(_target->getTargetTriple(), createMCSubtargetInfo(_target->getTargetTriple(),
_target->getTargetCPU(), _target->getTargetCPU(),
_target->getTargetFeatureString())); _target->getTargetFeatureString()));
OwningPtr<TargetAsmParser> OwningPtr<MCTargetAsmParser>
TAP(_target->getTarget().createAsmParser(*STI, *Parser.get())); TAP(_target->getTarget().createMCAsmParser(*STI, *Parser.get()));
Parser->setTargetParser(*TAP); Parser->setTargetParser(*TAP);
int Res = Parser->Run(false); int Res = Parser->Run(false);
if (Res) if (Res)

View File

@ -2172,7 +2172,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << "\n#ifdef GET_ASSEMBLER_HEADER\n"; OS << "\n#ifdef GET_ASSEMBLER_HEADER\n";
OS << "#undef GET_ASSEMBLER_HEADER\n"; OS << "#undef GET_ASSEMBLER_HEADER\n";
OS << " // This should be included into the middle of the declaration of\n"; OS << " // This should be included into the middle of the declaration of\n";
OS << " // your subclasses implementation of TargetAsmParser.\n"; OS << " // your subclasses implementation of MCTargetAsmParser.\n";
OS << " unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const;\n"; OS << " unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const;\n";
OS << " enum MatchResultTy {\n"; OS << " enum MatchResultTy {\n";
OS << " Match_ConversionFail,\n"; OS << " Match_ConversionFail,\n";