[Openmp-commits] [PATCH] D122852: [OPENMP] Fix assertion in clang::ASTContext::getTypeInfoImpl
    Alexey Bataev via Phabricator via Openmp-commits 
    openmp-commits at lists.llvm.org
       
    Fri Apr  1 05:35:17 PDT 2022
    
    
  
ABataev added inline comments.
================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8072-8088
+          QualType CanonType =
+              I->getAssociatedExpression()->getType().getCanonicalType();
+          if (CanonType->isSpecificBuiltinType(BuiltinType::OMPArraySection)) {
+            const auto *OASE = cast<OMPArraySectionExpr>(
+                I->getAssociatedExpression()->IgnoreParenImpCasts());
+            QualType BaseType =
+               OMPArraySectionExpr::getBaseOriginalType(OASE->getBase());
----------------
Why not something like:
```
llvm::Value *TypeSize = CGF.getTypeSize(CanonType);
llvm::Value *Idx = CGF.Builder.CreateSub(TypeSize, 1);
Address HB = CGF.Builder.CreateGEP(
              CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
                  LowestElem, CGF.VoidPtrTy, CGF.Int8Ty),
             Idx);
```
Repository:
  rC Clang
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122852/new/
https://reviews.llvm.org/D122852
    
    
More information about the Openmp-commits
mailing list