summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-04 11:12:50 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 15:22:41 (GMT)
commit238aac23514ecdae0d4edb71033e443f30e94158 (patch)
tree5cf049d75078016e4c7504689e2623e51738d99d /Source/cmListFileCache.h
parent329098a9a0e81e67bd760f53811cce582a3ebdcd (diff)
downloadCMake-238aac23514ecdae0d4edb71033e443f30e94158.zip
CMake-238aac23514ecdae0d4edb71033e443f30e94158.tar.gz
CMake-238aac23514ecdae0d4edb71033e443f30e94158.tar.bz2
cmListFile: Remove FilePath member from cmListFileContext.
There is no need to store the FilePath for every function, as it is known by other means.
Diffstat (limited to 'Source/cmListFileCache.h')
-rw-r--r--Source/cmListFileCache.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index f5859ec..57bf253 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,7 +81,7 @@ 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;
};