[llvm] [Object][COFF][NFC] Don't use inline function for COFFImportFile::printSymbolName. (PR #87195)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 31 09:27:17 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-binary-utilities
Author: Jacek Caban (cjacek)
<details>
<summary>Changes</summary>
Fixes BUILD_SHARED_LIBS builds after #<!-- -->87191 made helpers non-inline.
---
Full diff: https://github.com/llvm/llvm-project/pull/87195.diff
2 Files Affected:
- (modified) llvm/include/llvm/Object/COFFImportFile.h (+1-20)
- (modified) llvm/lib/Object/COFFImportFile.cpp (+21)
``````````diff
diff --git a/llvm/include/llvm/Object/COFFImportFile.h b/llvm/include/llvm/Object/COFFImportFile.h
index 035bc17126da34..2c06f529ecdfc5 100644
--- a/llvm/include/llvm/Object/COFFImportFile.h
+++ b/llvm/include/llvm/Object/COFFImportFile.h
@@ -45,26 +45,7 @@ class COFFImportFile : public SymbolicFile {
void moveSymbolNext(DataRefImpl &Symb) const override { ++Symb.p; }
- Error printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override {
- switch (Symb.p) {
- case ImpSymbol:
- OS << "__imp_";
- break;
- case ECAuxSymbol:
- OS << "__imp_aux_";
- break;
- }
- const char *Name = Data.getBufferStart() + sizeof(coff_import_header);
- if (Symb.p != ECThunkSymbol && COFF::isArm64EC(getMachine())) {
- if (std::optional<std::string> DemangledName =
- getArm64ECDemangledFunctionName(Name)) {
- OS << StringRef(*DemangledName);
- return Error::success();
- }
- }
- OS << StringRef(Name);
- return Error::success();
- }
+ Error printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override;
Expected<uint32_t> getSymbolFlags(DataRefImpl Symb) const override {
return SymbolRef::SF_Global;
diff --git a/llvm/lib/Object/COFFImportFile.cpp b/llvm/lib/Object/COFFImportFile.cpp
index 477c5bf98249f7..48c3ea0ed8f4e4 100644
--- a/llvm/lib/Object/COFFImportFile.cpp
+++ b/llvm/lib/Object/COFFImportFile.cpp
@@ -84,6 +84,27 @@ StringRef COFFImportFile::getExportName() const {
return name;
}
+Error COFFImportFile::printSymbolName(raw_ostream &OS, DataRefImpl Symb) const {
+ switch (Symb.p) {
+ case ImpSymbol:
+ OS << "__imp_";
+ break;
+ case ECAuxSymbol:
+ OS << "__imp_aux_";
+ break;
+ }
+ const char *Name = Data.getBufferStart() + sizeof(coff_import_header);
+ if (Symb.p != ECThunkSymbol && COFF::isArm64EC(getMachine())) {
+ if (std::optional<std::string> DemangledName =
+ getArm64ECDemangledFunctionName(Name)) {
+ OS << StringRef(*DemangledName);
+ return Error::success();
+ }
+ }
+ OS << StringRef(Name);
+ return Error::success();
+}
+
static uint16_t getImgRelRelocation(MachineTypes Machine) {
switch (Machine) {
default:
``````````
</details>
https://github.com/llvm/llvm-project/pull/87195
More information about the llvm-commits
mailing list