Hello everyone,<br><br>I am coding a ModulePass in which I want to add an AlwaysInline attribute to every function so that they can be later inlined by the -always-inline pass.  However, the changes to the function seem to be lost after exiting my pass because the AlwaysInline attribute is not in the output LLVM IR.<br>
<br>Maybe the function iterator passed by the module object actually points to copies of the functions?<br><br>Any help is much appreciated<br><br><br>Code<br>====<br>virtual bool runOnModule(Module& m)<br>{<br>    Module* module = &m;<br>
<br>    for (Module::iterator functionIter = module->begin(); functionIter != module->end(); functionIter++)<br>        functionIter->addFnAttr(llvm::Attributes::AlwaysInline);<br>    <br>    return true;<br>}<br>
<br><br>Command line<br>===========<br>clang -O0 -S -emit-llvm -o test.S test.c && opt -S -mem2reg -load <path to lib> -mypass < test.S > test_opt.S<br><br>