mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-30 18:28:39 +00:00
reimplement Constant::ContainsRelocations as
Constant::getRelocationInfo(), which has a much simpler to use API. It still should not be part of libvmcore, but is better than it was. Also teach it to be smart about hidden visibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76700 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -547,19 +547,7 @@ const Type *MachineConstantPoolEntry::getType() const {
|
||||
unsigned MachineConstantPoolEntry::getRelocationInfo() const {
|
||||
if (isMachineConstantPoolEntry())
|
||||
return Val.MachineCPVal->getRelocationInfo();
|
||||
|
||||
// FIXME: This API sucks.
|
||||
|
||||
// If no relocations, return 0.
|
||||
if (!Val.ConstVal->ContainsRelocations())
|
||||
return 0;
|
||||
|
||||
// If it contains no global relocations, return 1.
|
||||
if (!Val.ConstVal->ContainsRelocations(Reloc::Global))
|
||||
return 1;
|
||||
|
||||
// Otherwise, it has general relocations.
|
||||
return 2;
|
||||
return Val.ConstVal->getRelocationInfo();
|
||||
}
|
||||
|
||||
MachineConstantPool::~MachineConstantPool() {
|
||||
|
Reference in New Issue
Block a user