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

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 13:44:37 PDT 2019


EricWF marked 14 inline comments as done.
EricWF added a comment.

Address review comments.



================
Comment at: lib/AST/ExprConstant.cpp:3370-3371
+
+  assert((!Base || !isa<SourceLocExpr>(Base)) &&
+         "Base should have already been transformed into a StringLiteral");
+
----------------
rsmith wrote:
> EricWF wrote:
> > rsmith wrote:
> > > There are lots of forms of expression that cannot be the base of an `LValue` (see the list above `LValueExprEvaluator` for the expression forms that *can* be the base of an `LValue`); is it important to give this one special treatment?
> > Because a `SourceLocExpr` *can* be the base of an `LValue`. But the way that's supported is by transforming the `SourceLocExpr` into a `StringLiteral`. 
> I don't agree: a `SourceLocExpr` cannot be the base of an `LValue`. It is evaluated into something else that can be (a `StringLiteral`), but it itself cannot be (and this is in no way unusual; that's probably true of most `Expr` nodes). I think this is a remnant of an earlier design?
Seems like it. Removed.


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

https://reviews.llvm.org/D37035





More information about the cfe-commits mailing list