aidengrossman created this revision. Herald added a project: All. aidengrossman requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Currently when assertions are enabled, the cc1 flag is not inserted into the llvmcmd section of object files with embedded bitcode. This deviates from the normal behavior where this is the first flag that is inserted. This error stems from incorrect use of the function generateCC1CommandLine() which requires manually adding in the -cc1 flag which is currently not done. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D130620 Files: clang/lib/Frontend/CompilerInvocation.cpp Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -4544,7 +4544,10 @@ return CreateFromArgsImpl(Invocation, CommandLineArgs, Diags, Argv0); }, [](CompilerInvocation &Invocation, SmallVectorImpl<const char *> &Args, - StringAllocator SA) { Invocation.generateCC1CommandLine(Args, SA); }, + StringAllocator SA) { + Invocation.generateCC1CommandLine(Args, SA); + Args.insert(Args.begin(), "-cc1"); + }, Invocation, DummyInvocation, CommandLineArgs, Diags, Argv0); }
Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -4544,7 +4544,10 @@ return CreateFromArgsImpl(Invocation, CommandLineArgs, Diags, Argv0); }, [](CompilerInvocation &Invocation, SmallVectorImpl<const char *> &Args, - StringAllocator SA) { Invocation.generateCC1CommandLine(Args, SA); }, + StringAllocator SA) { + Invocation.generateCC1CommandLine(Args, SA); + Args.insert(Args.begin(), "-cc1"); + }, Invocation, DummyInvocation, CommandLineArgs, Diags, Argv0); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits