diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index f1f24f5dcf0a..fa1a3d2332eb 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/CodeGen/CodeGenModule.cpp @@ -13,11 +13,14 @@ #include "CodeGenModule.h" #include "CodeGenFunction.h" +#include "clang/AST/Decl.h" using namespace llvm; using namespace clang; using namespace CodeGen; void CodeGenModule::EmitFunction(FunctionDecl *FD) { - CodeGenFunction(*this).GenerateCode(FD); + // If this is not a prototype, emit the body. + if (FD->getBody()) + CodeGenFunction(*this).GenerateCode(FD); }