florian.merz at kit.edu
2013-Jun-04 15:33 UTC
[LLVMdev] Accessing slot numbers of unnamed instructions (SlotTracker)
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: florian.merz at kit.edu Web: http://verialg.iti.kit.edu/ KIT - University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association
Duncan Sands
2013-Jun-05 07:29 UTC
[LLVMdev] Accessing slot numbers of unnamed instructions (SlotTracker)
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.