This commit breaks functionality because asan uses the ModuleID when checking blacklists. We're going to need to fix it and/or revert it.
-Warren On Fri, May 23, 2014 at 12:34 AM, Robert Lytton <[email protected]> wrote: > Author: rlytton > Date: Fri May 23 02:34:08 2014 > New Revision: 209503 > > URL: http://llvm.org/viewvc/llvm-project?rev=209503&view=rev > Log: > Fix '-main-file-name <name>' so that it is used for the ModuleID. > > Summary: > Previously, you could not specify the original file name when passing a > preprocessed file into the compiler > Now you can use 'clang -Xclang -main-file-name -Xclang <original file > name> ...' > Or 'clang -cc1 -main-file-name <original file name> ...' > > Added: > cfe/trunk/test/CodeGen/main-file-name.c > Modified: > cfe/trunk/lib/CodeGen/CodeGenAction.cpp > > Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=209503&r1=209502&r2=209503&view=diff > > ============================================================================== > --- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original) > +++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Fri May 23 02:34:08 2014 > @@ -551,9 +551,12 @@ ASTConsumer *CodeGenAction::CreateASTCon > LinkModuleToUse = ModuleOrErr.get(); > } > > + StringRef MainFileName = > getCompilerInstance().getCodeGenOpts().MainFileName; > + if (MainFileName.empty()) > + MainFileName = InFile; > BEConsumer = new BackendConsumer(BA, CI.getDiagnostics(), > CI.getCodeGenOpts(), > CI.getTargetOpts(), CI.getLangOpts(), > - CI.getFrontendOpts().ShowTimers, > InFile, > + CI.getFrontendOpts().ShowTimers, > MainFileName, > LinkModuleToUse, OS.release(), > *VMContext); > return BEConsumer; > } > > Added: cfe/trunk/test/CodeGen/main-file-name.c > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/main-file-name.c?rev=209503&view=auto > > ============================================================================== > --- cfe/trunk/test/CodeGen/main-file-name.c (added) > +++ cfe/trunk/test/CodeGen/main-file-name.c Fri May 23 02:34:08 2014 > @@ -0,0 +1,6 @@ > +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s > +// RUN: %clang_cc1 -emit-llvm -o - %s -main-file-name some.name | > FileCheck -check-prefix NAMED %s > + > +// CHECK: ; ModuleID = '{{.*}}main-file-name.c' > +// NAMED: ; ModuleID = 'some.name' > + > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
