IR: Expose the method 'getLocalSlot' in the module slot tracker.

This commit publicly exposes the method 'getLocalSlot' in the
'ModuleSlotTracker' class.

This change is useful for MIR serialization, to serialize the unnamed basic
block and unnamed alloca references.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-07-27 22:31:04 +00:00
parent 10da90aaf3
commit 9adb2129bd
3 changed files with 73 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ namespace llvm {
class Module;
class Function;
class SlotTracker;
class Value;
/// Manage lifetime of a slot tracker for printing IR.
///
@@ -61,6 +62,13 @@ public:
/// Purge the currently incorporated function and incorporate \c F. If \c F
/// is currently incorporated, this is a no-op.
void incorporateFunction(const Function &F);
/// Return the slot number of the specified local value.
///
/// A function that defines this value should be incorporated prior to calling
/// this method.
/// Return -1 if the value is not in the function's SlotTracker.
int getLocalSlot(const Value *V);
};
} // end namespace llvm