Both COFF and bitcode input files expose these as stable strings.
llvm-svn: 357314
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;
}
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;