Hi George,> When I compile llvm in release mode, the problem goes away! I don't understand?probably the function defined in the header is inlined into every function that calls it when optimization is turned on, but not when optimization is turned off. Ciao, Duncan.
Yes, the function is an inline function in PostDominators.h. In fact almost all the functions in the header are inlined. 00045 <http://llvm.org/doxygen/structllvm_1_1PostDominatorTree.html#a94e7209d35e2a344f6b3632330fe8502> inline DomTreeNode <http://llvm.org/doxygen/classllvm_1_1DomTreeNodeBase.html> *getRootNode <http://llvm.org/doxygen/structllvm_1_1PostDominatorTree.html#a94e7209d35e2a344f6b3632330fe8502>() const {00046 return DT <http://llvm.org/doxygen/structllvm_1_1PostDominatorTree.html#a0c34ac83dc77fc716cf0d104cb0ffe6a>->getRootNode <http://llvm.org/doxygen/classllvm_1_1DominatorTreeBase.html#a18bbbda9c8de124d37f05034f8307aa0>();00047 } I wonder how to go about making sure it is visible in debug mode. George On Tue, Aug 21, 2012 at 8:40 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi George, > > > When I compile llvm in release mode, the problem goes away! I don't > understand? > > probably the function defined in the header is inlined into every function > that > calls it when optimization is turned on, but not when optimization is > turned > off. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/5d3a5874/attachment.html>
On 08/21/2012 02:40 PM, Duncan Sands wrote:> Hi George, > >> When I compile llvm in release mode, the problem goes away! I don't understand? > > probably the function defined in the header is inlined into every function that > calls it when optimization is turned on, but not when optimization is turned > off.You can try to add it into include/llvm/LinkAllPasses.h. There are already a couple of other functions that have been put here to not be eliminated. BTW, is there no better way to mark a function as used externally? Tobi
All the functions in LinkAllPasses.h are passes. I am not sure whether it takes inline functions. I added createPostDomTree() to LinkAllPasses.h but I get the same error. I wonder whether it was even worth it making the functions inline for PostDominators.h. George On Tue, Aug 21, 2012 at 9:05 AM, Tobias Grosser <tobias at grosser.es> wrote:> On 08/21/2012 02:40 PM, Duncan Sands wrote: > > Hi George, > > > >> When I compile llvm in release mode, the problem goes away! I don't > understand? > > > > probably the function defined in the header is inlined into every > function that > > calls it when optimization is turned on, but not when optimization is > turned > > off. > > You can try to add it into include/llvm/LinkAllPasses.h. There are > already a couple of other functions that have been put here to not be > eliminated. > > BTW, is there no better way to mark a function as used externally? > > Tobi > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/21ed6768/attachment.html>