summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-08-20 11:24:44 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-08-20 11:24:44 +0000
commit03b6d4e04c72c49b01cb2eb5102675421eadbc4c (patch)
tree5be7e5a42eee9bb69c9dc3d03192e7cb7d5d7267 /utils
parent68e18b30540104f2302f560dd90b405b60084158 (diff)
downloadllvm-03b6d4e04c72c49b01cb2eb5102675421eadbc4c.tar.gz
llvm-03b6d4e04c72c49b01cb2eb5102675421eadbc4c.tar.bz2
llvm-03b6d4e04c72c49b01cb2eb5102675421eadbc4c.tar.xz
llvmc: Cut global namespace pollution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index b091419f91..48c7cc375f 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -2909,7 +2909,6 @@ void EmitHookDeclarations(const ToolDescriptions& ToolDescs,
if (HookNames.empty())
return;
- O << "namespace hooks {\n";
for (HookInfoMap::const_iterator B = HookNames.begin(),
E = HookNames.end(); B != E; ++B) {
const char* HookName = B->first();
@@ -2928,7 +2927,6 @@ void EmitHookDeclarations(const ToolDescriptions& ToolDescs,
O <<");\n";
}
- O << "}\n\n";
}
/// EmitIncludes - Emit necessary #include directives and some
@@ -3013,12 +3011,19 @@ void EmitPluginCode(const PluginData& Data, raw_ostream& O) {
EmitIncludes(O);
// Emit global option registration code.
+ O << "namespace llvmc {\n"
+ << "namespace autogenerated {\n\n";
EmitOptionDefinitions(Data.OptDescs, Data.HasSink, O);
+ O << "} // End namespace autogenerated.\n"
+ << "} // End namespace llvmc.\n\n";
// Emit hook declarations.
+ O << "namespace hooks {\n";
EmitHookDeclarations(Data.ToolDescs, Data.OptDescs, O);
+ O << "} // End namespace hooks.\n\n";
O << "namespace {\n\n";
+ O << "using namespace llvmc::autogenerated;\n\n";
// Emit Tool classes.
for (ToolDescriptions::const_iterator B = Data.ToolDescs.begin(),