aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@mozilla.com>2022-12-30 08:32:59 +0100
committerserge-sans-paille <sguelton@mozilla.com>2023-01-12 12:08:06 +0100
commit07bb29d8ffc3b82d5a7bb1217d93e8fa86e6969a (patch)
tree1d8545af548c84b9ff8963f659beb57e854143fd /llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
parentbbe463d6ba268a2bfc45d539314b70cfd72d2360 (diff)
downloadllvm-07bb29d8ffc3b82d5a7bb1217d93e8fa86e6969a.zip
llvm-07bb29d8ffc3b82d5a7bb1217d93e8fa86e6969a.tar.gz
llvm-07bb29d8ffc3b82d5a7bb1217d93e8fa86e6969a.tar.bz2
[OptTable] Precompute OptTable prefixes union table through tablegen
This avoid rediscovering this table when reading each options, providing a sensible 2% speedup when processing and empty file, and a measurable speedup on typical workloads, see: This is optional, the legacy, on-the-fly, approach can still be used through the GenericOptTable class, while the new one is used through PrecomputedOptTable. https://llvm-compile-time-tracker.com/compare.php?from=4da6cb3202817ee2897d6b690e4af950459caea4&to=19a492b704e8f5c1dea120b9c0d3859bd78796be&stat=instructions:u Differential Revision: https://reviews.llvm.org/D140800
Diffstat (limited to 'llvm/tools/llvm-objcopy/ObjcopyOptions.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/ObjcopyOptions.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
index 3a970e2..577b837 100644
--- a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
+++ b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
@@ -56,9 +56,9 @@ static constexpr opt::OptTable::Info ObjcopyInfoTable[] = {
};
} // namespace objcopy_opt
-class ObjcopyOptTable : public opt::OptTable {
+class ObjcopyOptTable : public opt::GenericOptTable {
public:
- ObjcopyOptTable() : OptTable(objcopy_opt::ObjcopyInfoTable) {
+ ObjcopyOptTable() : opt::GenericOptTable(objcopy_opt::ObjcopyInfoTable) {
setGroupedShortOptions(true);
}
};
@@ -101,10 +101,10 @@ static constexpr opt::OptTable::Info InstallNameToolInfoTable[] = {
};
} // namespace install_name_tool
-class InstallNameToolOptTable : public opt::OptTable {
+class InstallNameToolOptTable : public opt::GenericOptTable {
public:
InstallNameToolOptTable()
- : OptTable(install_name_tool::InstallNameToolInfoTable) {}
+ : GenericOptTable(install_name_tool::InstallNameToolInfoTable) {}
};
enum BitcodeStripID {
@@ -145,9 +145,10 @@ static constexpr opt::OptTable::Info BitcodeStripInfoTable[] = {
};
} // namespace bitcode_strip
-class BitcodeStripOptTable : public opt::OptTable {
+class BitcodeStripOptTable : public opt::GenericOptTable {
public:
- BitcodeStripOptTable() : OptTable(bitcode_strip::BitcodeStripInfoTable) {}
+ BitcodeStripOptTable()
+ : opt::GenericOptTable(bitcode_strip::BitcodeStripInfoTable) {}
};
enum StripID {
@@ -179,9 +180,9 @@ static constexpr opt::OptTable::Info StripInfoTable[] = {
};
} // namespace strip
-class StripOptTable : public opt::OptTable {
+class StripOptTable : public opt::GenericOptTable {
public:
- StripOptTable() : OptTable(strip::StripInfoTable) {
+ StripOptTable() : GenericOptTable(strip::StripInfoTable) {
setGroupedShortOptions(true);
}
};