1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Fix GSYM tests to run the yaml files and fix test failures on some machines.

YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Fixed memory sanitizer bot bugs as well.

Differential Revision: https://reviews.llvm.org/D75390
This commit is contained in:
Greg Clayton 2020-03-04 19:12:08 -08:00
parent 0a487e92a9
commit 990fd897af
7 changed files with 15 additions and 4 deletions

View File

@ -74,7 +74,7 @@ llvm::Error GsymCreator::encode(FileWriter &O) const {
Hdr.BaseAddress = MinAddr;
Hdr.NumAddresses = static_cast<uint32_t>(Funcs.size());
Hdr.StrtabOffset = 0; // We will fix this up later.
Hdr.StrtabOffset = 0; // We will fix this up later.
Hdr.StrtabSize = 0; // We will fix this up later.
memset(Hdr.UUID, 0, sizeof(Hdr.UUID));
if (UUID.size() > sizeof(Hdr.UUID))
return createStringError(std::errc::invalid_argument,

View File

@ -0,0 +1,4 @@
if not ('ARM' in config.root.targets and 'AArch64' in config.root.targets):
config.unsupported = True
config.suffixes = ['.test', '.yaml']

View File

@ -0,0 +1,4 @@
if not 'X86' in config.root.targets:
config.unsupported = True
config.suffixes = ['.test', '.yaml']

View File

@ -179,7 +179,8 @@ static bool filterArch(MachOObjectFile &Obj) {
if (ArchFilters.empty())
return true;
StringRef ObjArch = Obj.getArchTriple().getArchName();
Triple ObjTriple(Obj.getArchTriple());
StringRef ObjArch = ObjTriple.getArchName();
for (auto Arch : ArchFilters) {
// Match name.
@ -350,7 +351,8 @@ static llvm::Error handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
error(Filename, errorToErrorCode(BinOrErr.takeError()));
if (auto *Obj = dyn_cast<ObjectFile>(BinOrErr->get())) {
auto ArchName = Obj->makeTriple().getArchName();
Triple ObjTriple(Obj->makeTriple());
auto ArchName = ObjTriple.getArchName();
outs() << "Output file (" << ArchName << "): " << OutFile << "\n";
if (auto Err = handleObjectFile(*Obj, OutFile.c_str()))
return Err;
@ -374,7 +376,8 @@ static llvm::Error handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
// Now handle each architecture we need to convert.
for (auto &Obj: FilterObjs) {
auto ArchName = Obj->getArchTriple().getArchName();
Triple ObjTriple(Obj->getArchTriple());
auto ArchName = ObjTriple.getArchName();
std::string ArchOutFile(OutFile);
// If we are only handling a single architecture, then we will use the
// normal output file. If we are handling multiple architectures append