Dmitry N. Mikushin
2012-Jun-28 23:01 UTC
[LLVMdev] Any way to use a pass in opt, that does not have normal constructor?
Dear LLVM, The TargetData pass needs target data layout to be specified in constructor, and therefore its normal ctor is defined, but always gives a fatal error. Still, is there any way to make it loadable into the opt tool? I need this to make use of bugpoint in reducing backend test case. Thanks, - Dima.
Dmitry N. Mikushin
2012-Jun-28 23:37 UTC
[LLVMdev] Any way to use a pass in opt, that does not have normal constructor?
Ah, OK, opt always creates add adds TargetData. So, we can simply ignore its explicit inclusion: --- a/llvm/tools/opt/opt.cpp (revision 156703) +++ b/llvm/tools/opt/opt.cpp (working copy) @@ -632,6 +632,8 @@ } const PassInfo *PassInf = PassList[i]; + if (PassInf->isPassID(TD->getPassID())) + continue; Pass *P = 0; if (PassInf->getNormalCtor()) P = PassInf->getNormalCtor()(); 2012/6/29 Dmitry N. Mikushin <maemarcus at gmail.com>:> Dear LLVM, > > The TargetData pass needs target data layout to be specified in > constructor, and therefore its normal ctor is defined, but always > gives a fatal error. > Still, is there any way to make it loadable into the opt tool? I need > this to make use of bugpoint in reducing backend test case. > > Thanks, > - Dima.