diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-20 11:24:44 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-20 11:24:44 +0000 |
commit | 03b6d4e04c72c49b01cb2eb5102675421eadbc4c (patch) | |
tree | 5be7e5a42eee9bb69c9dc3d03192e7cb7d5d7267 /utils/TableGen/LLVMCConfigurationEmitter.cpp | |
parent | 68e18b30540104f2302f560dd90b405b60084158 (diff) |
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/TableGen/LLVMCConfigurationEmitter.cpp')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 9 |
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(), |