Can someone explain how RegisterPass and RegisterAnalysisGroup conspire to pick the right member of an analysis group when command-line options dictate non-default implementations? For example, when I pass -anders-aa to opt, where in the code is that option parsed and setNormalCtor called on the analysis group to change from the default basicaa? -Dave
On Sep 14, 2007, at 1:43 PM, David Greene wrote:> Can someone explain how RegisterPass and RegisterAnalysisGroup > conspire to pick the right member of an analysis group when command- > line > options dictate non-default implementations? > > For example, when I pass -anders-aa to opt, where in the code is > that option > parsed and setNormalCtor called on the analysis group to change > from the > default basicaa?When basicaa registers itself as part of the analysis group, it uses: RegisterPass<BasicAliasAnalysis> X("basicaa", "Basic Alias Analysis (default AA impl)"); // Declare that we implement the AliasAnalysis interface RegisterAnalysisGroup<AliasAnalysis, true> Y(X); The "true" says that it is the default, -Chris
On Friday 14 September 2007 15:51, Chris Lattner wrote:> When basicaa registers itself as part of the analysis group, it uses: > > RegisterPass<BasicAliasAnalysis> > X("basicaa", "Basic Alias Analysis (default AA impl)"); > > // Declare that we implement the AliasAnalysis interface > RegisterAnalysisGroup<AliasAnalysis, true> Y(X); > > The "true" says that it is the default,Right, I get that. My question is how a pass that requires AliasAnalysis gets Andersens when -anders-aa is passed on the command-line. Someone has to call setNormalCtor on the PassInfo for the AliasAnalysis group but I can't fgind that code anywhere. Another question: I'm debugging some analysis group code and I instrumented the registration constructors. I see weird things like this: Adding No Alias Analysis (always returns 'may' alias) to group Adding Basic Alias Analysis (default AA impl) to group Set ctor for Adding AA use debugger to group Adding Count Alias Analysis Query Responses to group Registering analysis group Alias Analysis Huh? How can group members be registered before the group is? How does that work? When I added a new coalescer to the compiler and tried to use it, I got SimpleRegisterCoalescing (the default) instead. I'm trying to figure out why. -Dave