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:
13
type.cpp
13
type.cpp
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user