diff options
author | Justin Berger <j.david.berger@gmail.com> | 2017-07-23 00:34:33 (GMT) |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2017-11-01 17:32:11 (GMT) |
commit | 39c2feaf8c4dcb9c3a30c68a066fb70e126d7fe6 (patch) | |
tree | 1023429578ddc402c663d8e29a2ef2341a9c382a /Source/cmListFileCache.cxx | |
parent | f5d2988ea7cc60778dbaa21860aad264c7aa7a81 (diff) | |
download | CMake-39c2feaf8c4dcb9c3a30c68a066fb70e126d7fe6.zip CMake-39c2feaf8c4dcb9c3a30c68a066fb70e126d7fe6.tar.gz CMake-39c2feaf8c4dcb9c3a30c68a066fb70e126d7fe6.tar.bz2 |
misc: Added utility method to allow working with stacks
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 8e8a54d..cbcf200 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -438,6 +438,19 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const } } +size_t cmListFileBacktrace::Depth() const +{ + size_t depth = 0; + if (this->Cur == nullptr) { + return 0; + } + + for (Entry* i = this->Cur->Up; i; i = i->Up) { + depth++; + } + return depth; +} + std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc) { os << lfc.FilePath; |