mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
IR: MDNode => Value: AsmWriter SlotTracker API
Change `SlotTracker::CreateMetadataSlot()` and `SlotTracker::getMetadataSlot()` to use `Value` instead of `MDNode`. Part of PR21433. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -545,7 +545,7 @@ public:
|
|||||||
/// plane. If something is not in the SlotTracker, return -1.
|
/// plane. If something is not in the SlotTracker, return -1.
|
||||||
int getLocalSlot(const Value *V);
|
int getLocalSlot(const Value *V);
|
||||||
int getGlobalSlot(const GlobalValue *V);
|
int getGlobalSlot(const GlobalValue *V);
|
||||||
int getMetadataSlot(const MDNode *N);
|
int getMetadataSlot(const Value *MD);
|
||||||
int getAttributeGroupSlot(AttributeSet AS);
|
int getAttributeGroupSlot(AttributeSet AS);
|
||||||
|
|
||||||
/// If you'd like to deal with a function instead of just a module, use
|
/// If you'd like to deal with a function instead of just a module, use
|
||||||
@ -585,7 +585,7 @@ private:
|
|||||||
void CreateModuleSlot(const GlobalValue *V);
|
void CreateModuleSlot(const GlobalValue *V);
|
||||||
|
|
||||||
/// CreateMetadataSlot - Insert the specified MDNode* into the slot table.
|
/// CreateMetadataSlot - Insert the specified MDNode* into the slot table.
|
||||||
void CreateMetadataSlot(const MDNode *N);
|
void CreateMetadataSlot(const Value *MD);
|
||||||
|
|
||||||
/// CreateFunctionSlot - Insert the specified Value* into the slot table.
|
/// CreateFunctionSlot - Insert the specified Value* into the slot table.
|
||||||
void CreateFunctionSlot(const Value *V);
|
void CreateFunctionSlot(const Value *V);
|
||||||
@ -786,13 +786,13 @@ int SlotTracker::getGlobalSlot(const GlobalValue *V) {
|
|||||||
return MI == mMap.end() ? -1 : (int)MI->second;
|
return MI == mMap.end() ? -1 : (int)MI->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getMetadataSlot - Get the slot number of a MDNode.
|
/// getMetadataSlot - Get the slot number of a metadata node.
|
||||||
int SlotTracker::getMetadataSlot(const MDNode *N) {
|
int SlotTracker::getMetadataSlot(const Value *MD) {
|
||||||
// Check for uninitialized state and do lazy initialization.
|
// Check for uninitialized state and do lazy initialization.
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
// Find the MDNode in the module map
|
// Find the MDNode in the module map
|
||||||
mdn_iterator MI = mdnMap.find(N);
|
mdn_iterator MI = mdnMap.find(cast<MDNode>(MD));
|
||||||
return MI == mdnMap.end() ? -1 : (int)MI->second;
|
return MI == mdnMap.end() ? -1 : (int)MI->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -846,9 +846,10 @@ void SlotTracker::CreateFunctionSlot(const Value *V) {
|
|||||||
DestSlot << " [o]\n");
|
DestSlot << " [o]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CreateModuleSlot - Insert the specified MDNode* into the slot table.
|
/// CreateModuleSlot - Insert the specified metadata into the slot table.
|
||||||
void SlotTracker::CreateMetadataSlot(const MDNode *N) {
|
void SlotTracker::CreateMetadataSlot(const Value *MD) {
|
||||||
assert(N && "Can't insert a null Value into SlotTracker!");
|
assert(MD && "Can't insert a null Value into SlotTracker!");
|
||||||
|
const MDNode *N = cast<MDNode>(MD);
|
||||||
|
|
||||||
// Don't insert if N is a function-local metadata, these are always printed
|
// Don't insert if N is a function-local metadata, these are always printed
|
||||||
// inline.
|
// inline.
|
||||||
|
Reference in New Issue
Block a user