llvmc: Do not prefix option names with AutoGenerated.

Since they now live in the namespace 'autogenerated'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111620 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 48c7cc3..26e9fa4 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -49,7 +49,7 @@
 const char * const DefaultHelpString = "NO HELP MESSAGE PROVIDED";
 
 // Name for the "sink" option.
-const char * const SinkOptionName = "AutoGeneratedSinkOption";
+const char * const SinkOptionName = "SinkOption";
 
 //===----------------------------------------------------------------------===//
 /// Helper functions
@@ -261,7 +261,13 @@
 
   /// GenVariableName - Returns the variable name used in the
   /// generated C++ code.
-  std::string GenVariableName() const;
+  std::string GenVariableName() const
+  { return "autogenerated::" + GenOptionType() + EscapeVariableName(Name); }
+
+  /// GenPlainVariableName - Returns the variable name without the namespace
+  /// prefix.
+  std::string GenPlainVariableName() const
+  { return GenOptionType() + EscapeVariableName(Name); }
 
   /// Merge - Merge two option descriptions.
   void Merge (const OptionDescription& other);
@@ -315,6 +321,10 @@
   { return (OptionType::IsList(this->Type)
             && !OptionType::IsSwitchList(this->Type)); }
 
+private:
+
+  // GenOptionType - Helper function used by GenVariableName().
+  std::string GenOptionType() const;
 };
 
 void OptionDescription::CheckConsistency() const {
@@ -428,22 +438,21 @@
   }
 }
 
-std::string OptionDescription::GenVariableName() const {
-  const std::string& EscapedName = EscapeVariableName(Name);
+std::string OptionDescription::GenOptionType() const {
   switch (Type) {
   case OptionType::Alias:
-    return "AutoGeneratedAlias_" + EscapedName;
+    return "Alias_";
   case OptionType::PrefixList:
   case OptionType::ParameterList:
-    return "AutoGeneratedList_" + EscapedName;
+    return "List_";
   case OptionType::Switch:
-    return "AutoGeneratedSwitch_" + EscapedName;
+    return "Switch_";
   case OptionType::SwitchList:
-    return "AutoGeneratedSwitchList_" + EscapedName;
+    return "SwitchList_";
   case OptionType::Prefix:
   case OptionType::Parameter:
   default:
-    return "AutoGeneratedParameter_" + EscapedName;
+    return "Parameter_";
   }
 }
 
@@ -2210,13 +2219,15 @@
   O.indent(Indent2) << "}\n\n";
 
   // Handle the Sink property.
+  std::string SinkOption("autogenerated::");
+  SinkOption += SinkOptionName;
   if (D.isSink()) {
-    O.indent(Indent2) << "if (!" << SinkOptionName << ".empty()) {\n";
+    O.indent(Indent2) << "if (!" << SinkOption << ".empty()) {\n";
     O.indent(Indent3) << "for (cl::list<std::string>::iterator B = "
-                      << SinkOptionName << ".begin(), E = " << SinkOptionName
+                      << SinkOption << ".begin(), E = " << SinkOption
                       << ".end(); B != E; ++B)\n";
-    O.indent(Indent4) << "vec.push_back(std::make_pair(" << SinkOptionName
-                      << ".getPosition(B - " << SinkOptionName
+    O.indent(Indent4) << "vec.push_back(std::make_pair(" << SinkOption
+                      << ".getPosition(B - " << SinkOption
                       <<  ".begin()), *B));\n";
     O.indent(Indent2) << "}\n";
   }
@@ -2365,7 +2376,7 @@
     }
 
     O << val.GenTypeDeclaration() << ' '
-      << val.GenVariableName();
+      << val.GenPlainVariableName();
 
     O << "(\"" << val.Name << "\"\n";
 
@@ -2427,7 +2438,7 @@
 
   // Emit the sink option.
   if (HasSink)
-    O << "cl" << "::list<std::string> " << SinkOptionName << "(cl::Sink);\n";
+    O << "cl::list<std::string> " << SinkOptionName << "(cl::Sink);\n";
 
   O << '\n';
 }