aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/IR/Function.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Function.h')
-rw-r--r--include/llvm/IR/Function.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index bba7ecd..cb43bba 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -18,6 +18,7 @@
#ifndef LLVM_IR_FUNCTION_H
#define LLVM_IR_FUNCTION_H
+#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
@@ -335,7 +336,7 @@ public:
/// copyAttributesFrom - copy all additional attributes (those not needed to
/// create a Function) from the Function Src to this one.
- void copyAttributesFrom(const GlobalValue *Src);
+ void copyAttributesFrom(const GlobalValue *Src) override;
/// deleteBody - This method deletes the body of the function, and converts
/// the linkage to external.
@@ -348,12 +349,12 @@ public:
/// removeFromParent - This method unlinks 'this' from the containing module,
/// but does not delete it.
///
- virtual void removeFromParent();
+ void removeFromParent() override;
/// eraseFromParent - This method unlinks 'this' from the containing module
/// and deletes it.
///
- virtual void eraseFromParent();
+ void eraseFromParent() override;
/// Get the underlying elements of the Function... the basic block list is
@@ -404,9 +405,9 @@ public:
const BasicBlock &back() const { return BasicBlocks.back(); }
BasicBlock &back() { return BasicBlocks.back(); }
- //===--------------------------------------------------------------------===//
- // Argument iterator forwarding functions
- //
+/// @name Function Argument Iteration
+/// @{
+
arg_iterator arg_begin() {
CheckLazyArguments();
return ArgumentList.begin();
@@ -424,6 +425,16 @@ public:
return ArgumentList.end();
}
+ iterator_range<arg_iterator> args() {
+ return iterator_range<arg_iterator>(arg_begin(), arg_end());
+ }
+
+ iterator_range<const_arg_iterator> args() const {
+ return iterator_range<const_arg_iterator>(arg_begin(), arg_end());
+ }
+
+/// @}
+
size_t arg_size() const;
bool arg_empty() const;