Displaying 6 results from an estimated 6 matches for "addmetadata".
2011 Nov 20
2
[LLVMdev] How can I output assembly comments from emitPrologue()?
...ructions.
4. Update AsmPrinter to read off the metadata and output it as an
assembly comment.
Is this the only (and correct) way to do this?
If so, I am having trouble attaching the MDString to an instruction. I am
using BuildMI to create my instruction, which only seems to have an
"addMetadata()" function rather than "setMetadata()", and which takes an
MDNode instead of an MDString. I attempted to do this as follows:
void XXXFrameLowering::emitPrologue(MachineFunction &MF) const {
...
Value* end_prologue_comment = MDString::get(getGlobalContext(), "end of
prolo...
2011 Nov 20
0
[LLVMdev] How can I output assembly comments from emitPrologue()?
...perand(0))->getString();
break;
...
}
4. Finally, whenever I needed to emit comments I call the following:
MDNode* comment =
MDNode::get(getGlobalContext(),
ArrayRef<Value*>(MDString::get(getGlobalContext(),
"COMMENT HERE")));
BuildMI(MBB, MBBI, dl, TII.get(XXX::COMMENT)).addMetadata(comment);
So, this seems to work, although it will create an empty instruction (I
think). That could probably be cleaned up before MC emission, but I would
really just remove the comments anyway. Any suggestions on a better way to
do this (or a pointer to some obvious existing solution!) welcome...
2014 Apr 17
2
[LLVMdev] adding comment
On 04/17/2014 09:30 AM, Matt Arsenault wrote:
>
> On Apr 16, 2014, at 2:06 PM, reed kotler <rkotler at mips.com> wrote:
>
>> Is there a simple way to add a comment in the machine instructions of a basic block?
>>
>> Ideally something that can be used with machine instruction builder.
>>
>
> I’ve also been looking for something like this. I’m trying to
2011 Nov 21
0
[LLVMdev] How to get ELF section virtual starting address from MCSymbolRefExpr?
...ructions.
4. Update AsmPrinter to read off the metadata and output it as an
assembly comment.
Is this the only (and correct) way to do this?
If so, I am having trouble attaching the MDString to an instruction. I am
using BuildMI to create my instruction, which only seems to have an
"addMetadata()" function rather than "setMetadata()", and which takes an
MDNode instead of an MDString. I attempted to do this as follows:
void XXXFrameLowering::emitPrologue(MachineFunction &MF) const {
...
Value* end_prologue_comment = MDString::get(getGlobalContext(), "end of
prolo...
2010 Oct 26
0
[LLVMdev] Prevent instruction elimination
On Oct 26, 2010, at 9:23 AM, Xinfinity wrote:
>
> Hello,
>
>
> Devang Patel wrote:
>>
>>
>> On Oct 25, 2010, at 12:09 PM, Xinfinity wrote:
>>
>>> #pragma my_pragma{
>>> code
>>> }
>>
>>> I use a map
>>> (source_location, pragma) and I insert the dummy instruction when this
>>> location is
2010 Oct 26
2
[LLVMdev] Prevent instruction elimination
Hello,
Devang Patel wrote:
>
>
> On Oct 25, 2010, at 12:09 PM, Xinfinity wrote:
>
>> #pragma my_pragma{
>> code
>> }
>
>> I use a map
>> (source_location, pragma) and I insert the dummy instruction when this
>> location is reached in the code generator. It seems difficult to attach
>> the
>> metadata to the first and the last