[llvm] [DirectX] Add ObjectFile boilerplate for objdump (PR #151434)
Chris B via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 1 06:56:37 PDT 2025
================
@@ -542,11 +542,28 @@ DXContainerObjectFile::getSymbolSection(DataRefImpl Symb) const {
return make_error<DXNotSupportedError>("Symbol sections");
}
+Expected<StringRef> DXContainerObjectFile::getSymbolName(DataRefImpl) const {
+ return make_error<DXNotSupportedError>("Symbol names");
+}
+
Expected<uint64_t>
DXContainerObjectFile::getSymbolAddress(DataRefImpl Symb) const {
return make_error<DXNotSupportedError>("Symbol addresses");
}
+uint64_t DXContainerObjectFile::getSymbolValueImpl(DataRefImpl Symb) const {
+ llvm_unreachable("DXContainer does not support symbols");
----------------
llvm-beanz wrote:
I don't think what you're saying here is in conflict to having `llvm_unreachable` here. With this patch `llvm-objdump -r` produces the output:
```
>bin/llvm-objdump -r part-headers.yaml.tmp
: file format directx container
```
and `llvm-objdump -t` produces:
```
> bin/llvm-objdump -t part-headers.yaml.tmp
: file format directx container
SYMBOL TABLE:
```
The iterators are implemented and all effectively return end iterators so that the result is an empty set. The only way you'd really hit these unreachable is if you tried to access or increment one of the iterators, and since they would be invalid, that would always be a logic error.
https://github.com/llvm/llvm-project/pull/151434
More information about the llvm-commits
mailing list