[llvm-commits] jit failures due to attributes changes

Chris Lattner clattner at apple.com
Sat Nov 24 11:17:35 PST 2007


I think all of my breakage is resolved, however, the attribuets  
changes introduced a number of jit regressions.  The problem is that  
"exit" is now getting declared as:

declare void @exit(i32) noreturn nounwind

This is a problem for lli.cpp, because it does this:

   Constant *Exit = Mod->getOrInsertFunction("exit", Type::VoidTy,
                                                          
Type::Int32Ty, NULL);
  ...
   if (Function *ExitF = dyn_cast<Function>(Exit)) {
  ...
   } else {
     std::cerr << "ERROR: exit defined with wrong prototype!\n";
     abort();



The problem here is that getOrInsertFunction is returning a bitcast of  
the exit function (with the type above) to a void(int)* type.

I think that getOrInsertFunction should just return the function (not  
a bitcast) if the function type other than the attributes are the same.

-Chris



More information about the llvm-commits mailing list