summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-07 13:53:46 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-07-07 13:53:46 (GMT)
commitb33b5cd3170c08f61cbc05fc2a2e462a09703879 (patch)
treea52e3b371bfc7ca67f4f5c6b8db3056046eb6652 /Source/cmListFileCache.h
parent18fdf13192ba1f1e8ac84b29f44d3d0b0549607e (diff)
parentd2475bb5c4488a0ef6015f13ee46ddc7a2e4455b (diff)
downloadCMake-b33b5cd3170c08f61cbc05fc2a2e462a09703879.zip
CMake-b33b5cd3170c08f61cbc05fc2a2e462a09703879.tar.gz
CMake-b33b5cd3170c08f61cbc05fc2a2e462a09703879.tar.bz2
Merge topic 'refactor-cmListFileBacktrace'
d2475bb5 cmListFileBacktrace: Implement in terms of cmState::Snapshot. 238aac23 cmListFile: Remove FilePath member from cmListFileContext. 329098a9 cmMakefile: Set the FilePath on the frame from the cmState. 91158a33 cmMakefile: Create intermediate variables for snapshot frames. 821f91d6 cmMakefile: Create a scoped context for parsing listfiles. 30d44efa cmMakefile: Access the execution list file from the cmState. 6361f680 cmState: Store execution context. 94704d75 cmState: Add GetCallStackParent method. a8e54460 cmState: Store snapshots for more different types. dbafb015 cmMakefile: Split CallStack into two pieces. 27ff19a9 cmLinkedTree: Add operator* to the iterator.
Diffstat (limited to 'Source/cmListFileCache.h')
-rw-r--r--Source/cmListFileCache.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index f5859ec..aa8a34c 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -25,6 +25,13 @@
class cmMakefile;
+struct cmCommandContext
+{
+ std::string Name;
+ long Line;
+ cmCommandContext(): Name(), Line(0) {}
+};
+
struct cmListFileArgument
{
enum Delimiter
@@ -57,6 +64,16 @@ struct cmListFileContext
std::string FilePath;
long Line;
cmListFileContext(): Name(), FilePath(), Line(0) {}
+
+ static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
+ std::string const& fileName)
+ {
+ cmListFileContext lfc;
+ lfc.FilePath = fileName;
+ lfc.Line = lfcc.Line;
+ lfc.Name = lfcc.Name;
+ return lfc;
+ }
};
std::ostream& operator<<(std::ostream&, cmListFileContext const&);
@@ -64,24 +81,24 @@ bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs);
bool operator==(cmListFileContext const& lhs, cmListFileContext const& rhs);
bool operator!=(cmListFileContext const& lhs, cmListFileContext const& rhs);
-struct cmListFileFunction: public cmListFileContext
+struct cmListFileFunction: public cmCommandContext
{
std::vector<cmListFileArgument> Arguments;
};
-class cmListFileBacktrace: private std::vector<cmListFileContext>
+class cmListFileBacktrace
{
public:
- cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot())
- : Snapshot(snapshot)
+ cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot(),
+ cmCommandContext const& cc = cmCommandContext())
+ : Context(cc), Snapshot(snapshot)
{
}
- void Append(cmListFileContext const& context);
-
void PrintTitle(std::ostream& out);
void PrintCallStack(std::ostream& out);
private:
+ cmCommandContext Context;
cmState::Snapshot Snapshot;
};