[Openmp-commits] [PATCH] D80735: [OpenMP][NFC] Reuse `llvm::omp::types::IdentPtr` in clang

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 28 09:15:58 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: jhuber6, fghanim.
Herald added subscribers: sstefan1, guansong, bollu, yaxunl.
Herald added a project: clang.

We should replace the uses of `QualType IdentQTy` with DataLayout
queries encapsulated in a helper (inside `llvm::omp::types`)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80735

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.h


Index: clang/lib/CodeGen/CGOpenMPRuntime.h
===================================================================
--- clang/lib/CodeGen/CGOpenMPRuntime.h
+++ clang/lib/CodeGen/CGOpenMPRuntime.h
@@ -378,7 +378,6 @@
   Address getOrCreateDefaultLocation(unsigned Flags);
 
   QualType IdentQTy;
-  llvm::StructType *IdentTy = nullptr;
   /// Map for SourceLocation and OpenMP runtime library debug locations.
   typedef llvm::DenseMap<unsigned, llvm::Value *> OpenMPDebugLocMapTy;
   OpenMPDebugLocMapTy OpenMPDebugLocMap;
Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===================================================================
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1289,7 +1289,7 @@
   addFieldToRecordDecl(C, RD, C.VoidPtrTy);
   RD->completeDefinition();
   IdentQTy = C.getRecordType(RD);
-  IdentTy = CGM.getTypes().ConvertRecordDeclType(RD);
+  llvm::omp::types::initializeTypes(CGM.getModule());
   KmpCriticalNameTy = llvm::ArrayType::get(CGM.Int32Ty, /*NumElements*/ 8);
 
   loadOffloadInfoMetadata();
@@ -1799,7 +1799,7 @@
 }
 
 llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() {
-  return IdentTy->getPointerTo();
+  return llvm::omp::types::IdentPtr;
 }
 
 llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80735.266906.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200528/d8064687/attachment-0001.bin>


More information about the Openmp-commits mailing list