Browse Source

fix for redefining functions

Andrea Gussoni 8 years ago
parent
commit
eb8f419895
2 changed files with 0 additions and 6 deletions
  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);