From 297514d1556188a81040e31ab2ad62943d98c4b6 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Fri, 20 Aug 2010 18:16:26 +0000 Subject: [PATCH] llvmc: Fix alias generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111662 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/LLVMC/Alias.td | 24 ++++++++++++++++++++ utils/TableGen/LLVMCConfigurationEmitter.cpp | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test/LLVMC/Alias.td diff --git a/test/LLVMC/Alias.td b/test/LLVMC/Alias.td new file mode 100644 index 00000000000..45f7296b720 --- /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 26e9fa4a9df..4ab4b084b8d 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);