[llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Oct 23 15:33:19 PDT 2005
Changes in directory llvm/utils/TableGen:
SubtargetEmitter.cpp updated: 1.2 -> 1.3
---
Log message:
Add the needed #include, emit enums with the sizes of tables, remove
definitions from the LLVM namespace, since they are all static.
---
Diffs of the changes: (+12 -9)
SubtargetEmitter.cpp | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
Index: llvm/utils/TableGen/SubtargetEmitter.cpp
diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.2 llvm/utils/TableGen/SubtargetEmitter.cpp:1.3
--- llvm/utils/TableGen/SubtargetEmitter.cpp:1.2 Sat Oct 22 02:59:56 2005
+++ llvm/utils/TableGen/SubtargetEmitter.cpp Sun Oct 23 17:33:08 2005
@@ -57,7 +57,7 @@
RecordList Processors = Records.getAllDerivedDefinitions("Processor");
sort(Processors.begin(), Processors.end(), LessRecordFieldName());
- OS << "namespace llvm {\n\n";
+ OS << "#include \"llvm/Target/SubtargetFeature.h\"\n\n";
{ // Feature enumeration
int i = 0;
@@ -78,9 +78,9 @@
}
{ // Feature key values
- OS << "\n\n"
- << "/// Sorted (by key) array of values for CPU features.\n"
- << "static SubtargetFeatureKV FeatureKV[] = {\n";
+ OS << "\n"
+ << "// Sorted (by key) array of values for CPU features.\n"
+ << "static llvm::SubtargetFeatureKV FeatureKV[] = {\n";
for (RecordListIter RI = Features.begin(), E = Features.end(); RI != E;) {
Record *R = *RI++;
std::string Instance = R->getName();
@@ -96,9 +96,9 @@
}
{ // CPU key values
- OS << "\n\n"
- << "/// Sorted (by key) array of values for CPU subtype.\n"
- << "static const SubtargetFeatureKV SubTypeKV[] = {\n";
+ OS << "\n"
+ << "// Sorted (by key) array of values for CPU subtype.\n"
+ << "static const llvm::SubtargetFeatureKV SubTypeKV[] = {\n";
for (RecordListIter RI = Processors.begin(), E = Processors.end();
RI != E;) {
Record *R = *RI++;
@@ -131,6 +131,9 @@
}
OS << "};\n";
}
-
- OS << "\n} // End llvm namespace \n";
+
+ OS<<"\nenum {\n";
+ OS<<" FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV),\n";
+ OS<<" SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV)\n";
+ OS<<"};\n";
}
More information about the llvm-commits
mailing list