diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-04-14 14:35:03 +0200 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-04-19 11:12:22 +0200 |
commit | 26bbb8700bb0ea0ce29e4158e5aa7999ab0d5386 (patch) | |
tree | 534fa5f211108edca7dd8d575799dbd2dac3e58c /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9e9f991ac0330bee8cf6e9c73fe8a7c976d7afce (diff) | |
download | llvm-26bbb8700bb0ea0ce29e4158e5aa7999ab0d5386.zip llvm-26bbb8700bb0ea0ce29e4158e5aa7999ab0d5386.tar.gz llvm-26bbb8700bb0ea0ce29e4158e5aa7999ab0d5386.tar.bz2 |
[clang] Implement CompilerInvocation copy assignment
This patch implements the copy assignment for `CompilerInvocation`.
Eventually, the deep-copy operation will be moved into a `clone()` method (D100460), but until then, this is necessary for basic ergonomics.
Depends on D100455.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D100473
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index fd6ca5e..34319fe 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -125,6 +125,23 @@ CompilerInvocationRefBase::CompilerInvocationRefBase( PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())), AnalyzerOpts(new AnalyzerOptions(*X.getAnalyzerOpts())) {} +CompilerInvocationRefBase::CompilerInvocationRefBase( + CompilerInvocationRefBase &&X) = default; + +CompilerInvocationRefBase & +CompilerInvocationRefBase::operator=(CompilerInvocationRefBase X) { + LangOpts.swap(X.LangOpts); + TargetOpts.swap(X.TargetOpts); + DiagnosticOpts.swap(X.DiagnosticOpts); + HeaderSearchOpts.swap(X.HeaderSearchOpts); + PreprocessorOpts.swap(X.PreprocessorOpts); + AnalyzerOpts.swap(X.AnalyzerOpts); + return *this; +} + +CompilerInvocationRefBase & +CompilerInvocationRefBase::operator=(CompilerInvocationRefBase &&X) = default; + CompilerInvocationRefBase::~CompilerInvocationRefBase() = default; //===----------------------------------------------------------------------===// |