• Stephen Kelly's avatar
    cmMakefile: Remove VarInitStack. · 2b09d9f3
    Stephen Kelly authored
    In cmMakefile::PushScope, a copy of the closure of keys initialized
    in the parent scope is made.  In PopScope, essentially the same copy
    is inserted back into the parent.  That means a lot of duplication
    of strings and a lot of string comparisons.  None of it is needed,
    because the cmDefinitions keys already provide a canonical
    representation of what is initialized.
    
    The removal of the separate container also makes the variable handling
    code more easy to reason about in general.
    
    Before this patch, configuring llvm uses 200 KiB for the VarInitStack.
    Overall peak memory consumption goes from 35.5 MiB to 35.1 MiB.
    2b09d9f3