[llvm-commits] [llvm-gcc-4.2] r55718 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Devang Patel
dpatel at apple.com
Mon Sep 22 11:21:48 PDT 2008
On Sep 21, 2008, at 8:43 PM, Chris Lattner wrote:
>> + else {
>> + // The inliner pass won't be inserted based on command line
>> options.
>> + // Use AlwaysInliner to handle functions that are marked as
>> always_inline.
>> + bool NeedAlwaysInliner = false;
>> + for (Module::iterator I = TheModule->begin(), E = TheModule-
>> >end();
>> + I != E; ++I)
>> + if (!I->isDeclaration() && I->getNotes() ==
>> FN_NOTE_AlwaysInline) {
>> + NeedAlwaysInliner = true;
>> + break;
>> + }
>> + if (NeedAlwaysInliner)
>> + PM->add(createAlwaysInlinerPass());
>
> Please don't do this loop here, just unconditionally add it to the
> passmgr. Is there some advantage to checking here (in llvmgcc)
> rather than in the pass itself?
Only one advantage is a small convenience to llvm developers. When we
are using -analyze or -print or intentionally running selected pass
for debugging/testing then you do not want PassManager to annoy you.
This is not a big deal, and I do not see any advantage for end users.
-
Devang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080922/f42cf77f/attachment.html>
More information about the llvm-commits
mailing list