aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/FunctionGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-13 12:32:03 +0000
committer_ov4 <ov4@ov4.org>2026-10-13 12:32:03 +0000
commit17cec530b0a4d792bde2d37583b6c26e89f9b1bd (patch)
tree6b67f23d68ccf21dd6052f858037be7b49244c4c /lib/CodeGen/FunctionGen.cc
parent42acac3dac5b8ff5aec4ff204d2c1da948ea34b0 (diff)
fix: distinguish compiler errors and report compilation termination
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
-rw-r--r--lib/CodeGen/FunctionGen.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc
index 99c6a1e..2589797 100644
--- a/lib/CodeGen/FunctionGen.cc
+++ b/lib/CodeGen/FunctionGen.cc
@@ -24,7 +24,7 @@ static bool isReservedRuntimeName(const std::string &Name) {
Type *FunctionGen::getLLVMType(const std::string &TypeName) {
Type *Resolved = Types.getLLVMType(TypeName);
if (!Resolved) {
- fprintf(stderr, "Error: Unknown type %s\n", TypeName.c_str());
+ fprintf(stderr, "error: Unknown type %s\n", TypeName.c_str());
HadError = true;
return Type::getInt64Ty(Context);
}
@@ -35,11 +35,11 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector<ParamDecl
Function::arg_iterator AI = F->arg_begin();
for (const ParamDecl &P : Params) {
if (Types.lookupEnumConstant(P.Name)) {
- fprintf(stderr, "Error: parameter '%s' collides with an enum value\n", P.Name.c_str());
+ fprintf(stderr, "error: parameter '%s' collides with an enum value\n", P.Name.c_str());
HadError = true;
}
if (Types.resolve(P.Name)) {
- fprintf(stderr, "Error: parameter '%s' collides with a type name\n", P.Name.c_str());
+ fprintf(stderr, "error: parameter '%s' collides with a type name\n", P.Name.c_str());
HadError = true;
}
Value *ArgVal = &(*AI);
@@ -85,25 +85,25 @@ const FuncSig *FunctionGen::getSignature(const std::string &Name) const {
Function *FunctionGen::emitPrototype(PrototypeAST *Proto) {
if (isReservedRuntimeName(Proto->getName())) {
- fprintf(stderr, "Error: '%s' is a reserved runtime symbol and cannot be a FUNCTION/PROCEDURE name\n",
+ fprintf(stderr, "error: '%s' is a reserved runtime symbol and cannot be a FUNCTION/PROCEDURE name\n",
Proto->getName().c_str());
HadError = true;
return nullptr;
}
if (CodeGen::isBuiltinName(Proto->getName())) {
- fprintf(stderr, "Error: '%s' is a built-in function and cannot be redefined\n",
+ fprintf(stderr, "error: '%s' is a built-in function and cannot be redefined\n",
Proto->getName().c_str());
HadError = true;
return nullptr;
}
if (Types.lookupEnumConstant(Proto->getName())) {
- fprintf(stderr, "Error: '%s' is an enum value and cannot be a FUNCTION/PROCEDURE name\n",
+ fprintf(stderr, "error: '%s' is an enum value and cannot be a FUNCTION/PROCEDURE name\n",
Proto->getName().c_str());
HadError = true;
return nullptr;
}
if (Types.resolve(Proto->getName())) {
- fprintf(stderr, "Error: '%s' is a type name and cannot be a FUNCTION/PROCEDURE name\n",
+ fprintf(stderr, "error: '%s' is a type name and cannot be a FUNCTION/PROCEDURE name\n",
Proto->getName().c_str());
HadError = true;
return nullptr;
@@ -141,7 +141,7 @@ Function *FunctionGen::emitPrototype(PrototypeAST *Proto) {
FunctionType *FT = FunctionType::get(RetType, ArgTypes, false);
Function *F = Module.getFunction(Proto->getName());
if (F && F->getFunctionType() != FT) {
- fprintf(stderr, "Error: Function %s conflicts with an existing declaration of a different type\n",
+ fprintf(stderr, "error: Function %s conflicts with an existing declaration of a different type\n",
Proto->getName().c_str());
HadError = true;
return nullptr;
@@ -174,7 +174,7 @@ Function *FunctionGen::emitFunctionDef(FunctionDefAST *FuncAST,
if (!TheFunction) return nullptr;
if (!TheFunction->empty()) {
- fprintf(stderr, "Error: Function %s cannot be redefined.\n", Proto->getName().c_str());
+ fprintf(stderr, "error: Function %s cannot be redefined.\n", Proto->getName().c_str());
HadError = true;
return nullptr;
}
@@ -210,7 +210,7 @@ static Value *GenerateCall(llvm::Module &Module,
bool &HadError) {
Function *CalleeF = Module.getFunction(CalleeName);
if (!CalleeF) {
- fprintf(stderr, "Error: Call to undefined function %s\n", CalleeName.c_str());
+ fprintf(stderr, "error: Call to undefined function %s\n", CalleeName.c_str());
HadError = true;
return nullptr;
}