Improve error message about incompatible function types.

When reporting that a function has illegally been overloaded only
by return type, include "task", "export", and "extern "C"", as appropriate
in the error message to make clear what the issue is.

Finishes issue #216.
This commit is contained in:
Matt Pharr
2012-04-03 05:43:23 -07:00
parent dc09d46bf4
commit 920cf63201
3 changed files with 21 additions and 3 deletions

View File

@@ -2552,6 +2552,19 @@ FunctionType::GetDIType(llvm::DIDescriptor scope) const {
}
const std::string
FunctionType::GetReturnTypeString() const {
std::string ret;
if (isTask)
ret += "task ";
if (isExported)
ret += "export ";
if (isExternC)
ret += "extern \"C\" ";
return ret + returnType->GetString();
}
LLVM_TYPE_CONST llvm::FunctionType *
FunctionType::LLVMFunctionType(llvm::LLVMContext *ctx, bool includeMask) const {
if (isTask == true)