aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-02 18:03:58 +0000
committerOwen Anderson <resistor@mac.com>2009-07-02 18:03:58 +0000
commit0cb64ee34041db63e4df1e5c03fb059c866725e8 (patch)
treea01aafdaf0aa1c54e48b4f3d0ef9f8469f60bdc5 /include
parent11046f3dbdfc3be2ffd0b72c0eef17ef273db5ab (diff)
downloadexternal_llvm-0cb64ee34041db63e4df1e5c03fb059c866725e8.zip
external_llvm-0cb64ee34041db63e4df1e5c03fb059c866725e8.tar.gz
external_llvm-0cb64ee34041db63e4df1e5c03fb059c866725e8.tar.bz2
Add an accessor to Function so that Passes can easily get access to the context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Function.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 228ef94..34ced97 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -27,6 +27,7 @@
namespace llvm {
class FunctionType;
+class LLVMContext;
// Traits for intrusive list of basic blocks...
template<> struct ilist_traits<BasicBlock>
@@ -126,6 +127,10 @@ public:
const Type *getReturnType() const; // Return the type of the ret val
const FunctionType *getFunctionType() const; // Return the FunctionType for me
+ /// getContext - Return a pointer to the LLVMContext associated with this
+ /// function, or NULL if this function is not bound to a context yet.
+ LLVMContext* getContext();
+
/// isVarArg - Return true if this function takes a variable number of
/// arguments.
bool isVarArg() const;