Flag -> Glue, the ongoing saga
[oota-llvm.git] / lib / VMCore / IRBuilder.cpp
index 850812cf66d8b2b7ed461cd5868a206cde568600..c1b783c752100b3254ce8ee2a4d627025671ba74 100644 (file)
 
 #include "llvm/Support/IRBuilder.h"
 #include "llvm/GlobalVariable.h"
+#include "llvm/Function.h"
+#include "llvm/LLVMContext.h"
 using namespace llvm;
 
 /// CreateGlobalString - Make a new global variable with an initializer that
-/// has array of i8 type filled in the the nul terminated string value
+/// has array of i8 type filled in with the nul terminated string value
 /// specified.  If Name is specified, it is the name of the global variable
 /// created.
 Value *IRBuilderBase::CreateGlobalString(const char *Str, const Twine &Name) {
@@ -29,3 +31,8 @@ Value *IRBuilderBase::CreateGlobalString(const char *Str, const Twine &Name) {
   GV->setName(Name);
   return GV;
 }
+
+const Type *IRBuilderBase::getCurrentFunctionReturnType() const {
+  assert(BB && BB->getParent() && "No current function!");
+  return BB->getParent()->getReturnType();
+}