Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/llvm/Object/StackMapParser.h b/linux-x64/clang/include/llvm/Object/StackMapParser.h
index ed44efb..4ee6711 100644
--- a/linux-x64/clang/include/llvm/Object/StackMapParser.h
+++ b/linux-x64/clang/include/llvm/Object/StackMapParser.h
@@ -11,6 +11,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/iterator_range.h"
+#include "llvm/Object/ELF.h"
#include "llvm/Support/Endian.h"
#include <cassert>
#include <cstddef>
@@ -19,7 +20,7 @@
namespace llvm {
-/// A parser for the latest stackmap format. At the moment, latest=V2.
+/// A parser for the latest stackmap format. At the moment, latest=V3.
template <support::endianness Endianness>
class StackMapParser {
public:
@@ -35,11 +36,13 @@
return tmp;
}
- bool operator==(const AccessorIterator &Other) {
+ bool operator==(const AccessorIterator &Other) const {
return A.P == Other.A.P;
}
- bool operator!=(const AccessorIterator &Other) { return !(*this == Other); }
+ bool operator!=(const AccessorIterator &Other) const {
+ return !(*this == Other);
+ }
AccessorT& operator*() { return A; }
AccessorT* operator->() { return &A; }
@@ -299,7 +302,7 @@
const uint8_t *P;
};
- /// Construct a parser for a version-2 stackmap. StackMap data will be read
+ /// Construct a parser for a version-3 stackmap. StackMap data will be read
/// from the given array.
StackMapParser(ArrayRef<uint8_t> StackMapSection)
: StackMapSection(StackMapSection) {
@@ -318,6 +321,23 @@
}
}
+ /// Validates the header of the specified stack map section.
+ static Error validateHeader(ArrayRef<uint8_t> StackMapSection) {
+ // See the comment for StackMaps::emitStackmapHeader().
+ if (StackMapSection.size() < 16)
+ return object::createError(
+ "the stack map section size (" + Twine(StackMapSection.size()) +
+ ") is less than the minimum possible size of its header (16)");
+
+ unsigned Version = StackMapSection[0];
+ if (Version != 3)
+ return object::createError(
+ "the version (" + Twine(Version) +
+ ") of the stack map section is unsupported, the "
+ "supported version is 3");
+ return Error::success();
+ }
+
using function_iterator = AccessorIterator<FunctionAccessor>;
using constant_iterator = AccessorIterator<ConstantAccessor>;
using record_iterator = AccessorIterator<RecordAccessor>;