1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[llvm-nm] Yet another attempt of simplifying code.

llvm-svn: 260166
This commit is contained in:
Davide Italiano 2016-02-08 22:58:26 +00:00
parent 8fbb7931a3
commit 71895e096c

View File

@ -791,26 +791,20 @@ static char getSymbolNMTypeChar(MachOObjectFile &Obj, basic_symbol_iterator I) {
}
static char getSymbolNMTypeChar(const GlobalValue &GV) {
if (GV.getValueType()->isFunctionTy())
return 't';
// FIXME: should we print 'b'? At the IR level we cannot be sure if this
// will be in bss or not, but we could approximate.
return 'd';
return (GV.getValueType()->isFunctionTy()) ? 't' : 'd';
}
static char getSymbolNMTypeChar(IRObjectFile &Obj, basic_symbol_iterator I) {
const GlobalValue *GV = Obj.getSymbolGV(I->getRawDataRefImpl());
if (!GV)
return 't';
return getSymbolNMTypeChar(*GV);
return (!GV) ? 't' : getSymbolNMTypeChar(*GV);
}
static bool isObject(SymbolicFile &Obj, basic_symbol_iterator I) {
auto *ELF = dyn_cast<ELFObjectFileBase>(&Obj);
if (!ELF)
return false;
return elf_symbol_iterator(I)->getELFType() == ELF::STT_OBJECT;
return (!dyn_cast<ELFObjectFileBase>(&Obj))
? false
: elf_symbol_iterator(I)->getELFType() == ELF::STT_OBJECT;
}
static char getNMTypeChar(SymbolicFile &Obj, basic_symbol_iterator I) {