mirror of
https://github.com/intel/llvm.git
synced 2026-01-29 04:16:38 +08:00
emit a return at the end of the function. Run the llvm verifier.
llvm-svn: 39534
This commit is contained in:
@@ -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 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
|
||||
Builder.SetInsertPoint(EntryBB);
|
||||
|
||||
EmitStmt(FD->getBody());
|
||||
|
||||
// Emit a simple return for now.
|
||||
Builder.CreateRetVoid();
|
||||
|
||||
|
||||
// Verify that the function is well formed.
|
||||
assert(!verifyFunction(*CurFn));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user