|
@@ -89,8 +89,6 @@ Function *PrototypeAST::codegen() {
|
|
|
return F;
|
|
|
}
|
|
|
|
|
|
-const std::string &PrototypeAST::getName() const { return Name; }
|
|
|
-
|
|
|
Function *FunctionAST::codegen() {
|
|
|
|
|
|
// First, check for an existing function from a previous 'extern' declaration.
|
|
@@ -98,13 +96,13 @@ Function *FunctionAST::codegen() {
|
|
|
AstObjects::TheModule->getFunction(Proto->getName());
|
|
|
|
|
|
if (!TheFunction)
|
|
|
- TheFunction = Proto->codegen();
|
|
|
+ TheFunction = Proto->codegen();
|
|
|
|
|
|
if (!TheFunction)
|
|
|
- return nullptr;
|
|
|
+ return nullptr;
|
|
|
|
|
|
if (!TheFunction->empty())
|
|
|
- return (Function*)ErrorV("Function cannot be redefined.");
|
|
|
+ return (Function*)ErrorV("Function cannot be redefined.");
|
|
|
|
|
|
// Create a new basic block to start insertion into.
|
|
|
BasicBlock *BB = BasicBlock::Create(getGlobalContext(),
|