summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-08-20 18:16:26 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-08-20 18:16:26 +0000
commit297514d1556188a81040e31ab2ad62943d98c4b6 (patch)
treeebb8db0e06ba1842713846b3faf9897584002411
parent8d18006cf2e607fea265fa35c73ec2f8690f4b78 (diff)
downloadllvm-297514d1556188a81040e31ab2ad62943d98c4b6.tar.gz
llvm-297514d1556188a81040e31ab2ad62943d98c4b6.tar.bz2
llvm-297514d1556188a81040e31ab2ad62943d98c4b6.tar.xz
llvmc: Fix alias generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111662 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/LLVMC/Alias.td24
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp2
2 files changed, 25 insertions, 1 deletions
diff --git a/test/LLVMC/Alias.td b/test/LLVMC/Alias.td
new file mode 100644
index 0000000000..45f7296b72
--- /dev/null
+++ b/test/LLVMC/Alias.td
@@ -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">]>;
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 26e9fa4a9d..4ab4b084b8 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -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);