[llvm-commits] [llvm-gcc] static chain changes for PR1146

Reid Spencer rspencer at reidspencer.com
Sun May 6 03:07:25 PDT 2007


Duncan (or anyone else that knows):

I'm working on PR1146. It remove parameter attributes from function
types and places them on functions can call/invoke instructions.
Consequently, some changes are needed in llvm-gcc. One of those changes
I'm unsure about. In llvm-types.cpp, in the ConvertArgListToFnType
function, we have this pice of code:

  if (static_chain) {
    // Pass the static chain in a register.
    ParamAttrsVector Attrs;
    ParamAttrsWithIndex PAWI; PAWI.index = 1; PAWI.attrs =
ParamAttr::InReg;
    Attrs.push_back(PAWI);
    PAL = ParamAttrsList::get(Attrs);
  }

Obviously this needs to be deleted as a ParamAttrsList is not needed to
instantiate a FunctionType object.  The question is, where does this
need to be moved to. The static chain has something to do with nested
functions, right? So, do we need to move this "inreg" attribute to the
place where the call is actually made?  Where is that?

Reid.





More information about the llvm-commits mailing list