summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/InstrInfoEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/InstrInfoEmitter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 3470b2d01b7..0596f439cf5 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -20,6 +20,7 @@ using namespace llvm;
// runEnums - Print out enum values for all of the instructions.
void InstrInfoEmitter::runEnums(std::ostream &OS) {
EmitSourceFileHeader("Target Instruction Enum Values", OS);
+ OS << "namespace llvm {\n\n";
CodeGenTarget Target;
@@ -45,7 +46,7 @@ void InstrInfoEmitter::runEnums(std::ostream &OS) {
OS << " };\n";
if (!Namespace.empty())
OS << "}\n";
- EmitSourceFileTail(OS);
+ OS << "} // End llvm namespace \n";
}
void InstrInfoEmitter::printDefList(ListInit *LI, const std::string &Name,
@@ -63,6 +64,8 @@ void InstrInfoEmitter::printDefList(ListInit *LI, const std::string &Name,
// run - Emit the main instruction description records for the target...
void InstrInfoEmitter::run(std::ostream &OS) {
EmitSourceFileHeader("Target Instruction Descriptors", OS);
+ OS << "namespace llvm {\n\n";
+
CodeGenTarget Target;
const std::string &TargetName = Target.getName();
Record *InstrInfo = Target.getInstructionSet();
@@ -92,7 +95,7 @@ void InstrInfoEmitter::run(std::ostream &OS) {
if (II->second.TheDef != PHI)
emitRecord(II->second, ++i, InstrInfo, OS);
OS << "};\n";
- EmitSourceFileTail(OS);
+ OS << "} // End llvm namespace \n";
}
void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
OpenPOWER on IntegriCloud