[PATCH] D124781: [ifs] Fix bug where exclude only excluded when outputting ifs files
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 10:49:23 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7aaad7b18322: [ifs] Fix bug where exclude only excluded when outputting ifs files (authored by abrachet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124781/new/
https://reviews.llvm.org/D124781
Files:
llvm/test/tools/llvm-ifs/exclude.test
llvm/tools/llvm-ifs/llvm-ifs.cpp
Index: llvm/tools/llvm-ifs/llvm-ifs.cpp
===================================================================
--- llvm/tools/llvm-ifs/llvm-ifs.cpp
+++ llvm/tools/llvm-ifs/llvm-ifs.cpp
@@ -429,6 +429,9 @@
if (StripNeededLibs)
Stub.NeededLibs.clear();
+ if (Error E = filterIFSSyms(Stub, StripUndefined, ExcludeSyms))
+ fatalError(std::move(E));
+
if (OutputELFFilePath.getNumOccurrences() == 0 &&
OutputIFSFilePath.getNumOccurrences() == 0 &&
OutputTBDFilePath.getNumOccurrences() == 0) {
@@ -485,8 +488,6 @@
stripIFSTarget(Stub, StripIFSTarget, StripIFSArch,
StripIFSEndiannessWidth, StripIFSBitWidth);
}
- if (Error E = filterIFSSyms(Stub, StripUndefined, ExcludeSyms))
- fatalError(std::move(E));
Error IFSWriteError = writeIFS(OutputFilePath.getValue(), Stub);
if (IFSWriteError)
fatalError(std::move(IFSWriteError));
@@ -537,8 +538,6 @@
stripIFSTarget(Stub, StripIFSTarget, StripIFSArch,
StripIFSEndiannessWidth, StripIFSBitWidth);
}
- if (Error E = filterIFSSyms(Stub, StripUndefined, ExcludeSyms))
- fatalError(std::move(E));
Error IFSWriteError = writeIFS(OutputIFSFilePath.getValue(), Stub);
if (IFSWriteError)
fatalError(std::move(IFSWriteError));
Index: llvm/test/tools/llvm-ifs/exclude.test
===================================================================
--- llvm/test/tools/llvm-ifs/exclude.test
+++ llvm/test/tools/llvm-ifs/exclude.test
@@ -2,6 +2,9 @@
# RUN: llvm-ifs --input-format=IFS --output-ifs=- --exclude='exclude*' %s | FileCheck %s
+# Check that exclude excludes from elf files too.
+# RUN: llvm-ifs %s --output-elf - --exclude='exclude*' | llvm-ifs - --output-ifs - | FileCheck %s
+
# RUN: llvm-ifs --input-format=IFS --output-ifs=- --exclude='exclude*' \
# RUN: --strip-undefined %s | FileCheck %s --check-prefix=BOTH
@@ -13,6 +16,7 @@
--- !ifs-v1
SoName: somelib.so
IfsVersion: 3.0
+Target: x86_64-unknown-linux-gnu
Symbols:
- { Name: dont_exclude, Type: Func, Undefined: true }
- { Name: exclude_1, Type: Func }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124781.426455.patch
Type: text/x-patch
Size: 2141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220502/590b0b82/attachment.bin>
More information about the llvm-commits
mailing list