Skip to content

Commit 5e463b1

Browse files
author
Davide Italiano
committed
[lldb-moduleimport-test] Pass a target triple as a stopgap solution.
We're going to infer all these informations from the module, but that's a large refactoring task which I'm going to do next. In the meanwhile, this should allow Adrian's work to be unblocked. <rdar://problem/38720742>
1 parent 5831fc9 commit 5e463b1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

test/DebugInfo/DumpDeclFromMangledName.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: sed -ne '/--->/s/^.*---> *//p' < %S/Inputs/decl-reconstr-names.txt > %t.check
88

99
// RUN: %target-build-swift -emit-executable %s -g -o %t/DeclReconstr -emit-module
10-
// RUN: %lldb-moduleimport-test %t/DeclReconstr \
10+
// RUN: %lldb-moduleimport-test %t/DeclReconstr -target-triple %target-triple \
1111
// RUN: -decl-from-mangled=%t.input > %t.output 2>&1
1212
// RUN: diff %t.check %t.output
1313

tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ int main(int argc, char **argv) {
138138
llvm::cl::opt<std::string> DumpTypeFromMangled(
139139
"type-from-mangled", llvm::cl::desc("dump type from mangled names list"));
140140

141+
// FIXME: we should infer this from the module.
142+
llvm::cl::opt<std::string> TargetTriple(
143+
"target-triple", llvm::cl::desc("specify target triple"));
144+
141145
llvm::cl::ParseCommandLineOptions(argc, argv);
142146
// Unregister our options so they don't interfere with the command line
143147
// parsing in CodeGen/BackendUtil.cpp.
@@ -148,6 +152,7 @@ int main(int argc, char **argv) {
148152
DumpTypeFromMangled.removeArgument();
149153
SDK.removeArgument();
150154
InputNames.removeArgument();
155+
TargetTriple.removeArgument();
151156

152157
// If no SDK was specified via -sdk, check environment variable SDKROOT.
153158
if (SDK.getNumOccurrences() == 0) {
@@ -166,7 +171,13 @@ int main(int argc, char **argv) {
166171
reinterpret_cast<void *>(&anchorForGetMainExecutable)));
167172

168173
Invocation.setSDKPath(SDK);
169-
Invocation.setTargetTriple(llvm::sys::getDefaultTargetTriple());
174+
175+
// FIXME: we should infer this from the module.
176+
if (!TargetTriple.empty())
177+
Invocation.setTargetTriple(TargetTriple);
178+
else
179+
Invocation.setTargetTriple(llvm::sys::getDefaultTargetTriple());
180+
170181
Invocation.setModuleName("lldbtest");
171182
Invocation.getClangImporterOptions().ModuleCachePath = ModuleCachePath;
172183
Invocation.setImportSearchPaths(ImportPaths);

0 commit comments

Comments
 (0)