[LLVMdev] Patch: MSIL backend global pointers initialization

Anton Korobeynikov anton at korobeynikov.info
Tue Apr 7 06:48:50 PDT 2009


Artur,

> OK, I just need the same signature for both of those instructions.
Both are callinsts of same function, isn't that enough? Since it's a
variadic function there is also a bitcast to proper type. So, looking
for type of callee (not result, but function type!) you'll obtain the
real "signature" of callee and if you'll strip all pointer cast you'll
obtain the "declaration" (=variadic) type of the callee. This should
be enough for almost all purposes. You should not try to invent some
custom "comparison schemes", almost surely in such situation you're
reinventing the wheel :)

>   if (A->getType()->getTypeID() != B->getType()->getTypeID()) return false;
TypeID is internal thing for type. All types are unique inside LLVM,
so you should just compare Type*'s.

>     if (A->getOperand(i)->getType()->getTypeID()
>       != B->getOperand(i)->getType()->getTypeID()) return false;
Same here.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-dev mailing list