• Brad King's avatar
    cmListFileBacktrace: Refactor storage to provide efficient value semantics · 7c36d206
    Brad King authored
    Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer
    to one, 2015-07-08) we treat cmListFileBacktrace instances as
    lightweight values.  This was true at the time only because the
    backtrace information was kept in the cmState snapshot hierarchy.
    However, that forced us to accumulate a lot of otherwise short-lived
    snapshots just to have the backtrace fields available for reference by
    cmListFileBacktrace instances.  Recent refactoring made backtrace
    instances independent of the snapshot hierarchy to avoid accumulating
    short-lived snapshots.  This came at the cost of making backtrace values
    heavy again, leading to lots of string coying and slower execution.
    
    Fix this by refactoring cmListFileBacktrace to provide value semantics
    with efficient shared storage underneath.  Teach cmMakefile to maintain
    its call stack using an instance of cmListFileBacktrace.  This approach
    allows the current backtrace to be efficiently saved whenever it is
    needed.
    
    Also teach cmListFileBacktrace the notion of a file-level scope.  This
    is useful for messages about the whole file (e.g. during parsing) that
    are not specific to any line within it.  Push the CMakeLists.txt scope
    for each directory and never pop it.  This ensures that we always have
    some context information and simplifies cmMakefile::IssueMessage.
    Push/pop a file-level scope as each included file is processed.  This
    supersedes cmParseFileScope and improves diagnostic message context
    information in a few places.  Fix the corresponding test cases to expect
    the improved output.
    7c36d206
Name
Last commit
Last update
..
PolicyPop Loading commit data...
PolicyPush Loading commit data...
CMakeLists.txt Loading commit data...
ComponentRequiredAndOptional-result.txt Loading commit data...
ComponentRequiredAndOptional-stderr.txt Loading commit data...
ComponentRequiredAndOptional.cmake Loading commit data...
MissingConfig-stderr.txt Loading commit data...
MissingConfig.cmake Loading commit data...
MissingConfigOneName-stderr.txt Loading commit data...
MissingConfigOneName.cmake Loading commit data...
MissingConfigRequired-result.txt Loading commit data...
MissingConfigRequired-stderr.txt Loading commit data...
MissingConfigRequired.cmake Loading commit data...
MissingConfigVersion-stderr.txt Loading commit data...
MissingConfigVersion.cmake Loading commit data...
MissingModule-stderr.txt Loading commit data...
MissingModule.cmake Loading commit data...
MissingModuleRequired-result.txt Loading commit data...
MissingModuleRequired-stderr.txt Loading commit data...
MissingModuleRequired.cmake Loading commit data...
MissingNormal-stderr.txt Loading commit data...
MissingNormal.cmake Loading commit data...
MissingNormalRequired-result.txt Loading commit data...
MissingNormalRequired-stderr.txt Loading commit data...
MissingNormalRequired.cmake Loading commit data...
MissingNormalVersion-stderr.txt Loading commit data...
MissingNormalVersion.cmake Loading commit data...
MissingNormalWarnNoModuleNew-stderr.txt Loading commit data...
MissingNormalWarnNoModuleNew.cmake Loading commit data...
MissingNormalWarnNoModuleOld-stderr.txt Loading commit data...
MissingNormalWarnNoModuleOld.cmake Loading commit data...
MixedModeOptions-result.txt Loading commit data...
MixedModeOptions-stderr.txt Loading commit data...
MixedModeOptions.cmake Loading commit data...
PolicyPop-result.txt Loading commit data...
PolicyPop-stderr.txt Loading commit data...
PolicyPop.cmake Loading commit data...
PolicyPush-result.txt Loading commit data...
PolicyPush-stderr.txt Loading commit data...
PolicyPush.cmake Loading commit data...
RunCMakeTest.cmake Loading commit data...
SetFoundFALSE-stderr.txt Loading commit data...
SetFoundFALSE.cmake Loading commit data...
SetFoundFALSEConfig.cmake Loading commit data...