Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/ObjectYAML/ELFEmitter.cpp
Show First 20 Lines • Show All 933 Lines • ▼ Show 20 Lines | |||||
static bool shouldEmitDWARF(DWARFYAML::Data &DWARF, StringRef Name) { | static bool shouldEmitDWARF(DWARFYAML::Data &DWARF, StringRef Name) { | ||||
SetVector<StringRef> DebugSecNames = DWARF.getNonEmptySectionNames(); | SetVector<StringRef> DebugSecNames = DWARF.getNonEmptySectionNames(); | ||||
return Name.consume_front(".") && DebugSecNames.count(Name); | return Name.consume_front(".") && DebugSecNames.count(Name); | ||||
} | } | ||||
template <class ELFT> | template <class ELFT> | ||||
Expected<uint64_t> emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, | Expected<uint64_t> emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, | ||||
const DWARFYAML::Data &DWARF, | DWARFYAML::Data &DWARF, | ||||
ContiguousBlobAccumulator &CBA) { | ContiguousBlobAccumulator &CBA) { | ||||
// We are unable to predict the size of debug data, so we request to write 0 | // We are unable to predict the size of debug data, so we request to write 0 | ||||
// bytes. This should always return us an output stream unless CBA is already | // bytes. This should always return us an output stream unless CBA is already | ||||
// in an error state. | // in an error state. | ||||
raw_ostream *OS = CBA.getRawOS(0); | raw_ostream *OS = CBA.getRawOS(0); | ||||
if (!OS) | if (!OS) | ||||
return 0; | return 0; | ||||
▲ Show 20 Lines • Show All 957 Lines • Show Last 20 Lines |