瀏覽代碼

fix for redefining functions

Andrea Gussoni 8 年之前
父節點
當前提交
eb8f419895
共有 2 個文件被更改,包括 0 次插入6 次删除
  1. 0 3
      source/Ast.cpp
  2. 0 3
      source/Chapters/Chapter3.cpp

+ 0 - 3
source/Ast.cpp

@@ -101,9 +101,6 @@ Function *FunctionAST::codegen() {
   if (!TheFunction)
     return nullptr;
 
-  if (!TheFunction->empty())
-    return (Function*)ErrorV("Function cannot be redefined.");
-
   // Create a new basic block to start insertion into.
   BasicBlock *BB = BasicBlock::Create(getGlobalContext(),
       "entry", TheFunction);

+ 0 - 3
source/Chapters/Chapter3.cpp

@@ -472,9 +472,6 @@ Function *FunctionAST::codegen() {
   if (!TheFunction)
     return nullptr;
 
-  if (!TheFunction->empty())
-    return (Function*)ErrorV("Function cannot be redefined.");  
-
   // Create a new basic block to start insertion into.
   BasicBlock *BB = BasicBlock::Create(getGlobalContext(), "entry", TheFunction);
   Builder.SetInsertPoint(BB);