================
@@ -168,16 +168,95 @@ bool Sema::IsStringInit(Expr *Init, const ArrayType *AT) {
return ::IsStringInit(Init, AT, Context) == SIF_None;
}
+static StringLiteral *CloneStringLiteral(const StringLiteral *SL,
+ ASTContext &C) {
+ SourceLocation *SLocs = new (C) SourceLocation[SL->getNumConcatenated()];
+ std::copy(SL->tokloc_begin(), SL->tokloc_end(), SLocs);
+ return StringLiteral::Create(
+ C, SL->getBytes(), SL->getKind(), SL->isPascal(), SL->getType(),
+ ArrayRef<SourceLocation>(SLocs, SL->getNumConcatenated()));
+}
+
+// Exactly follow `IgnoreParensSingleStep` (`AST/IgnoreExpr.h`)
+// We only clone those subexpressions which `IgnoreParensSingleStep` drills
down
+// to.
+static Expr *CloneDrilled(Expr *E, ASTContext &C) {
----------------
awson wrote:
Changed to `CloneWithRecurseToInnermostSL`. I thing it much better reflects
what is going on here.
https://github.com/llvm/llvm-project/pull/156846
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits