diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-08 01:53:10 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-08 01:53:10 +0000 |
commit | 4d1ca96bfc439cc6d97242c81803f69b39a65e10 (patch) | |
tree | dec1e1af195c9fed454d6495c80eb112853eb19d /llvm/utils/TableGen/SubtargetEmitter.cpp | |
parent | 29cd98fd52c285a4a5c5dc6c383192b7c7846a14 (diff) | |
download | bcm5719-llvm-4d1ca96bfc439cc6d97242c81803f69b39a65e10.tar.gz bcm5719-llvm-4d1ca96bfc439cc6d97242c81803f69b39a65e10.zip |
Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
to generate asm matcher subtarget feature queries. e.g.
"ModeThumb,FeatureThumb2" is translated to
"(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".
llvm-svn: 134678
Diffstat (limited to 'llvm/utils/TableGen/SubtargetEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/SubtargetEmitter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp index 929b42b8d12..e87b22e98eb 100644 --- a/llvm/utils/TableGen/SubtargetEmitter.cpp +++ b/llvm/utils/TableGen/SubtargetEmitter.cpp @@ -645,12 +645,18 @@ void SubtargetEmitter::run(raw_ostream &OS) { EmitSourceFileHeader("Subtarget Enumeration Source Fragment", OS); + OS << "\n#ifdef GET_SUBTARGETINFO_ENUM\n"; + OS << "#undef GET_SUBTARGETINFO_ENUM\n"; + + OS << "namespace llvm {\n"; + Enumeration(OS, "SubtargetFeature", true); + OS << "} // End llvm namespace \n"; + OS << "#endif // GET_SUBTARGETINFO_ENUM\n\n"; + OS << "\n#ifdef GET_SUBTARGETINFO_MC_DESC\n"; OS << "#undef GET_SUBTARGETINFO_MC_DESC\n"; OS << "namespace llvm {\n"; - Enumeration(OS, "SubtargetFeature", true); - OS<<"\n"; unsigned NumFeatures = FeatureKeyValues(OS); OS<<"\n"; unsigned NumProcs = CPUKeyValues(OS); |