[PATCH] D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc)

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 03:12:39 PST 2020


balazske added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:8043
+
+  Error VisitFunctionTypeLoc(FunctionTypeLoc From) {
+    auto To = ToL.castAs<FunctionTypeLoc>();
----------------
martong wrote:
> a_sidorin wrote:
> > Does this import interacts well with type loc import partially done at L3258 (VisitFunctionDecl)? Should we merge them?
> I think we should check here whether the given ParmVarDecl had been imported previously and if yes then set that with `setParam`, otherwise it could be set to a nullptr. @balazske what do you think?
Probably we could get the `FunctionTypeLoc` from `TInfo` (this is the first TypeLoc there?) and set the parameters (that are set to nullptr at line 8055), at this loop in `VisitFunctionDecl`:
```
  // Set the parameters.
  for (auto *Param : Parameters) {
    Param->setOwningFunction(ToFunction);
    ToFunction->addDeclInternal(Param);
  }
  ToFunction->setParams(Parameters);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71018





More information about the cfe-commits mailing list