[llvm] d48a3f9 - [NFC] Directly use OpenMPIRBuilder::Ident instead of IdentPtr->getPointerElementType()

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 12 20:46:27 PDT 2021


Author: Arthur Eubanks
Date: 2021-09-12T20:45:44-07:00
New Revision: d48a3f9f757c2c4b6adc7b8f7ca94641d9cf3a46

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

LOG: [NFC] Directly use OpenMPIRBuilder::Ident instead of IdentPtr->getPointerElementType()

Added: 
    

Modified: 
    llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 8316c6f0c74c1..fc4580eacacd0 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -270,17 +270,17 @@ Value *OpenMPIRBuilder::getOrCreateIdent(Constant *SrcLocStr,
     Constant *IdentData[] = {
         I32Null, ConstantInt::get(Int32, uint32_t(LocFlags)),
         ConstantInt::get(Int32, Reserve2Flags), I32Null, SrcLocStr};
-    Constant *Initializer = ConstantStruct::get(
-        cast<StructType>(IdentPtr->getPointerElementType()), IdentData);
+    Constant *Initializer =
+        ConstantStruct::get(OpenMPIRBuilder::Ident, IdentData);
 
     // Look for existing encoding of the location + flags, not needed but
     // minimizes the 
diff erence to the existing solution while we transition.
     for (GlobalVariable &GV : M.getGlobalList())
-      if (GV.getType() == IdentPtr && GV.hasInitializer())
+      if (GV.getValueType() == OpenMPIRBuilder::Ident && GV.hasInitializer())
         if (GV.getInitializer() == Initializer)
           return Ident = &GV;
 
-    auto *GV = new GlobalVariable(M, IdentPtr->getPointerElementType(),
+    auto *GV = new GlobalVariable(M, OpenMPIRBuilder::Ident,
                                   /* isConstant = */ true,
                                   GlobalValue::PrivateLinkage, Initializer);
     GV->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);


        


More information about the llvm-commits mailing list