summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/AMDGPUMetadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/AMDGPUMetadata.cpp')
-rw-r--r--llvm/lib/Support/AMDGPUMetadata.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Support/AMDGPUMetadata.cpp b/llvm/lib/Support/AMDGPUMetadata.cpp
index 814ef68a51f..aa3af653cf7 100644
--- a/llvm/lib/Support/AMDGPUMetadata.cpp
+++ b/llvm/lib/Support/AMDGPUMetadata.cpp
@@ -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
OpenPOWER on IntegriCloud