[PATCH] D37035: Implement __builtin_LINE() et. al. to support source location capture.

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 16:30:38 PDT 2017


hfinkel added inline comments.


================
Comment at: include/clang/AST/Expr.h:3814
 
+/// BuiltinSourceLocExpr - Represents a function call to one of
+/// __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or
----------------
BuiltinSourceLocExpr -> SourceLocExpr


================
Comment at: lib/Sema/SemaExpr.cpp:12955
+      SourceMgr.getPresumedLoc(SourceMgr.getExpansionRange(CallerLoc).second);
+  assert(PLoc.isValid()); // FIXME: Learn how to handle this.
+
----------------
Do you have an example where you don't get back a valid location? Are you going to give back ("", 0, 0) for (file, line, column)? Probably doesn't matter for the function name.


================
Comment at: lib/Sema/SemaInit.cpp:563
+      if (SemaRef.CheckCXXDefaultInitExpr(Loc, Field)) {
+        /* nothing todo */
+      } else if (SourceLocExpr::containsSourceLocExpr(
----------------
  // Nothing to do.


https://reviews.llvm.org/D37035





More information about the cfe-commits mailing list