[PATCH] D141871: [Clang][OpenMP] Add parse and sema for iterator map modifier

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 16:23:36 PST 2023


doru1004 added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:22399-22412
 bool Sema::isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const {
   assert(LangOpts.OpenMP && "Expected OpenMP mode.");
   const Expr *Ref = DSAStack->getDeclareMapperVarRef();
   if (const auto *DRE = cast_or_null<DeclRefExpr>(Ref)) {
     if (VD->getCanonicalDecl() == DRE->getDecl()->getCanonicalDecl())
       return true;
     if (VD->isUsableInConstantExpressions(Context))
----------------
This input to this function is the VD variable I've been talking about. If you print it all out it's just a simple VarDecl:

if you do `VD->dump()`;
```
VarDecl 0x55b57f81dec8 <test_declare_mapper_iterator.c:26:52> col:52 implicit used it 'int'
```

if you do `VD->getType()->dump()`:
```
BuiltinType 0x55b57f6d2560 'int'
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141871/new/

https://reviews.llvm.org/D141871



More information about the cfe-commits mailing list