emit a return at the end of the function. Run the llvm verifier.
llvm-svn: 39534
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp
index ec1aad8..73553da 100644
--- a/clang/CodeGen/CodeGenFunction.cpp
+++ b/clang/CodeGen/CodeGenFunction.cpp
@@ -18,6 +18,7 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
+#include "llvm/Analysis/Verifier.h"
using namespace llvm;
using namespace clang;
using namespace CodeGen;
@@ -125,6 +126,13 @@
Builder.SetInsertPoint(EntryBB);
EmitStmt(FD->getBody());
+
+ // Emit a simple return for now.
+ Builder.CreateRetVoid();
+
+
+ // Verify that the function is well formed.
+ assert(!verifyFunction(*CurFn));
}