aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/IRBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/IRBuilder.cpp')
-rw-r--r--lib/VMCore/IRBuilder.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/IRBuilder.cpp b/lib/VMCore/IRBuilder.cpp
index 99803f134f..0b4a10925a 100644
--- a/lib/VMCore/IRBuilder.cpp
+++ b/lib/VMCore/IRBuilder.cpp
@@ -14,6 +14,7 @@
#include "llvm/Support/IRBuilder.h"
#include "llvm/GlobalVariable.h"
+#include "llvm/Function.h"
#include "llvm/Metadata.h"
#include "llvm/LLVMContext.h"
using namespace llvm;
@@ -44,3 +45,8 @@ void IRBuilderBase::SetInstDebugLocation(Instruction *I) const {
if (CurDbgLocation)
Context.getMetadata().addMD(DbgMDKind, CurDbgLocation, I);
}
+
+const Type *IRBuilderBase::getCurrentFunctionReturnType() const {
+ assert(BB && BB->getParent() && "No current function!");
+ return BB->getParent()->getReturnType();
+}