From: Chris Lattner Date: Wed, 18 Feb 2009 06:48:23 +0000 (+0000) Subject: add iterators for string token locations. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b137299ce5bb6c36fbba651858600857fda4dd50;p=clang add iterators for string token locations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64899 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 54167c9c37..ffdd996ced 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -516,6 +516,11 @@ public: assert(TokNum < NumConcatenated && "Invalid tok number"); return TokLocs[TokNum]; } + + typedef const SourceLocation *tokloc_iterator; + tokloc_iterator tokloc_begin() const { return TokLocs; } + tokloc_iterator tokloc_end() const { return TokLocs+NumConcatenated; } + virtual SourceRange getSourceRange() const { return SourceRange(TokLocs[0], TokLocs[NumConcatenated-1]);