[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 7 07:43:09 PDT 2023
================
@@ -4588,28 +4641,29 @@ std::string CompilerInvocation::getModuleHash() const {
return toString(llvm::APInt(64, Hash), 36, /*Signed=*/false);
}
-void CompilerInvocation::generateCC1CommandLine(
+void CompilerInvocationBase::generateCC1CommandLine(
ArgumentConsumer Consumer) const {
- llvm::Triple T(TargetOpts->Triple);
-
- GenerateFileSystemArgs(FileSystemOpts, Consumer);
- GenerateMigratorArgs(MigratorOpts, Consumer);
- GenerateAnalyzerArgs(*AnalyzerOpts, Consumer);
- GenerateDiagnosticArgs(*DiagnosticOpts, Consumer, false);
- GenerateFrontendArgs(FrontendOpts, Consumer, LangOpts->IsHeaderFile);
- GenerateTargetArgs(*TargetOpts, Consumer);
- GenerateHeaderSearchArgs(*HeaderSearchOpts, Consumer);
- GenerateLangArgs(*LangOpts, Consumer, T, FrontendOpts.DashX);
- GenerateCodeGenArgs(CodeGenOpts, Consumer, T, FrontendOpts.OutputFile,
- &*LangOpts);
- GeneratePreprocessorArgs(*PreprocessorOpts, Consumer, *LangOpts, FrontendOpts,
- CodeGenOpts);
- GeneratePreprocessorOutputArgs(PreprocessorOutputOpts, Consumer,
- FrontendOpts.ProgramAction);
- GenerateDependencyOutputArgs(DependencyOutputOpts, Consumer);
+ llvm::Triple T(getTargetOpts().Triple);
+
+ GenerateFileSystemArgs(getFileSystemOpts(), Consumer);
+ GenerateMigratorArgs(getMigratorOpts(), Consumer);
+ GenerateAnalyzerArgs(getAnalyzerOpts(), Consumer);
+ GenerateDiagnosticArgs(getDiagnosticOpts(), Consumer, false);
----------------
shafik wrote:
```suggestion
GenerateDiagnosticArgs(getDiagnosticOpts(), Consumer, /*DefaultDiagColor=*/false);
```
https://github.com/llvm/llvm-project/pull/65412
More information about the cfe-commits
mailing list