diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-03-30 10:45:04 +0200 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-04-14 09:13:35 +0200 |
commit | 09d1f6e6b74c9330d80c0346a271a43efbe0384d (patch) | |
tree | 601b28f10f8da1419feed3eee2c7aa71605a0a48 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0acf4e500529447ba34b8d9152630c8535d17949 (diff) | |
download | llvm-09d1f6e6b74c9330d80c0346a271a43efbe0384d.zip llvm-09d1f6e6b74c9330d80c0346a271a43efbe0384d.tar.gz llvm-09d1f6e6b74c9330d80c0346a271a43efbe0384d.tar.bz2 |
[clang] Fix copy constructor of CompilerInvocation
The `CompilerInvocationBase` class factors out members of `CompilerInvocation` that need special handling (initialization or copy constructor), so that `CompilerInvocation` can be implemented as a simple value object.
Currently, the `AnalyzerOpts` member of `CompilerInvocation` violates that setup. This patch extracts the member to `CompilerInvocationBase` and handles it in the copy constructor the same way other it handles other members.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D99568
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b18bc0b..b71143f 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -113,14 +113,16 @@ CompilerInvocationBase::CompilerInvocationBase() : LangOpts(new LangOptions()), TargetOpts(new TargetOptions()), DiagnosticOpts(new DiagnosticOptions()), HeaderSearchOpts(new HeaderSearchOptions()), - PreprocessorOpts(new PreprocessorOptions()) {} + PreprocessorOpts(new PreprocessorOptions()), + AnalyzerOpts(new AnalyzerOptions()) {} CompilerInvocationBase::CompilerInvocationBase(const CompilerInvocationBase &X) : LangOpts(new LangOptions(*X.getLangOpts())), TargetOpts(new TargetOptions(X.getTargetOpts())), DiagnosticOpts(new DiagnosticOptions(X.getDiagnosticOpts())), HeaderSearchOpts(new HeaderSearchOptions(X.getHeaderSearchOpts())), - PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())) {} + PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())), + AnalyzerOpts(new AnalyzerOptions(*X.getAnalyzerOpts())) {} CompilerInvocationBase::~CompilerInvocationBase() = default; |