Skip to content

Commit

Permalink
Remove MCTargetAsmLexer and its derived classes now that edis,
Browse files Browse the repository at this point in the history
its only user, is gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170699 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rdivacky committed Dec 20, 2012
1 parent 332bd79 commit 6af228a
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 593 deletions.
10 changes: 0 additions & 10 deletions include/llvm/MC/MCParser/MCAsmLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class AsmToken {
// Real values.
Real,

// Register values (stored in IntVal). Only used by MCTargetAsmLexer.
Register,

// No-value.
EndOfStatement,
Colon,
Expand Down Expand Up @@ -104,13 +101,6 @@ class AsmToken {
assert(Kind == Integer && "This token isn't an integer!");
return IntVal;
}

/// getRegVal - Get the register number for the current token, which should
/// be a register.
unsigned getRegVal() const {
assert(Kind == Register && "This token isn't a register!");
return static_cast<unsigned>(IntVal);
}
};

/// MCAsmLexer - Generic assembler lexer interface, for use by target specific
Expand Down
89 changes: 0 additions & 89 deletions include/llvm/MC/MCTargetAsmLexer.h

This file was deleted.

56 changes: 0 additions & 56 deletions include/llvm/Support/TargetRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace llvm {
class MCRegisterInfo;
class MCStreamer;
class MCSubtargetInfo;
class MCTargetAsmLexer;
class MCTargetAsmParser;
class TargetMachine;
class TargetOptions;
Expand Down Expand Up @@ -96,9 +95,6 @@ namespace llvm {
typedef MCAsmBackend *(*MCAsmBackendCtorTy)(const Target &T,
StringRef TT,
StringRef CPU);
typedef MCTargetAsmLexer *(*MCAsmLexerCtorTy)(const Target &T,
const MCRegisterInfo &MRI,
const MCAsmInfo &MAI);
typedef MCTargetAsmParser *(*MCAsmParserCtorTy)(MCSubtargetInfo &STI,
MCAsmParser &P);
typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T,
Expand Down Expand Up @@ -182,10 +178,6 @@ namespace llvm {
/// MCAsmBackend, if registered.
MCAsmBackendCtorTy MCAsmBackendCtorFn;

/// MCAsmLexerCtorFn - Construction function for this target's
/// MCTargetAsmLexer, if registered.
MCAsmLexerCtorTy MCAsmLexerCtorFn;

/// MCAsmParserCtorFn - Construction function for this target's
/// MCTargetAsmParser, if registered.
MCAsmParserCtorTy MCAsmParserCtorFn;
Expand Down Expand Up @@ -242,9 +234,6 @@ namespace llvm {
/// hasMCAsmBackend - Check if this target supports .o generation.
bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != 0; }

/// hasMCAsmLexer - Check if this target supports .s lexing.
bool hasMCAsmLexer() const { return MCAsmLexerCtorFn != 0; }

/// hasAsmParser - Check if this target supports .s parsing.
bool hasMCAsmParser() const { return MCAsmParserCtorFn != 0; }

Expand Down Expand Up @@ -360,15 +349,6 @@ namespace llvm {
return MCAsmBackendCtorFn(*this, Triple, CPU);
}

/// createMCAsmLexer - Create a target specific assembly lexer.
///
MCTargetAsmLexer *createMCAsmLexer(const MCRegisterInfo &MRI,
const MCAsmInfo &MAI) const {
if (!MCAsmLexerCtorFn)
return 0;
return MCAsmLexerCtorFn(*this, MRI, MAI);
}

/// createMCAsmParser - Create a target specific assembly parser.
///
/// \param Parser The target independent parser implementation to use for
Expand Down Expand Up @@ -676,20 +656,6 @@ namespace llvm {
T.MCAsmBackendCtorFn = Fn;
}

/// RegisterMCAsmLexer - Register a MCTargetAsmLexer implementation for the
/// given target.
///
/// Clients are responsible for ensuring that registration doesn't occur
/// while another thread is attempting to access the registry. Typically
/// this is done by initializing all targets at program startup.
///
/// @param T - The target being registered.
/// @param Fn - A function to construct an MCAsmLexer for the target.
static void RegisterMCAsmLexer(Target &T, Target::MCAsmLexerCtorTy Fn) {
if (!T.MCAsmLexerCtorFn)
T.MCAsmLexerCtorFn = Fn;
}

/// RegisterMCAsmParser - Register a MCTargetAsmParser implementation for
/// the given target.
///
Expand Down Expand Up @@ -1070,28 +1036,6 @@ namespace llvm {
}
};

/// RegisterMCAsmLexer - Helper template for registering a target specific
/// assembly lexer, for use in the target machine initialization
/// function. Usage:
///
/// extern "C" void LLVMInitializeFooMCAsmLexer() {
/// extern Target TheFooTarget;
/// RegisterMCAsmLexer<FooMCAsmLexer> X(TheFooTarget);
/// }
template<class MCAsmLexerImpl>
struct RegisterMCAsmLexer {
RegisterMCAsmLexer(Target &T) {
TargetRegistry::RegisterMCAsmLexer(T, &Allocator);
}

private:
static MCTargetAsmLexer *Allocator(const Target &T,
const MCRegisterInfo &MRI,
const MCAsmInfo &MAI) {
return new MCAsmLexerImpl(T, MRI, MAI);
}
};

/// RegisterMCAsmParser - Helper template for registering a target specific
/// assembly parser, for use in the target machine initialization
/// function. Usage:
Expand Down
1 change: 0 additions & 1 deletion lib/MC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ add_llvm_library(LLVMMC
MCStreamer.cpp
MCSubtargetInfo.cpp
MCSymbol.cpp
MCTargetAsmLexer.cpp
MCValue.cpp
MCWin64EH.cpp
MachObjectWriter.cpp
Expand Down
16 changes: 0 additions & 16 deletions lib/MC/MCTargetAsmLexer.cpp

This file was deleted.

134 changes: 0 additions & 134 deletions lib/Target/ARM/AsmParser/ARMAsmLexer.cpp

This file was deleted.

3 changes: 0 additions & 3 deletions lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7829,13 +7829,10 @@ bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) {
return true;
}

extern "C" void LLVMInitializeARMAsmLexer();

/// Force static initialization.
extern "C" void LLVMInitializeARMAsmParser() {
RegisterMCAsmParser<ARMAsmParser> X(TheARMTarget);
RegisterMCAsmParser<ARMAsmParser> Y(TheThumbTarget);
LLVMInitializeARMAsmLexer();
}

#define GET_REGISTER_MATCHER
Expand Down
Loading

0 comments on commit 6af228a

Please sign in to comment.