Skip to content

Commit 969c607

Browse files
author
git apple-llvm automerger
committed
Merge commit '68e814d9114b' from llvm.org/main into next
2 parents d85c6c6 + 68e814d commit 969c607

File tree

9 files changed

+407
-167
lines changed

9 files changed

+407
-167
lines changed

llvm/docs/AMDGPUUsage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4652,7 +4652,7 @@ The fields used by CP for code objects before V3 also match those specified in
46524652
entry point instruction
46534653
which must be 256 byte
46544654
aligned.
4655-
351:272 20 Reserved, must be 0.
4655+
351:192 20 Reserved, must be 0.
46564656
bytes
46574657
383:352 4 bytes COMPUTE_PGM_RSRC3 GFX6-GFX9
46584658
Reserved, must be 0.
@@ -5248,14 +5248,14 @@ The fields used by CP for code objects before V3 also match those specified in
52485248
5:0 6 bits ACCUM_OFFSET Offset of a first AccVGPR in the unified register file. Granularity 4.
52495249
Value 0-63. 0 - accum-offset = 4, 1 - accum-offset = 8, ...,
52505250
63 - accum-offset = 256.
5251-
6:15 10 Reserved, must be 0.
5251+
15:6 10 Reserved, must be 0.
52525252
bits
52535253
16 1 bit TG_SPLIT - If 0 the waves of a work-group are
52545254
launched in the same CU.
52555255
- If 1 the waves of a work-group can be
52565256
launched in different CUs. The waves
52575257
cannot use S_BARRIER or LDS.
5258-
17:31 15 Reserved, must be 0.
5258+
31:17 15 Reserved, must be 0.
52595259
bits
52605260
32 **Total size 4 bytes.**
52615261
======= ===================================================================================================================

llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "llvm/ADT/StringRef.h"
1313
#include "llvm/BinaryFormat/XCOFF.h"
1414
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
15+
#include "llvm/Support/Error.h"
1516
#include <cstdint>
1617
#include <memory>
1718
#include <vector>
@@ -139,28 +140,26 @@ class MCDisassembler {
139140
/// start of a symbol, or the entire symbol.
140141
/// This is used for example by WebAssembly to decode preludes.
141142
///
142-
/// Base implementation returns std::nullopt. So all targets by default ignore
143-
/// to treat symbols separately.
143+
/// Base implementation returns false. So all targets by default decline to
144+
/// treat symbols separately.
144145
///
145146
/// \param Symbol - The symbol.
146147
/// \param Size - The number of bytes consumed.
147148
/// \param Address - The address, in the memory space of region, of the first
148149
/// byte of the symbol.
149150
/// \param Bytes - A reference to the actual bytes at the symbol location.
150-
/// \param CStream - The stream to print comments and annotations on.
151-
/// \return - MCDisassembler::Success if bytes are decoded
152-
/// successfully. Size must hold the number of bytes that
153-
/// were decoded.
154-
/// - MCDisassembler::Fail if the bytes are invalid. Size
155-
/// must hold the number of bytes that were decoded before
156-
/// failing. The target must print nothing. This can be
157-
/// done by buffering the output if needed.
158-
/// - std::nullopt if the target doesn't want to handle the
159-
/// symbol separately. Value of Size is ignored in this
160-
/// case.
161-
virtual std::optional<DecodeStatus>
162-
onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef<uint8_t> Bytes,
163-
uint64_t Address, raw_ostream &CStream) const;
151+
/// \return - True if this symbol triggered some target specific
152+
/// disassembly for this symbol. Size must be set with the
153+
/// number of bytes consumed.
154+
/// - Error if this symbol triggered some target specific
155+
/// disassembly for this symbol, but an error was found with
156+
/// it. Size must be set with the number of bytes consumed.
157+
/// - False if the target doesn't want to handle the symbol
158+
/// separately. The value of Size is ignored in this case,
159+
/// and Err must not be set.
160+
virtual Expected<bool> onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size,
161+
ArrayRef<uint8_t> Bytes,
162+
uint64_t Address) const;
164163
// TODO:
165164
// Implement similar hooks that can be used at other points during
166165
// disassembly. Something along the following lines:

llvm/lib/MC/MCDisassembler/MCDisassembler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ using namespace llvm;
1313

1414
MCDisassembler::~MCDisassembler() = default;
1515

16-
std::optional<MCDisassembler::DecodeStatus>
17-
MCDisassembler::onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size,
18-
ArrayRef<uint8_t> Bytes, uint64_t Address,
19-
raw_ostream &CStream) const {
20-
return std::nullopt;
16+
Expected<bool> MCDisassembler::onSymbolStart(SymbolInfoTy &Symbol,
17+
uint64_t &Size,
18+
ArrayRef<uint8_t> Bytes,
19+
uint64_t Address) const {
20+
return false;
2121
}
2222

2323
uint64_t MCDisassembler::suggestBytesToSkip(ArrayRef<uint8_t> Bytes,

0 commit comments

Comments
 (0)