[llvm-dev] How to include a opt pass in clang driver

Soham Sinha via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 25 17:40:30 PDT 2018


Yeah it worked. Thank you so much! Correct command

clang output.c -o output -Xclang -load -Xclang lib/LLVMMyPass.so -mllvm
-myarguments

Regards,
Soham Sinha
PhD Student, Department of Computer Science
Boston University


On Mon, Jun 25, 2018 at 4:21 PM Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 6/25/2018 2:03 PM, Soham Sinha wrote:
> > Hi Eli,
> >
> > I have tried that:
> >
> > static void registerMyPass(const PassManagerBuilder &,
> > llvm::legacy::PassManagerBase &PM) {
> >        PM.add(new MyPass());
> > }
> >
> > static RegisterStandardPasses
> >     RegisterMyPass(PassManagerBuilder::EP_OptimizerLast,
> >                           registerMyPass);
>
> OptimizerLast doesn't run unless you turn on optimizations (-O2). Maybe
> that's the issue?
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180625/7771c90f/attachment.html>


More information about the llvm-dev mailing list