[llvm-commits] [llvm] r73646 - /llvm/trunk/include/llvm/Support/IRBuilder.h

Anton Korobeynikov anton at korobeynikov.info
Thu Jun 18 01:10:08 PDT 2009


Hi Chris

> Anton, why isn't the caller and callee already getting the right
> calling conv?  This seems like the wrong fix,
We have separate calling conv fields on, for example, Function and
CallInst. That's why API user should put correct calling conv on
CallInst during creation of such (see, for example,
SimplifyCFGPass.cpp:ChangeToCall). By default CI's are created with C
calling conv and in general we'll have calling conv mismatch between
caller and callee if API user won't tune the calling conv of CI.

SimplifyLibCalls pass uses IRBuilder to insert calls to strlen &
friends. They can be already defined in the module with non-C calling
convention, thus we need to put the same calling conv on CI also. I
thought it's much safer to let IRBuilder to do this by default instead
of letting each user to do this explicitly. Also, since custom CCs are
not so frequent stuff, possible bugs due to CC mismatch might be
pretty tricky to catch of we'll delegate tweaking of CC to API user.

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




More information about the llvm-commits mailing list