aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 23adaed4a2..4923842964 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -115,10 +115,8 @@ void Argument::removeAttr(Attributes attr) {
// Helper Methods in Function
//===----------------------------------------------------------------------===//
-LLVMContext *Function::getContext() const {
- const Module* M = getParent();
- if (M) return &M->getContext();
- return 0;
+LLVMContext &Function::getContext() const {
+ return getType()->getContext();
}
const FunctionType *Function::getFunctionType() const {