search for: staticinitializer

Displaying 11 results from an estimated 11 matches for "staticinitializer".

2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
...namespace llvm { void initializeHelloPass(llvm::PassRegistry&); } INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) class StaticInitializer { public: StaticInitializer() { PassRegistry &Registry = *PassRegistry::getPassRegistry(); initializeHelloPass(Registry); } }; static StaticInitializer InitializeEverything; Thanks again On Tue, Nov 8, 2011 at 10:18 AM, Tobias Grosser <tobias at grosser.es> wrote: > On 11/08/2...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
On 11/08/2011 03:40 PM, ret val wrote: > I'm confused by your code. StaticInitializer seems to exist so you can > create InitializeEverything, which doesn't get used. > > Do I need to do something along the lines of: > static void registerPollyPasses(const llvm::PassManagerBuilder&Builder, > llvm::PassManagerBa...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
I'm confused by your code. StaticInitializer seems to exist so you can create InitializeEverything, which doesn't get used. Do I need to do something along the lines of: static void registerPollyPasses(const llvm::PassManagerBuilder &Builder, llvm::PassManagerBase &PM) { PM...
2011 Nov 08
4
[LLVMdev] loadable passes with dependencies?
...lvm::PassRegistry&); } >> INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) >> INITIALIZE_PASS_DEPENDENCY(DominatorTree) >> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) >> >> class StaticInitializer { >> public: >>        StaticInitializer() { >>                PassRegistry&Registry = *PassRegistry::getPassRegistry(); >>                initializeHelloPass(Registry); >>        } >> }; >> >> static StaticInitializer InitializeEverything; > &...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...nitializeHelloPass(llvm::PassRegistry&); } > INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) > INITIALIZE_PASS_DEPENDENCY(DominatorTree) > INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) > > class StaticInitializer { > public: > StaticInitializer() { > PassRegistry&Registry = *PassRegistry::getPassRegistry(); > initializeHelloPass(Registry); > } > }; > > static StaticInitializer InitializeEverything; Looks good to me. Are you sure you call getAnalysis only for the Dominator...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
...INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) >> >> INITIALIZE_PASS_DEPENDENCY(DominatorTree) >> >> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) >> >> >> >> class StaticInitializer { >> >> public: >> >>        StaticInitializer() { >> >>                PassRegistry&Registry = >> >> *PassRegistry::getPassRegistry(); >> >>                initializeHelloPass(Registry); >> >>        } >> >> };...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...} > >> INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) > >> INITIALIZE_PASS_DEPENDENCY(DominatorTree) > >> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) > >> > >> class StaticInitializer { > >> public: > >> StaticInitializer() { > >> PassRegistry&Registry = *PassRegistry::getPassRegistry(); > >> initializeHelloPass(Registry); > >> } > >> }; > >> > >> static Static...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...ASS_BEGIN(Hello, "hello", "Hello World Pass", false, true) >>>>> INITIALIZE_PASS_DEPENDENCY(DominatorTree) >>>>> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) >>>>> >>>>> class StaticInitializer { >>>>> public: >>>>> StaticInitializer() { >>>>> PassRegistry&Registry = >>>>> *PassRegistry::getPassRegistry(); >>>>> initializeHelloPass(Registry); >>>>>...
2011 Nov 09
1
[LLVMdev] loadable passes with dependencies?
..."hello", "Hello World Pass", false, true) >>>>>> INITIALIZE_PASS_DEPENDENCY(DominatorTree) >>>>>> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) >>>>>> >>>>>> class StaticInitializer { >>>>>> public: >>>>>>        StaticInitializer() { >>>>>>                PassRegistry&Registry = >>>>>> *PassRegistry::getPassRegistry(); >>>>>>                initializeHelloPass(Registry); >>>...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...er or find anything trying todo > the same. > > How should this be done? Hi, you can have a look at the approach taken in Polly [1]. Here the relevant file in the git repository: http://repo.or.cz/w/polly-mirror.git/blob/HEAD:/lib/RegisterPasses.cpp Basically we created a class polly::StaticInitializer which initializes in its constructor all passes in the external library (in our case Polly). To make sure the constructor is called when loading the library, we create a global instance of the static initializer. I am not sure if this is the recommended way, but at least it works for us. If the...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
I'm writing a Pass that I would like to remain loadable by opt. The pass also requires DominatorTree(for PromoteMemToReg). Looking for examples the only way I found to require a dependecny is by doing something like this: char Hello::ID = 0; namespace llvm { void initializeHelloPass(llvm::PassRegistry&); } INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello