Author: Arthur Eubanks
Date: 2022-02-11T10:39:49-08:00
New Revision: 87dd3d350c4ce0115b2cdf91d85ddd05ae2661aa
URL: 
https://github.com/llvm/llvm-project/commit/87dd3d350c4ce0115b2cdf91d85ddd05ae2661aa
DIFF: 
https://github.com/llvm/llvm-project/commit/87dd3d350c4ce0115b2cdf91d85ddd05ae2661aa.diff

LOG: [clang][OpaquePtr] Remove call to getPointerElementType() in 
CodeGenModule::GetAddrOfGlobalTemporary()

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index 0d89cb723c76b..772059a436d17 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5670,9 +5670,11 @@ ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary(
           getModule(), Type, false, llvm::GlobalVariable::InternalLinkage,
           nullptr);
     }
-    return ConstantAddress(
-        InsertResult.first->second,
-        InsertResult.first->second->getType()->getPointerElementType(), Align);
+    return ConstantAddress(InsertResult.first->second,
+                           llvm::cast<llvm::GlobalVariable>(
+                               InsertResult.first->second->stripPointerCasts())
+                               ->getValueType(),
+                           Align);
   }
 
   // FIXME: If an externally-visible declaration extends multiple temporaries,


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to