llvmc: Fix alias generation.
authorMikhail Glushenkov <foldr@codedgers.com>
Fri, 20 Aug 2010 18:16:26 +0000 (18:16 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Fri, 20 Aug 2010 18:16:26 +0000 (18:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111662 91177308-0d34-0410-b5e6-96231b3b80d8

test/LLVMC/Alias.td [new file with mode: 0644]
utils/TableGen/LLVMCConfigurationEmitter.cpp

diff --git a/test/LLVMC/Alias.td b/test/LLVMC/Alias.td
new file mode 100644 (file)
index 0000000..45f7296
--- /dev/null
@@ -0,0 +1,24 @@
+// Test alias generation.
+// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
+// RUN: FileCheck -input-file %t %s
+// RUN: %compile_cxx -x c++ %t
+// XFAIL: vg_leak
+
+include "llvm/CompilerDriver/Common.td"
+
+def OptList : OptionList<[
+
+(switch_option "dummy1", (help "none")),
+// CHECK: cl::alias Alias_dummy2
+(alias_option "dummy2", "dummy1")
+]>;
+
+def dummy_tool : Tool<[
+(command "dummy_cmd"),
+(in_language "dummy_lang"),
+(out_language "dummy_lang"),
+(actions (case
+         (switch_on "dummy1"), (forward "dummy1")))
+]>;
+
+def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;
index 26e9fa4a9dff3a4fb595c9e31e8f1c054bcf04ec..4ab4b084b8d36011d2291e636e8d30b099960203 100644 (file)
@@ -2427,7 +2427,7 @@ void EmitOptionDefinitions (const OptionDescriptions& descs,
     const OptionDescription& val = *B;
 
     O << val.GenTypeDeclaration() << ' '
-      << val.GenVariableName()
+      << val.GenPlainVariableName()
       << "(\"" << val.Name << '\"';
 
     const OptionDescription& D = descs.FindOption(val.Help);