Accessing slot numbers of unnamed instructions (SlotTracker)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing slot numbers of unnamed instructions (SlotTracker)

Florian Merz-3
Hey everyone,

I'm currently trying to figure out a method for providing a unique
identification of an llvm::Instruction that is consistent with the output of an
AssemblyWriter. Obviously this is easy for named instructions: In this case
the identification is the name itself, but I'd like to have the same thing for
unnamed instructions.

If I understand the code in AssemblyWriter.cpp correctly, AssemblyWriter uses
SlotTracker to keep track of the numbers used for unnamed instructions.
Unfortunately for me SlotTracker is missing from LLVM's public header files. Is
there any other way to retrieve a slot number for an Instruction that is
consistent with the numbers assigned by an existing AssemblyWriter instance.

Best regards,
 Florian Merz

--
Karlsruhe Institute of Technology (KIT)
Institute for Theoretical Computer Science

Dipl.-Inform. Florian Merz
Researcher

Am Fasanengarten 5
Building 50.34
76131 Karlsruhe, Germany

Phone: +49 721 608-45955
Fax: +49 721 608-44211
Email: [hidden email]
Web: http://verialg.iti.kit.edu/ 

KIT - University of the State of Baden-Wuerttemberg and
National Research Center of the Helmholtz Association
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Accessing slot numbers of unnamed instructions (SlotTracker)

Duncan Sands
Hi Florian,

> I'm currently trying to figure out a method for providing a unique
> identification of an llvm::Instruction that is consistent with the output of an
> AssemblyWriter. Obviously this is easy for named instructions: In this case
> the identification is the name itself, but I'd like to have the same thing for
> unnamed instructions.
>
> If I understand the code in AssemblyWriter.cpp correctly, AssemblyWriter uses
> SlotTracker to keep track of the numbers used for unnamed instructions.
> Unfortunately for me SlotTracker is missing from LLVM's public header files. Is
> there any other way to retrieve a slot number for an Instruction that is
> consistent with the numbers assigned by an existing AssemblyWriter instance.

why do you want this?  The short answer is that these numbers are only available
in the AssemblyWriter, so you would either have to duplicate the logic that it
uses, or put some kind of hook in AssemblyWriter.

Ciao, Duncan.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev