From 5f24e7d548f8abc2d0a84bb84446d75313bb2baf Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 23 Jun 2014 02:16:34 +0000 Subject: [PATCH] AST: Add ranges for AsmStmt's inputs and outputs No functionality change. llvm-svn: 211483 --- clang/include/clang/AST/Stmt.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 88cbb21b8110..99e84f8267da 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -1477,6 +1477,8 @@ public: typedef ExprIterator inputs_iterator; typedef ConstExprIterator const_inputs_iterator; + typedef llvm::iterator_range inputs_range; + typedef llvm::iterator_range inputs_const_range; inputs_iterator begin_inputs() { return &Exprs[0] + NumOutputs; @@ -1486,6 +1488,8 @@ public: return &Exprs[0] + NumOutputs + NumInputs; } + inputs_range inputs() { return inputs_range(begin_inputs(), end_inputs()); } + const_inputs_iterator begin_inputs() const { return &Exprs[0] + NumOutputs; } @@ -1494,10 +1498,16 @@ public: return &Exprs[0] + NumOutputs + NumInputs; } + inputs_const_range inputs() const { + return inputs_const_range(begin_inputs(), end_inputs()); + } + // Output expr iterators. typedef ExprIterator outputs_iterator; typedef ConstExprIterator const_outputs_iterator; + typedef llvm::iterator_range outputs_range; + typedef llvm::iterator_range outputs_const_range; outputs_iterator begin_outputs() { return &Exprs[0]; @@ -1505,6 +1515,9 @@ public: outputs_iterator end_outputs() { return &Exprs[0] + NumOutputs; } + outputs_range outputs() { + return outputs_range(begin_outputs(), end_outputs()); + } const_outputs_iterator begin_outputs() const { return &Exprs[0]; @@ -1512,6 +1525,9 @@ public: const_outputs_iterator end_outputs() const { return &Exprs[0] + NumOutputs; } + outputs_const_range outputs() const { + return outputs_const_range(begin_outputs(), end_outputs()); + } child_range children() { return child_range(&Exprs[0], &Exprs[0] + NumOutputs + NumInputs);