AMDGPU/NFC: Minor clean ups in PAL metadata

- Move PAL metadata definitions to AMDGPUMetadata
  - Make naming consistent with HSA metadata

Differential Revision: https://reviews.llvm.org/D38745


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Konstantin Zhuravlyov
2017-10-11 22:41:09 +00:00
parent 44bc30dd6d
commit 257828766c
16 changed files with 146 additions and 99 deletions
+15
View File
@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/Twine.h"
#include "llvm/Support/AMDGPUMetadata.h"
#include "llvm/Support/YAMLTraits.h"
@@ -213,5 +214,19 @@ std::error_code Metadata::toYamlString(
}
} // end namespace HSAMD
namespace PALMD {
std::error_code toString(const Metadata &PALMetadata, std::string &String) {
raw_string_ostream Stream(String);
for (auto I = PALMetadata.begin(), E = PALMetadata.end(); I != E; ++I) {
Stream << Twine(I == PALMetadata.begin() ? " 0x" : ",0x");
Stream << Twine::utohexstr(*I);
}
Stream.flush();
return std::error_code();
}
} // end namespace PALMD
} // end namespace AMDGPU
} // end namespace llvm