[PATCH] D156201: [ASTImporter] Fix corrupted RecordLayout introduced by circular referenced fields
Ding Fei via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 27 21:32:46 PDT 2023
danix800 added inline comments.
================
Comment at: clang/lib/AST/ASTImporter.cpp:7403
+ UO->setOperatorLoc(ToOperatorLoc);
+ UO->setCanOverflow(E->canOverflow());
+
----------------
shafik wrote:
> I don't see the following values from the old code used: `E->getValueKind()`, `E->getObjectKind()` and `E->getFPOptionsOverride()`
These three values are set for all Exprs in `Import(Stmt *FromS)`:
```
Expected<Stmt *> ASTImporter::Import(Stmt *FromS) {
// ...
if (auto *ToE = dyn_cast<Expr>(*ToSOrErr)) {
auto *FromE = cast<Expr>(FromS);
// Copy ExprBitfields, which may not be handled in Expr subclasses
// constructors.
ToE->setValueKind(FromE->getValueKind());
ToE->setObjectKind(FromE->getObjectKind());
ToE->setDependence(FromE->getDependence());
}
// ...
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156201/new/
https://reviews.llvm.org/D156201
More information about the cfe-commits
mailing list