[LLVMdev] Any way to use a pass in opt, that does not have normal constructor?

Dmitry N. Mikushin maemarcus at gmail.com
Thu Jun 28 16:37:18 PDT 2012


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.



More information about the llvm-dev mailing list