diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-12-11 10:34:18 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-12-11 10:34:18 +0000 |
commit | e1d44b59eea8ad574f0e9794e10b6bf3b564461b (patch) | |
tree | b384921e2d99d720b53992962459cc2e4930ae59 /utils | |
parent | 6db08c4d2f2e1f1f83e845031bfee9017b126c5a (diff) | |
download | llvm-e1d44b59eea8ad574f0e9794e10b6bf3b564461b.tar.gz llvm-e1d44b59eea8ad574f0e9794e10b6bf3b564461b.tar.bz2 llvm-e1d44b59eea8ad574f0e9794e10b6bf3b564461b.tar.xz |
Put Edge* classes into anonymous namespace.
Prevents conflicts between plugins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 8e672adf3e..ebf4b18aff 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1500,7 +1500,6 @@ void EmitOptionDefintions (const OptionDescriptions& descs, void EmitPopulateLanguageMap (const RecordKeeper& Records, std::ostream& O) { // Generate code - O << "namespace {\n\n"; O << "void PopulateLanguageMapLocal(LanguageMap& langMap) {\n"; // Get the relevant field out of RecordKeeper @@ -1526,7 +1525,7 @@ void EmitPopulateLanguageMap (const RecordKeeper& Records, std::ostream& O) } } - O << "}\n\n}\n\n"; + O << "}\n\n"; } /// IncDecWeight - Helper function passed to EmitCaseConstructHandler() @@ -1595,7 +1594,6 @@ void EmitPopulateCompilationGraph (const RecordVector& EdgeVector, const ToolDescriptions& ToolDescs, std::ostream& O) { - O << "namespace {\n\n"; O << "void PopulateCompilationGraphLocal(CompilationGraph& G) {\n"; for (ToolDescriptions::const_iterator B = ToolDescs.begin(), @@ -1625,7 +1623,7 @@ void EmitPopulateCompilationGraph (const RecordVector& EdgeVector, ++i; } - O << "}\n\n}\n\n"; + O << "}\n\n"; } /// ExtractHookNames - Extract the hook names from all instances of @@ -1692,8 +1690,7 @@ void EmitHookDeclarations(const ToolDescriptions& ToolDescs, std::ostream& O) { /// EmitRegisterPlugin - Emit code to register this plugin. void EmitRegisterPlugin(int Priority, std::ostream& O) { - O << "namespace {\n\n" - << "struct Plugin : public llvmc::BasePlugin {\n\n" + O << "struct Plugin : public llvmc::BasePlugin {\n\n" << Indent1 << "int Priority() const { return " << Priority << "; }\n\n" << Indent1 << "void PopulateLanguageMap(LanguageMap& langMap) const\n" << Indent1 << "{ PopulateLanguageMapLocal(langMap); }\n\n" @@ -1702,7 +1699,7 @@ void EmitRegisterPlugin(int Priority, std::ostream& O) { << Indent1 << "{ PopulateCompilationGraphLocal(graph); }\n" << "};\n\n" - << "static llvmc::RegisterPlugin<Plugin> RP;\n\n}\n\n"; + << "static llvmc::RegisterPlugin<Plugin> RP;\n\n"; } /// EmitIncludes - Emit necessary #include directives and some @@ -1811,6 +1808,8 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) { // Emit hook declarations. EmitHookDeclarations(Data.ToolDescs, O); + O << "namespace {\n\n"; + // Emit PopulateLanguageMap() function // (a language map maps from file extensions to language names). EmitPopulateLanguageMap(Records, O); @@ -1829,6 +1828,7 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) { // Emit code for plugin registration. EmitRegisterPlugin(Data.Priority, O); + O << "} // End anonymous namespace.\n"; // EOF } |