This is an archive of the discontinued LLVM Phabricator instance.

[builtins] Prevent duplicate definitions for overridden functions
ClosedPublic

Authored by fjricci on Aug 25 2017, 1:59 PM.

Details

Summary

Some architecture-specific function overrides (for example, i386/ashrdi3.S)
duplicate generic functions (in that case, ashrdi3.c). Prevent duplicate definitions
by filtering out the generic files before compiling.

Diff Detail

Repository
rL LLVM

Event Timeline

fjricci created this revision.Aug 25 2017, 1:59 PM
compnerd added inline comments.Aug 25 2017, 2:35 PM
cmake/Modules/CompilerRTUtils.cmake
290 ↗(On Diff #112743)

Seems like you are re-implementing darwin_filter_builtin_sources. Can you rename and reuse that instead?

fjricci updated this revision to Diff 112904.Aug 28 2017, 8:51 AM

Re-use existing darwin function

compnerd accepted this revision.Aug 28 2017, 8:56 AM

LGTM! Thanks for the follow up cleanup work :-). Id say give @beanz a day or so to look at it, but this is mostly just a function renaming, and the new codepaths are okay.

This revision is now accepted and ready to land.Aug 28 2017, 8:56 AM

Thanks. Verified that this patch doesn't cause any files to be rebuilt when targeting macOS.

This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Jul 31 2019, 6:25 AM
thakis added inline comments.
compiler-rt/trunk/lib/builtins/CMakeLists.txt
500

Didn't this do the same thing already? What did this down here not catch?

D36555, which went out to review before this change but landed later, added x86_ARCH_SOURCES which contains floatundixf.c which has a specialized implementation. x86_ARCH_SOURCES currently doesn't go through filter_builtin_sources() (due to it not yet being in the tree when this patch landed), but due to this loop down here it appears only once anyways.

So now I'm confused what exactly the effect of this patch here was.

Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2019, 6:25 AM
Herald added a subscriber: delcypher. · View Herald Transcript