Move machinery from inc/ymath.h to src/xmath.hpp#2828
Merged
Conversation
CaseyCarter
approved these changes
Jun 28, 2022
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While looking at the STL's separately compiled machinery for modules, I noticed that
inc/ymath.hwas declaring a bunch of stuff that isn't needed by any other header ininc. We can move this tosrc/xmath.hpp(which is being included by everything insrcthat needs it) without disrupting users or affecting ABI. (That is, the exported machinery insrcwill still be exported; there's no reason to declare it as imported inincif we aren't going to use it there.)This is theoretically an extremely slight throughput improvement (fewer things being declared), but realistically it just makes the codebase easier to understand - fewer spurious connections between
incandsrc.I'm changing one thing while moving this from
inctosrc: changing_CRTIMP2_PURE_IMPORTto_CRTIMP2_PURE. Withinsrc, they are exactly identical (and we don't use_CRTIMP2_PURE_IMPORTexcept for_Yarn- that one is trying to match the header stylistically, although it could be changed).Click to expand macro definitions:
STL/stl/inc/yvals.h
Lines 281 to 297 in ad80eb7
<crtdefs.h>:STL/stl/inc/yvals.h
Lines 265 to 271 in ad80eb7
The only difference between
_CRTIMP2_PURE_IMPORTand_CRTIMP2_PUREis when building user code using the STL as a DLL (/MDand/MDd), in which case the former expands to__declspec(dllimport). That's impossible forstl/src, and we don't need to match any other declarations, so we should use plain_CRTIMP2_PURElike everything else.We have export validation in the internal build, but I also verified this manually.
First, notice that
_Feraisewasn't marked_CRTIMP2_PURE, so it wasn't being imported/exported at all! Withmain, it doesn't appear in the export surface:With this PR, everything else is still being exported: