[LLVMdev] Need guidance regarding MachineFunctionPass

sachin arora sachin345678 at gmail.com
Sat Oct 11 13:50:08 PDT 2014

Hello Mr. Tim,

Thanks to you and others from 'llvmdev-list', I have successfully
implemented the MachineFunctionPass. But when I examine the output using
'hexedit' I see that only some portion of the .text section is effected by
my pass. I was expecting the pass to modify large portion of the .text
section. Kindly tell me if a MachineFunctionPass runs only on some selected
portions of the .text section. Is there a way to make it run on larger
portion of the .text section?
The skeleton of my code is:

*bool MyPass::runOnMachineFunction(MachineFunction &FNC)for
(MachineFunction::iterator MFN = FNC.begin(), End = FNC.end(); MFN != End;
++MFN)     for (MachineBasicBlock::iterator I = MFN->begin(); I !=
MFN->end(); )     {         MachineBasicBlock::iterator NewI =
std::next(I);        **Do the Stuff*

*        I = NewI;    } *

On Wed, Oct 8, 2014 at 12:24 PM, sachin arora <sachin345678 at gmail.com>

> Awesome. Thanks a lot :)
> On Wed, Oct 8, 2014 at 12:23 PM, Tim Northover <t.p.northover at gmail.com>
> wrote:
>> On 8 October 2014 10:18, sachin arora <sachin345678 at gmail.com> wrote:
>> > Thank you Mr. Tim. I was wondering if you can tell me in which file
>> 'get()'
>> > is defined. I am having trouble using this function. For example if I
>> write
>> > 'get(AArch64::LDRXui)' then there is an error generated which says: use
>> of
>> > undeclared identifier 'get'.
>> It's defined in the MCInstrInfo class, usually accessed via a
>> TargetInstrInfo instance (so you often see "TII.get(Whatever)" if it's
>> used outside a TargetInstrInfo subclass).
>> Cheers.
>> Tim.
> --
> Regards,
> Sachin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141011/e5d6b3f8/attachment.html>

More information about the llvm-dev mailing list