Gonsolo
2010-Mar-25 14:54 UTC
[LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
Hi. I had some problems with MI too. See bug 6251. g Am 25.03.2010 um 16:18 schrieb John Criswell <criswell at uiuc.edu>:> Dear All, > > I'm currently upgrading SAFECode to the LLVM 2.7 API. I'm getting > some > strange errors in LLVM Passes that use analysis groups and multiple > inheritance. > > To create analysis groups in LLVM 2.6, I would first create a base > class > for the analysis group and then another class that inherited from both > ModulePass and the analysis group base class. That worked in LLVM > 2.6, > but now in LLVM 2.7 I'm getting strange behavior. In particular, I'm > seeing the wrong functions called when virtual methods of my passes > are > called. For example, when a SAFECode pass would call the getDSGraph() > method of the PoolAllocateSimple pass, the releaseMemory() method > would > be called instead. > > Has anyone else seen this really bizarre behavior or know what might > be > causing it? Eliminating multiple inheritance seems to fix the > problem, > but it seems to introduce other problems when chaining analysis passes > of the same group together. > > I see this behavior both on Mac OS X and Linux. > > -- John T. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
John Criswell
2010-Mar-25 15:18 UTC
[LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
Dear All, I'm currently upgrading SAFECode to the LLVM 2.7 API. I'm getting some strange errors in LLVM Passes that use analysis groups and multiple inheritance. To create analysis groups in LLVM 2.6, I would first create a base class for the analysis group and then another class that inherited from both ModulePass and the analysis group base class. That worked in LLVM 2.6, but now in LLVM 2.7 I'm getting strange behavior. In particular, I'm seeing the wrong functions called when virtual methods of my passes are called. For example, when a SAFECode pass would call the getDSGraph() method of the PoolAllocateSimple pass, the releaseMemory() method would be called instead. Has anyone else seen this really bizarre behavior or know what might be causing it? Eliminating multiple inheritance seems to fix the problem, but it seems to introduce other problems when chaining analysis passes of the same group together. I see this behavior both on Mac OS X and Linux. -- John T.
John Criswell
2010-Mar-25 16:00 UTC
[LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
Gonsolo wrote:> Hi. > > I had some problems with MI too. See bug 6251. >I'm not sure if our issues are the same. To clarify, I'm not seeing LLVM miscompile programs that use multiple inheritance. Instead, the LLVM passes that I write and link with LLVM are exhibiting strange behavior when they are written using multiple inheritance. It is almost as if GCC itself is miscompiling my code. Hrm. Perhaps that is the problem. I will investigate; I may be using a broken version of GCC to compile LLVM. -- John T.> g > > Am 25.03.2010 um 16:18 schrieb John Criswell <criswell at uiuc.edu>: > > >> Dear All, >> >> I'm currently upgrading SAFECode to the LLVM 2.7 API. I'm getting >> some >> strange errors in LLVM Passes that use analysis groups and multiple >> inheritance. >> >> To create analysis groups in LLVM 2.6, I would first create a base >> class >> for the analysis group and then another class that inherited from both >> ModulePass and the analysis group base class. That worked in LLVM >> 2.6, >> but now in LLVM 2.7 I'm getting strange behavior. In particular, I'm >> seeing the wrong functions called when virtual methods of my passes >> are >> called. For example, when a SAFECode pass would call the getDSGraph() >> method of the PoolAllocateSimple pass, the releaseMemory() method >> would >> be called instead. >> >> Has anyone else seen this really bizarre behavior or know what might >> be >> causing it? Eliminating multiple inheritance seems to fix the >> problem, >> but it seems to introduce other problems when chaining analysis passes >> of the same group together. >> >> I see this behavior both on Mac OS X and Linux. >> >> -- John T. >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>
Chris Lattner
2010-Mar-25 16:33 UTC
[LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
On Mar 25, 2010, at 8:18 AM, John Criswell wrote:> Dear All, > > I'm currently upgrading SAFECode to the LLVM 2.7 API. I'm getting some > strange errors in LLVM Passes that use analysis groups and multiple > inheritance.Hey John, This is almost certainly due to the "eliminate rtti" work. You probably need to implement "getAdjustedAnalysisPointer" methods in your passes, see BasicAliasAnalysis or BasicCallGraph as examples. -Chris> > To create analysis groups in LLVM 2.6, I would first create a base class > for the analysis group and then another class that inherited from both > ModulePass and the analysis group base class. That worked in LLVM 2.6, > but now in LLVM 2.7 I'm getting strange behavior. In particular, I'm > seeing the wrong functions called when virtual methods of my passes are > called. For example, when a SAFECode pass would call the getDSGraph() > method of the PoolAllocateSimple pass, the releaseMemory() method would > be called instead. > > Has anyone else seen this really bizarre behavior or know what might be > causing it? Eliminating multiple inheritance seems to fix the problem, > but it seems to introduce other problems when chaining analysis passes > of the same group together. > > I see this behavior both on Mac OS X and Linux. > > -- John T. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
John Criswell
2010-Mar-25 17:07 UTC
[LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
Chris Lattner wrote:> On Mar 25, 2010, at 8:18 AM, John Criswell wrote: > > >> Dear All, >> >> I'm currently upgrading SAFECode to the LLVM 2.7 API. I'm getting some >> strange errors in LLVM Passes that use analysis groups and multiple >> inheritance. >> > > Hey John, > > This is almost certainly due to the "eliminate rtti" work. You probably need to implement "getAdjustedAnalysisPointer" methods in your passes, see BasicAliasAnalysis or BasicCallGraph as examples. >Thanks! That seems to have done the trick. -- John T.
Maybe Matching Threads
- [LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
- [LLVMdev] Strange Multiple Inheritance Errors Using LLVM 2.7
- [LLVMdev] Segmentation Fault of BasicCallGraph?
- [LLVMdev] Segmentation Fault of BasicCallGraph?
- [LLVMdev] AliasAnalysis as a Loadable Module, Possible 2.6->2.7 issue