summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-08 21:52:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-17 20:14:37 (GMT)
commitfc1c7cf85d045323a38c1de7ada213ecfee542a9 (patch)
treec5af2358b6ff05121e4cfed187ba58bf1a074681 /Source/cmGeneratorExpression.cxx
parent4dc4570734e70c47c8bb6d658c1014f29068e106 (diff)
downloadCMake-fc1c7cf85d045323a38c1de7ada213ecfee542a9.zip
CMake-fc1c7cf85d045323a38c1de7ada213ecfee542a9.tar.gz
CMake-fc1c7cf85d045323a38c1de7ada213ecfee542a9.tar.bz2
Genex: Store a backtrace, not a pointer to one.
The storage of a pointer means that the ownership and lifetime are externally determined, which is harder to reason about. It also imposes API constraints, requiring APIs to return references to backtraces. This pointer storage was introduced in commit v3.1.0-rc1~425^2~3 (genex: remove the need for backtraces, 2014-05-23). As backtraces are now cheap to copy around, just do that instead.
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r--Source/cmGeneratorExpression.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 3655a87..80a4f81 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -23,7 +23,7 @@
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
- cmListFileBacktrace const* backtrace):
+ const cmListFileBacktrace& backtrace):
Backtrace(backtrace)
{
}
@@ -33,9 +33,7 @@ cmsys::auto_ptr<cmCompiledGeneratorExpression>
cmGeneratorExpression::Parse(std::string const& input)
{
return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
- new cmCompiledGeneratorExpression(
- this->Backtrace ? *this->Backtrace : cmListFileBacktrace(),
- input));
+ new cmCompiledGeneratorExpression(this->Backtrace, input));
}
//----------------------------------------------------------------------------