Exposing opt() which runs middle-end LTO optimzation allows re-using it
in LTOCodeGenerator.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM with a small comment.
llvm/lib/LTO/LTOBackend.cpp | ||
---|---|---|
486 | Any reason why the function need to be moved instead of just renamed? I will reduce the diff if possible. |
llvm/lib/LTO/LTOBackend.cpp | ||
---|---|---|
486 | Unfortunately it is originally defined in a anonymous namespace, so I think it has to be moved out of that to be defined in lto::. |
llvm/lib/LTO/LTOBackend.cpp | ||
---|---|---|
486 | [drive-by comments] I think just adding the lto:: should do the right thing. If not, you can temporarily close the anonymous namespace and reopen it. Another option is an NFC prep commit that limits the anonymous namespace to .cpp-declared structures, and adds a static keyword on each function that's no longer "anonymous". That'd match the more typical LLVM style... reducing this patch to s/static bool opt/bool lto::opt/. |
Rebased after f638c2eb4ee6d0a0bd0e80cd305ad93e382db8f5, which removed the anonymous namespace (it just included function definitions), thanks for the tip!
Now the diff boils down to just changing the name.
llvm/lib/LTO/LTOBackend.cpp | ||
---|---|---|
486 |
Ah yes, LLVM style suggests to only use anonymous namespaces for class declarations! I went with this suggestion and removed the anonymous namespace in f638c2eb4ee6d0a0bd0e80cd305ad93e382db8f5, because it just contained function definitions. |
Any reason why the function need to be moved instead of just renamed? I will reduce the diff if possible.