micro improvements (#15849)

This commit is contained in:
Andreas Rumpf 2020-11-05 14:56:44 +01:00 • committed by GitHub
commit 3aab6a409d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -522,7 +522,7 @@ a form of copy elision.
To see how and when we can do that, think about this question: In `dest = src` when To see how and when we can do that, think about this question: In `dest = src` when
do we really have to *materialize* the full copy? - Only if `dest` or `src` are mutated do we really have to *materialize* the full copy? - Only if `dest` or `src` are mutated
afterward. If `dest` is a local variable that is simple to analyze. And if `src` is a afterwards. If `dest` is a local variable that is simple to analyze. And if `src` is a
location derived from a formal parameter, we also know it is not mutated! In other location derived from a formal parameter, we also know it is not mutated! In other
words, we do a compile-time copy-on-write analysis. words, we do a compile-time copy-on-write analysis.

View file

@ -554,7 +554,8 @@ proc nimFrame(s: PFrame) {.compilerRtl, inl, raises: [].} =
when defined(cpp) and appType != "lib" and not gotoBasedExceptions and when defined(cpp) and appType != "lib" and not gotoBasedExceptions and
not defined(js) and not defined(nimscript) and not defined(js) and not defined(nimscript) and
hostOS != "standalone" and hostOS != "any" and not defined(noCppExceptions): hostOS != "standalone" and hostOS != "any" and not defined(noCppExceptions) and
not defined(nimQuirky):
type type
StdException {.importcpp: "std::exception", header: "<exception>".} = object StdException {.importcpp: "std::exception", header: "<exception>".} = object