Skip to content

Commit 15a8651

Browse files
committed
---
yaml --- r: 348119 b: refs/heads/master c: 24d2d5f h: refs/heads/master i: 348117: 59110ae 348115: c0359f0 348111: 88d91f3
1 parent 0dc1dc2 commit 15a8651

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0f98cd18edb8f91687bf68f85162475006f6dce9
2+
refs/heads/master: 24d2d5fd7a4d532096d67f207f4b536e0054ed42
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@ validateModule(llvm::StringRef data, bool Verbose,
4949
swift::serialization::ValidationInfo &info,
5050
swift::serialization::ExtendedValidationInfo &extendedInfo) {
5151
info = swift::serialization::validateSerializedAST(data, &extendedInfo);
52-
if (info.status != swift::serialization::Status::Valid)
52+
if (info.status != swift::serialization::Status::Valid) {
53+
llvm::outs() << "error: validateSerializedAST() failed\n";
5354
return false;
55+
}
5456

5557
swift::CompilerInvocation CI;
56-
if (CI.loadFromSerializedAST(data) != swift::serialization::Status::Valid)
58+
if (CI.loadFromSerializedAST(data) != swift::serialization::Status::Valid) {
59+
llvm::outs() << "error: loadFromSerializedAST() failed\n";
5760
return false;
61+
}
5862

5963
if (Verbose) {
6064
if (!info.shortVersion.empty())
@@ -265,6 +269,8 @@ int main(int argc, char **argv) {
265269
swift::serialization::ValidationInfo info;
266270
swift::serialization::ExtendedValidationInfo extendedInfo;
267271
for (auto &Module : Modules) {
272+
info = {};
273+
extendedInfo = {};
268274
if (!validateModule(StringRef(Module.first, Module.second), Verbose, info,
269275
extendedInfo)) {
270276
llvm::errs() << "Malformed module!\n";
@@ -282,7 +288,8 @@ int main(int argc, char **argv) {
282288
reinterpret_cast<void *>(&anchorForGetMainExecutable)));
283289

284290
// Infer SDK and Target triple from the module.
285-
Invocation.setSDKPath(extendedInfo.getSDKPath());
291+
if (!extendedInfo.getSDKPath().empty())
292+
Invocation.setSDKPath(extendedInfo.getSDKPath());
286293
Invocation.setTargetTriple(info.targetTriple);
287294

288295
Invocation.setModuleName("lldbtest");
@@ -294,13 +301,17 @@ int main(int argc, char **argv) {
294301
Invocation.setRuntimeResourcePath(ResourceDir);
295302
}
296303

297-
if (CI.setup(Invocation))
304+
if (CI.setup(Invocation)) {
305+
llvm::errs() << "error: Failed setup invocation!\n";
298306
return 1;
307+
}
299308

300309
for (auto &Module : Modules)
301310
if (!parseASTSection(*CI.getMemoryBufferSerializedModuleLoader(),
302-
StringRef(Module.first, Module.second), modules))
311+
StringRef(Module.first, Module.second), modules)) {
312+
llvm::errs() << "error: Failed to parse AST section!\n";
303313
return 1;
314+
}
304315

305316
// Attempt to import all modules we found.
306317
for (auto path : modules) {

0 commit comments

Comments
 (0)