aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorQiu Chaofan <qiucofan@cn.ibm.com>2023-07-13 10:15:34 +0800
committerQiu Chaofan <qiucofan@cn.ibm.com>2023-07-13 10:15:34 +0800
commitb16372c5fc65a6a7c14c19f01b17ac15a964d21f (patch)
tree4a11f9d798dea165c2060ad23fea944f3ffb9ba2 /llvm/lib/Object/XCOFFObjectFile.cpp
parenta4d1259e617c94d2382a55b6bf48683363a0b849 (diff)
downloadllvm-b16372c5fc65a6a7c14c19f01b17ac15a964d21f.zip
llvm-b16372c5fc65a6a7c14c19f01b17ac15a964d21f.tar.gz
llvm-b16372c5fc65a6a7c14c19f01b17ac15a964d21f.tar.bz2
[PowerPC][MC] Set 'future' as default CPU type of XCOFF
For Power on Linux (both LE and BE), ELFObjectFile returns 'future' as default CPU type if mcpu is not specified, so that all necessary features will be enabled in MC. While for XCOFF, the default CPU type is always null, which makes tools like llvm-objdump not able to recognize prefixed instructions, unless specifying --mcpu=pwr10 or --mattr=+prefix-instrs manually. Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D155089
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index b6d0180..fa4917e 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -1217,6 +1217,10 @@ ObjectFile::createXCOFFObjectFile(MemoryBufferRef MemBufRef,
return XCOFFObjectFile::create(FileType, MemBufRef);
}
+std::optional<StringRef> XCOFFObjectFile::tryGetCPUName() const {
+ return StringRef("future");
+}
+
bool XCOFFSymbolRef::isFunction() const {
if (!isCsectSymbol())
return false;