diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index 7778924fc452f..5e879d672d801 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -225,11 +225,9 @@ class CompilerInstance : public ModuleLoader { bool hasInvocation() const { return Invocation != nullptr; } - CompilerInvocation &getInvocation() { return *getInvocationPtr(); } - - std::shared_ptr getInvocationPtr() { + CompilerInvocation &getInvocation() { assert(Invocation && "Compiler instance has no invocation!"); - return Invocation; + return *Invocation; } /// setInvocation - Replace the current invocation.