aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-07-04 13:58:26 +0000
committerEd Schouten <ed@FreeBSD.org>2009-07-04 13:58:26 +0000
commit18f153bdb9db52e7089a2d5293b96c45a3124a26 (patch)
tree84360c8989c912127a383af37c4b1aa5767bd16e /lib/VMCore/Function.cpp
parentf859468f5a21b6952ab62917777f9fb3bba57003 (diff)
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 045056643b54..eeade051ac53 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -114,6 +114,12 @@ void Argument::removeAttr(Attributes attr) {
// Helper Methods in Function
//===----------------------------------------------------------------------===//
+LLVMContext* Function::getContext() {
+ Module* M = getParent();
+ if (M) return &M->getContext();
+ return 0;
+}
+
const FunctionType *Function::getFunctionType() const {
return cast<FunctionType>(getType()->getElementType());
}