aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGen.cc')
-rw-r--r--lib/CodeGen/CodeGen.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGen.cc b/lib/CodeGen/CodeGen.cc
index c0da7ee..f12c6ce 100644
--- a/lib/CodeGen/CodeGen.cc
+++ b/lib/CodeGen/CodeGen.cc
@@ -56,7 +56,7 @@ bool CodeGen::isBuiltinName(const std::string &Name) {
void CodeGen::reportError(const char *Fmt, ...) {
va_list Args;
va_start(Args, Fmt);
- fprintf(stderr, "Error: ");
+ fprintf(stderr, "error: ");
vfprintf(stderr, Fmt, Args);
fprintf(stderr, "\n");
va_end(Args);
@@ -536,6 +536,7 @@ void CodeGen::compile(const std::vector<std::unique_ptr<StmtAST>> &Statements) {
}
if (verifyModule(*TheModule, &errs())) {
+ errs() << "fatal error: LLVM module verification failed\n";
HadError = true;
}
}
? Function::InternalLinkage : Function::ExternalLinkage, Sig.LinkName, &Module); Exceptions.prepareFunction(F); PrototypeLinks.emplace(Proto, Sig.LinkName); LinkIndex.emplace(Sig.LinkName, std::make_pair(Sig.Name, Overloads.size())); Overloads.push_back(std::move(Sig)); Function::arg_iterator AI = F->arg_begin(); if (!Proto->getOwnerClass().empty()) (AI++)->setName("this"); for (const ParamDecl &P : Proto->getParams()) { if (AI == F->arg_end()) break; (AI++)->setName(P.Name); for (int D = 1; P.IsArray && D <= P.Rank && AI != F->arg_end(); ++D) { (AI++)->setName(P.Name + kLowerBoundSuffix + std::to_string(D)); if (AI != F->arg_end()) (AI++)->setName(P.Name + kUpperBoundSuffix + std::to_string(D)); } } return F; } // The prototype names the exact C symbol; parameters and the result must be C // types. clang arranges the signature for the host C ABI. bool FunctionGen::emitExternPrototype(PrototypeAST *Proto) { if (PrototypeLinks.count(Proto)) return true; const std::string &Name = Proto->getName(); if (sameIdentifier(Name, "MAIN")) { reportError("MAIN cannot be declared EXTERN"); return false; } if (CodeGen::isBuiltinName(Name)) {