aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
commit706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch)
tree4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/BinaryFormat
parent7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff)
Notes
Diffstat (limited to 'llvm/lib/BinaryFormat')
-rw-r--r--llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp1
-rw-r--r--llvm/lib/BinaryFormat/Dwarf.cpp15
-rw-r--r--llvm/lib/BinaryFormat/XCOFF.cpp34
3 files changed, 50 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
index 3f36dff9f55c..d927171d556c 100644
--- a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
+++ b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp
@@ -119,6 +119,7 @@ bool MetadataVerifier::verifyKernelArgs(msgpack::DocNode &Node) {
.Case("hidden_global_offset_z", true)
.Case("hidden_none", true)
.Case("hidden_printf_buffer", true)
+ .Case("hidden_hostcall_buffer", true)
.Case("hidden_default_queue", true)
.Case("hidden_completion_action", true)
.Case("hidden_multigrid_sync_arg", true)
diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp
index d06cccdf0dfd..9ca3317418ce 100644
--- a/llvm/lib/BinaryFormat/Dwarf.cpp
+++ b/llvm/lib/BinaryFormat/Dwarf.cpp
@@ -274,6 +274,19 @@ StringRef llvm::dwarf::AccessibilityString(unsigned Access) {
return StringRef();
}
+StringRef llvm::dwarf::DefaultedMemberString(unsigned DefaultedEncodings) {
+ switch (DefaultedEncodings) {
+ // Defaulted Member Encodings codes
+ case DW_DEFAULTED_no:
+ return "DW_DEFAULTED_no";
+ case DW_DEFAULTED_in_class:
+ return "DW_DEFAULTED_in_class";
+ case DW_DEFAULTED_out_of_class:
+ return "DW_DEFAULTED_out_of_class";
+ }
+ return StringRef();
+}
+
StringRef llvm::dwarf::VisibilityString(unsigned Visibility) {
switch (Visibility) {
case DW_VIS_local:
@@ -615,6 +628,8 @@ StringRef llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) {
return ArrayOrderString(Val);
case DW_AT_APPLE_runtime_class:
return LanguageString(Val);
+ case DW_AT_defaulted:
+ return DefaultedMemberString(Val);
}
return StringRef();
diff --git a/llvm/lib/BinaryFormat/XCOFF.cpp b/llvm/lib/BinaryFormat/XCOFF.cpp
new file mode 100644
index 000000000000..29ccbaea3584
--- /dev/null
+++ b/llvm/lib/BinaryFormat/XCOFF.cpp
@@ -0,0 +1,34 @@
+//===-- llvm/BinaryFormat/XCOFF.cpp - The XCOFF file format -----*- C++/-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/BinaryFormat/XCOFF.h"
+
+using namespace llvm;
+
+StringRef XCOFF::getMappingClassString(XCOFF::StorageMappingClass SMC) {
+ switch (SMC) {
+ case XCOFF::XMC_DS:
+ return "DS";
+ case XCOFF::XMC_RW:
+ return "RW";
+ case XCOFF::XMC_PR:
+ return "PR";
+ case XCOFF::XMC_TC0:
+ return "TC0";
+ case XCOFF::XMC_BS:
+ return "BS";
+ case XCOFF::XMC_RO:
+ return "RO";
+ case XCOFF::XMC_UA:
+ return "UA";
+ case XCOFF::XMC_TC:
+ return "TC";
+ default:
+ report_fatal_error("Unhandled storage-mapping class.");
+ }
+}