summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/ARCMT.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-12-12 02:12:17 +0000
committerHans Wennborg <hans@hanshq.net>2013-12-12 02:12:17 +0000
commit69a458f690dcdb05ba53345734d4cdf92a44c6bb (patch)
treef864159bc383738ce1da9e1f4afa1fbc42e0e489 /clang/lib/ARCMigrate/ARCMT.cpp
parent0fa079f3329daccdddf9417b8fe30935d276513f (diff)
downloadbcm5719-llvm-69a458f690dcdb05ba53345734d4cdf92a44c6bb.tar.gz
bcm5719-llvm-69a458f690dcdb05ba53345734d4cdf92a44c6bb.zip
Revert r197076: "[objcmt] When emitting a remap file, use a json format
with the edit entries, instead of applying the changes" (And also revert the follow-up r197086.) This seems to have broken Linux builds, which were failing with the following: /build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so: error: undefined reference to 'clang::ento::objc_retain::CallEffects::getEffect(clang::ObjCMethodDecl const*)' /build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so: error: undefined reference to 'clang::ento::objc_retain::CallEffects::getEffect(clang::FunctionDecl const*)' collect2: error: ld returned 1 exit status llvm-svn: 197111
Diffstat (limited to 'clang/lib/ARCMigrate/ARCMT.cpp')
-rw-r--r--clang/lib/ARCMigrate/ARCMT.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp
index b099f08ce93..3e429beded5 100644
--- a/clang/lib/ARCMigrate/ARCMT.cpp
+++ b/clang/lib/ARCMigrate/ARCMT.cpp
@@ -416,6 +416,44 @@ bool arcmt::getFileRemappings(std::vector<std::pair<std::string,std::string> > &
return false;
}
+bool arcmt::getFileRemappingsFromFileList(
+ std::vector<std::pair<std::string,std::string> > &remap,
+ ArrayRef<StringRef> remapFiles,
+ DiagnosticConsumer *DiagClient) {
+ bool hasErrorOccurred = false;
+ llvm::StringMap<bool> Uniquer;
+
+ IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
+ IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
+ new DiagnosticsEngine(DiagID, new DiagnosticOptions,
+ DiagClient, /*ShouldOwnClient=*/false));
+
+ for (ArrayRef<StringRef>::iterator
+ I = remapFiles.begin(), E = remapFiles.end(); I != E; ++I) {
+ StringRef file = *I;
+
+ FileRemapper remapper;
+ bool err = remapper.initFromFile(file, *Diags,
+ /*ignoreIfFilesChanged=*/true);
+ hasErrorOccurred = hasErrorOccurred || err;
+ if (err)
+ continue;
+
+ PreprocessorOptions PPOpts;
+ remapper.applyMappings(PPOpts);
+ for (PreprocessorOptions::remapped_file_iterator
+ RI = PPOpts.remapped_file_begin(), RE = PPOpts.remapped_file_end();
+ RI != RE; ++RI) {
+ bool &inserted = Uniquer[RI->first];
+ if (inserted)
+ continue;
+ inserted = true;
+ remap.push_back(*RI);
+ }
+ }
+
+ return hasErrorOccurred;
+}
//===----------------------------------------------------------------------===//
// CollectTransformActions.
OpenPOWER on IntegriCloud