Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions llvm/utils/TableGen/CodeGenMapTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include "TableGenBackends.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/TableGen/CodeGenHelpers.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"

Expand Down Expand Up @@ -549,9 +550,8 @@ void llvm::EmitMapTable(const RecordKeeper &Records, raw_ostream &OS) {
if (InstrMapVec.empty())
return;

OS << "#ifdef GET_INSTRMAP_INFO\n";
OS << "#undef GET_INSTRMAP_INFO\n";
OS << "namespace llvm::" << NameSpace << " {\n\n";
IfDefEmitter IfDef(OS, "GET_INSTRMAP_INFO");
NamespaceEmitter NS(OS, ("llvm::" + NameSpace).str());

// Emit coulumn field names and their values as enums.
emitEnums(OS, Records);
Expand All @@ -574,6 +574,4 @@ void llvm::EmitMapTable(const RecordKeeper &Records, raw_ostream &OS) {
// Emit map tables and the functions to query them.
IMap.emitTablesWithFunc(OS);
}
OS << "} // end namespace llvm::" << NameSpace << '\n';
OS << "#endif // GET_INSTRMAP_INFO\n\n";
}