[clang] d9cb70b - [clang] NFC: Remove CompilerInstance::getInvocationPtr

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon May 17 00:33:41 PDT 2021


Author: Jan Svoboda
Date: 2021-05-17T09:33:35+02:00
New Revision: d9cb70ba29dbd74aac294caad0686f1ed52295f9

URL: https://github.com/llvm/llvm-project/commit/d9cb70ba29dbd74aac294caad0686f1ed52295f9
DIFF: https://github.com/llvm/llvm-project/commit/d9cb70ba29dbd74aac294caad0686f1ed52295f9.diff

LOG: [clang] NFC: Remove CompilerInstance::getInvocationPtr

This member function was introduced in 0a92e09c ([clang][deps] Generate the full command-line for modules) in order to keep the CompilerInvocation object alive after CompilerInstance goes out of scope. However, d3fb4b90 ([clang][deps] NFC: Report modules' context hash) removes that use-case, making this function dead.

Added: 
    

Modified: 
    clang/include/clang/Frontend/CompilerInstance.h

Removed: 
    


################################################################################
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<CompilerInvocation> getInvocationPtr() {
+  CompilerInvocation &getInvocation() {
     assert(Invocation && "Compiler instance has no invocation!");
-    return Invocation;
+    return *Invocation;
   }
 
   /// setInvocation - Replace the current invocation.


        


More information about the cfe-commits mailing list