[PATCH] D49796: [ASTImporter] Load external Decls when getting field index.

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 14:06:16 PDT 2018


a_sidorin added a comment.

Hi Balázs,
The approach is OK but I have some minor comments inline.



================
Comment at: lib/AST/ASTImporter.cpp:2840
 
-  return Index;
+  assert(false && "Field was not found in its parent context.");
+
----------------
`llvm_unreachable`?


================
Comment at: unittests/AST/ASTImporterTest.cpp:2642
+    unsigned ToIndex = 0u;
+    for (auto *F : ToLambda->fields()) {
+      if (F == ToField)
----------------
I think we can make `getFieldIndex()` a static method of ASTImporter and remove this loop.


Repository:
  rC Clang

https://reviews.llvm.org/D49796





More information about the cfe-commits mailing list