r.stahl added inline comments.

================
Comment at: lib/AST/ASTImporter.cpp:7058
+    const SrcMgr::ExpansionInfo &FromEx = FromSLoc.getExpansion();
+    SourceLocation ToSpLoc = Import(FromEx.getSpellingLoc());
+    SourceLocation ToExLocS = Import(FromEx.getExpansionLocStart());
----------------
martong wrote:
> Let's say we import a `SourceLocation` with 
> `ASTImporter::Import(SourceLocation FromLoc)`.
> That calls into `ASTImporter::Import(FileID FromID)` where we again import 
> other source locations.
> Could the initial `FromLoc` be equal with any of these locations 
> (`FromEx.getSpellingLoc()`, `FromEx.getExpansionLocStart()`) ?
> My understanding is that this is not possible because we cannot have 
> recursive macros, but please confirm.
Yes, that was my understanding as well. If some compiler error is a macro 
expansion it eventually stops at some point while walking this chain.


================
Comment at: unittests/AST/ASTImporterTest.cpp:1521
 
+static void CompareSourceLocs(SourceLocation Loc1, SourceLocation Loc2,
+                              SourceManager &SM1, SourceManager &SM2) {
----------------
martong wrote:
> Perhaps it would be more concise and less error prone to use a 
> `FullSourceLoc` which wraps one simple `SourceLocation` and a `SourceManager`.
Will do, thanks!


Repository:
  rC Clang

https://reviews.llvm.org/D47698



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to