File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -860,7 +860,15 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) {
860
860
BackendArgs.push_back (" -limit-float-precision" );
861
861
BackendArgs.push_back (CodeGenOpts.LimitFloatPrecision .c_str ());
862
862
}
863
+ // Check for the default "clang" invocation that won't set any cl::opt values.
864
+ // Skip trying to parse the command line invocation to avoid the issues
865
+ // described below.
866
+ if (BackendArgs.size () == 1 )
867
+ return ;
863
868
BackendArgs.push_back (nullptr );
869
+ // FIXME: The command line parser below is not thread-safe and shares a global
870
+ // state, so this call might crash or overwrite the options of another Clang
871
+ // instance in the same process.
864
872
llvm::cl::ParseCommandLineOptions (BackendArgs.size () - 1 ,
865
873
BackendArgs.data ());
866
874
}
You can’t perform that action at this time.
0 commit comments