forked from OSchip/llvm-project
Don't copy the .drective section with std::string
Both COFF and bitcode input files expose these as stable strings. llvm-svn: 357314
This commit is contained in:
parent
6f8251fb38
commit
ba708619ad
|
@ -172,7 +172,7 @@ SectionChunk *ObjFile::readSection(uint32_t SectionNumber,
|
|||
if (Name == ".drectve") {
|
||||
ArrayRef<uint8_t> Data;
|
||||
COFFObj->getSectionContents(Sec, Data);
|
||||
Directives = std::string((const char *)Data.data(), Data.size());
|
||||
Directives = StringRef((const char *)Data.data(), Data.size());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,12 +74,12 @@ public:
|
|||
StringRef ParentName;
|
||||
|
||||
// Returns .drectve section contents if exist.
|
||||
StringRef getDirectives() { return StringRef(Directives).trim(); }
|
||||
StringRef getDirectives() { return Directives; }
|
||||
|
||||
protected:
|
||||
InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}
|
||||
|
||||
std::string Directives;
|
||||
StringRef Directives;
|
||||
|
||||
private:
|
||||
const Kind FileKind;
|
||||
|
|
Loading…
Reference in New Issue