[PATCH] D94486: [LTO] Expose opt() in LTOBackend (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 02:52:24 PST 2021


fhahn updated this revision to Diff 316352.
fhahn added a comment.

Rebased after f638c2eb4ee6d0a0bd0e80cd305ad93e382db8f5 <https://reviews.llvm.org/rGf638c2eb4ee6d0a0bd0e80cd305ad93e382db8f5>, which removed the anonymous namespace (it just included function definitions), thanks for the tip!

Now the diff boils down to just changing the name.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94486/new/

https://reviews.llvm.org/D94486

Files:
  llvm/include/llvm/LTO/LTOBackend.h
  llvm/lib/LTO/LTOBackend.cpp


Index: llvm/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/lib/LTO/LTOBackend.cpp
+++ llvm/lib/LTO/LTOBackend.cpp
@@ -358,10 +358,10 @@
   passes.run(Mod);
 }
 
-static bool opt(const Config &Conf, TargetMachine *TM, unsigned Task,
-                Module &Mod, bool IsThinLTO, ModuleSummaryIndex *ExportSummary,
-                const ModuleSummaryIndex *ImportSummary,
-                const std::vector<uint8_t> &CmdArgs) {
+bool lto::opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
+              bool IsThinLTO, ModuleSummaryIndex *ExportSummary,
+              const ModuleSummaryIndex *ImportSummary,
+              const std::vector<uint8_t> &CmdArgs) {
   if (EmbedBitcode == LTOBitcodeEmbedding::EmbedPostMergePreOptimized) {
     // FIXME: the motivation for capturing post-merge bitcode and command line
     // is replicating the compilation environment from bitcode, without needing
Index: llvm/include/llvm/LTO/LTOBackend.h
===================================================================
--- llvm/include/llvm/LTO/LTOBackend.h
+++ llvm/include/llvm/LTO/LTOBackend.h
@@ -33,6 +33,12 @@
 
 namespace lto {
 
+/// Runs middle-end LTO optimizations on \p Mod.
+bool opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
+         bool IsThinLTO, ModuleSummaryIndex *ExportSummary,
+         const ModuleSummaryIndex *ImportSummary,
+         const std::vector<uint8_t> &CmdArgs);
+
 /// Runs a regular LTO backend. The regular LTO backend can also act as the
 /// regular LTO phase of ThinLTO, which may need to access the combined index.
 Error backend(const Config &C, AddStreamFn AddStream,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94486.316352.patch
Type: text/x-patch
Size: 1702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/ca1ef0e8/attachment.bin>


More information about the llvm-commits mailing list