diff options
-rw-r--r-- | clang/include/clang/Frontend/CompilerInvocation.h | 5 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/include/clang/Frontend/CompilerInvocation.h b/clang/include/clang/Frontend/CompilerInvocation.h index 8fc51e6..1a2a394 100644 --- a/clang/include/clang/Frontend/CompilerInvocation.h +++ b/clang/include/clang/Frontend/CompilerInvocation.h @@ -201,6 +201,8 @@ private: /// @} }; +class CowCompilerInvocation; + /// Helper class for holding the data necessary to invoke the compiler. /// /// This class is designed to represent an abstract "invocation" of the @@ -220,6 +222,9 @@ public: } ~CompilerInvocation() = default; + explicit CompilerInvocation(const CowCompilerInvocation &X); + CompilerInvocation &operator=(const CowCompilerInvocation &X); + /// Const getters. /// @{ // Note: These need to be pulled in manually. Otherwise, they get hidden by diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9555dbf6..691f3b9 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -191,6 +191,17 @@ CompilerInvocationBase::shallow_copy_assign(const CompilerInvocationBase &X) { return *this; } +CompilerInvocation::CompilerInvocation(const CowCompilerInvocation &X) + : CompilerInvocationBase(EmptyConstructor{}) { + CompilerInvocationBase::deep_copy_assign(X); +} + +CompilerInvocation & +CompilerInvocation::operator=(const CowCompilerInvocation &X) { + CompilerInvocationBase::deep_copy_assign(X); + return *this; +} + namespace { template <typename T> T &ensureOwned(std::shared_ptr<T> &Storage) { |