diff options
Diffstat (limited to 'include/clang/AST/Stmt.h')
-rw-r--r-- | include/clang/AST/Stmt.h | 224 |
1 files changed, 4 insertions, 220 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 3b0b823554..b4e0fd561e 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -398,15 +398,7 @@ public: /// value objects created/interpreted by SourceManager. We assume AST /// clients will have a pointer to the respective SourceManager. SourceRange getSourceRange() const LLVM_READONLY; - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY; - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY; // global temp stats (until we have a per-module visitor) @@ -421,6 +413,9 @@ public: void dump(raw_ostream &OS, SourceManager &SM) const; void dump(raw_ostream &OS) const; + /// \return Unique reproducible object identifier + int64_t getID(const ASTContext &Context) const; + /// dumpColor - same as dump(), but forces color highlighting. void dumpColor() const; @@ -429,6 +424,7 @@ public: void dumpPretty(const ASTContext &Context) const; void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation = 0, + StringRef NewlineSymbol = "\n", const ASTContext *Context = nullptr) const; /// viewAST - Visualize an AST rooted at this Stmt* using GraphViz. Only @@ -530,23 +526,11 @@ public: DeclGroupRef getDeclGroup() { return DG; } void setDeclGroup(DeclGroupRef DGR) { DG = DGR; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getStartLoc() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } void setStartLoc(SourceLocation L) { StartLoc = L; } SourceLocation getEndLoc() const { return EndLoc; } void setEndLoc(SourceLocation L) { EndLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return StartLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return EndLoc; - } static bool classof(const Stmt *T) { return T->getStmtClass() == DeclStmtClass; @@ -613,15 +597,7 @@ public: bool hasLeadingEmptyMacro() const { return HasLeadingEmptyMacro; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return SemiLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SemiLoc; } static bool classof(const Stmt *T) { @@ -721,15 +697,7 @@ public: return const_reverse_body_iterator(body_begin()); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return LBraceLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return RBraceLoc; } SourceLocation getLBracLoc() const { return LBraceLoc; } @@ -778,15 +746,7 @@ public: return const_cast<SwitchCase*>(this)->getSubStmt(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -839,16 +799,8 @@ public: void setLHS(Expr *Val) { SubExprs[LHS] = reinterpret_cast<Stmt*>(Val); } void setRHS(Expr *Val) { SubExprs[RHS] = reinterpret_cast<Stmt*>(Val); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { // Handle deeply nested case statements with iteration instead of recursion. const CaseStmt *CS = this; @@ -888,15 +840,7 @@ public: SourceLocation getColonLoc() const { return ColonLoc; } void setColonLoc(SourceLocation L) { ColonLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -942,15 +886,7 @@ public: void setIdentLoc(SourceLocation L) { IdentLoc = L; } void setSubStmt(Stmt *SS) { SubStmt = SS; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return IdentLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -1007,15 +943,7 @@ public: Stmt *getSubStmt() { return SubStmt; } const Stmt *getSubStmt() const { return SubStmt; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return AttrLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -1085,16 +1013,8 @@ public: bool isObjCAvailabilityCheck() const; - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return IfLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { if (SubExprs[ELSE]) return SubExprs[ELSE]->getEndLoc(); @@ -1188,16 +1108,8 @@ public: /// have been explicitly covered. bool isAllEnumCasesCovered() const { return FirstCase.getInt(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return SwitchLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY] ? SubExprs[BODY]->getEndLoc() : SubExprs[COND]->getEndLoc(); @@ -1253,16 +1165,8 @@ public: SourceLocation getWhileLoc() const { return WhileLoc; } void setWhileLoc(SourceLocation L) { WhileLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return WhileLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -1311,15 +1215,7 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return DoLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -1389,16 +1285,8 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -1434,15 +1322,7 @@ public: SourceLocation getLabelLoc() const { return LabelLoc; } void setLabelLoc(SourceLocation L) { LabelLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; } static bool classof(const Stmt *T) { @@ -1487,15 +1367,7 @@ public: return const_cast<IndirectGotoStmt*>(this)->getConstantTarget(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return Target->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1519,15 +1391,7 @@ public: SourceLocation getContinueLoc() const { return ContinueLoc; } void setContinueLoc(SourceLocation L) { ContinueLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return ContinueLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return ContinueLoc; } static bool classof(const Stmt *T) { @@ -1556,15 +1420,7 @@ public: SourceLocation getBreakLoc() const { return BreakLoc; } void setBreakLoc(SourceLocation L) { BreakLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return BreakLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return BreakLoc; } static bool classof(const Stmt *T) { @@ -1615,16 +1471,8 @@ public: const VarDecl *getNRVOCandidate() const { return NRVOCandidate; } void setNRVOCandidate(const VarDecl *Var) { NRVOCandidate = Var; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return RetLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return RetExpr ? RetExpr->getEndLoc() : RetLoc; } @@ -1680,15 +1528,7 @@ public: bool isVolatile() const { return IsVolatile; } void setVolatile(bool V) { IsVolatile = V; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return {}; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return {}; } //===--- Asm String Analysis ---===// @@ -1970,15 +1810,7 @@ public: return Clobbers[i]; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -2076,15 +1908,7 @@ private: ArrayRef<Expr*> Exprs, ArrayRef<StringRef> Clobbers); public: - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } static bool classof(const Stmt *T) { return T->getStmtClass() == MSAsmStmtClass; @@ -2113,15 +1937,7 @@ public: Expr *FilterExpr, Stmt *Block); - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return getExceptLoc(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getExceptLoc() const { return Loc; } SourceLocation getEndLoc() const { return getBlock()->getEndLoc(); } @@ -2158,15 +1974,7 @@ public: SourceLocation FinallyLoc, Stmt *Block); - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return getFinallyLoc(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getFinallyLoc() const { return Loc; } SourceLocation getEndLoc() const { return Block->getEndLoc(); } @@ -2204,15 +2012,7 @@ public: SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler); - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return getTryLoc(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getTryLoc() const { return TryLoc; } SourceLocation getEndLoc() const { return Children[HANDLER]->getEndLoc(); } @@ -2252,15 +2052,7 @@ public: SourceLocation getLeaveLoc() const { return LeaveLoc; } void setLeaveLoc(SourceLocation L) { LeaveLoc = L; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return LeaveLoc; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return LeaveLoc; } static bool classof(const Stmt *T) { @@ -2474,18 +2266,10 @@ public: return capture_init_begin() + NumCaptures; } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, - "Use getBeginLoc instead") { - return getBeginLoc(); - } SourceLocation getBeginLoc() const LLVM_READONLY { return getCapturedStmt()->getBeginLoc(); } - LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, - "Use getEndLoc instead") { - return getEndLoc(); - } SourceLocation getEndLoc() const LLVM_READONLY { return getCapturedStmt()->getEndLoc(); } |