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

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 25 14:20:59 PDT 2018


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



More information about the llvm-dev mailing list