[LLVMdev] LangRef/implementation inconsistency: What is the intended constraint on function return types?

Sean Silva silvas at purdue.edu
Tue Mar 5 16:55:11 PST 2013


PR15447 <http://llvm.org/bugs/show_bug.cgi?id=15447> brings up that
there is an inconsistency both within LangRef and between LangRef and
the implementation regarding what is an allowed return type.

LangRef says:

"The return type of a function type is a first class type or a void type."
<http://llvm.org/docs/LangRef.html#id14>

and also, contrarily,

"<returntype>‘ is any type except label."
<http://llvm.org/docs/LangRef.html#id15>

On the other hand, the actual implementation of
FunctionType::isValidReturnType opines that:

bool FunctionType::isValidReturnType(Type *RetTy) {
  return !RetTy->isFunctionTy() && !RetTy->isLabelTy() &&
  !RetTy->isMetadataTy();
}


These definitions are mutually incompatible. What is the intended definition?

-- Sean Silva




More information about the llvm-dev mailing list