[llvm-branch-commits] [clang] [Clang] [NFC] Expansion Statements (Part 4: for-range refactor) (PR #169683)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jul 8 15:48:48 PDT 2026
================
@@ -2431,27 +2431,46 @@ void NoteForRangeBeginEndFunction(Sema &SemaRef, Expr *E,
SemaRef.Diag(Loc, diag::note_for_range_begin_end)
<< BEF << IsTemplate << Description << E->getType();
}
+}
/// Build a variable declaration for a for-range statement.
-VarDecl *BuildForRangeVarDecl(Sema &SemaRef, SourceLocation Loc,
- QualType Type, StringRef Name) {
- DeclContext *DC = SemaRef.CurContext;
- IdentifierInfo *II = &SemaRef.PP.getIdentifierTable().get(Name);
- TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc);
- VarDecl *Decl = VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type,
- TInfo, SC_None);
+VarDecl *Sema::BuildForRangeVarDecl(SourceLocation Loc, QualType Type,
+ IdentifierInfo *II, bool Constexpr) {
----------------
Sirraide wrote:
It will be used in patch 5
https://github.com/llvm/llvm-project/pull/169683
More information about the llvm-branch-commits
mailing list