Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Object/XCOFFObjectFile.cpp
Show First 20 Lines • Show All 1,106 Lines • ▼ Show 20 Lines | |||||
bool XCOFFSymbolRef::isFunction() const { | bool XCOFFSymbolRef::isFunction() const { | ||||
if (!isCsectSymbol()) | if (!isCsectSymbol()) | ||||
return false; | return false; | ||||
if (getSymbolType() & FunctionSym) | if (getSymbolType() & FunctionSym) | ||||
return true; | return true; | ||||
Expected<XCOFFCsectAuxRef> ExpCsectAuxEnt = getXCOFFCsectAuxRef(); | Expected<XCOFFCsectAuxRef> ExpCsectAuxEnt = getXCOFFCsectAuxRef(); | ||||
if (!ExpCsectAuxEnt) | if (!ExpCsectAuxEnt) { | ||||
// If we could not get the CSECT auxiliary entry, then this symbol should | |||||
// not be a function. So consume the error and return `false` to move on. | |||||
jhenderson: Is "should" appropriate here? Is it never a function? Or is it potentially a function that we… | |||||
consumeError(ExpCsectAuxEnt.takeError()); | |||||
return false; | return false; | ||||
} | |||||
const XCOFFCsectAuxRef CsectAuxRef = ExpCsectAuxEnt.get(); | const XCOFFCsectAuxRef CsectAuxRef = ExpCsectAuxEnt.get(); | ||||
// A function definition should be a label definition. | // A function definition should be a label definition. | ||||
// FIXME: This is not necessarily the case when -ffunction-sections is | // FIXME: This is not necessarily the case when -ffunction-sections is | ||||
// enabled. | // enabled. | ||||
if (!CsectAuxRef.isLabel()) | if (!CsectAuxRef.isLabel()) | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 363 Lines • Show Last 20 Lines |
Is "should" appropriate here? Is it never a function? Or is it potentially a function that we can't identify? If the former, delete the word. If the latter, replace the phrase "then this symbol should not be a function" with "then treat this symbol as if it isn't a function".