[cfe-commits] r39656 - /cfe/cfe/trunk/CodeGen/CodeGenModule.cpp

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:46:43 PDT 2007


Author: clattner
Date: Wed Jul 11 11:46:43 2007
New Revision: 39656

URL: http://llvm.org/viewvc/llvm-project?rev=39656&view=rev
Log:
Don't generate code for prototypes

Modified:
    cfe/cfe/trunk/CodeGen/CodeGenModule.cpp

Modified: cfe/cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=39656&r1=39655&r2=39656&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/cfe/trunk/CodeGen/CodeGenModule.cpp Wed Jul 11 11:46:43 2007
@@ -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);
 }





More information about the cfe-commits mailing list