[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2651-g69b5d0f
Ben Boeckel
ben.boeckel at kitware.com
Wed Apr 30 17:19:47 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 69b5d0f0b61912a4641ab95d130df790e33dd75b (commit)
via 41a08d7ef858fa3cad433ab81f97432b88b6b9f1 (commit)
from 5ddfef24bced54892ee4a46ac00c95bfad038c63 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=69b5d0f0b61912a4641ab95d130df790e33dd75b
commit 69b5d0f0b61912a4641ab95d130df790e33dd75b
Merge: 5ddfef2 41a08d7
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Apr 30 17:19:47 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 30 17:19:47 2014 -0400
Merge topic 'dev/faster-evis' into next
41a08d7e Revert "EVIS: Store the stack outside the function"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41a08d7ef858fa3cad433ab81f97432b88b6b9f1
commit 41a08d7ef858fa3cad433ab81f97432b88b6b9f1
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Apr 30 17:19:12 2014 -0400
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Apr 30 17:19:12 2014 -0400
Revert "EVIS: Store the stack outside the function"
This reverts commit 344f231ccb3be3e571f9bcda5ea5b90c77dc2b4f.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 83e3198..8f889b6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2804,6 +2804,18 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
return mtype;
}
+typedef enum
+ {
+ NORMAL,
+ ENVIRONMENT,
+ CACHE
+ } t_domain;
+struct t_lookup
+ {
+ t_domain domain;
+ std::string lookup;
+ };
+
cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
std::string& errorstr,
std::string& source,
@@ -2822,9 +2834,10 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
const char* in = source.c_str();
const char* last = in;
+ std::stack<t_lookup> openstack;
bool error = false;
bool done = false;
- this->EVISOpenStack.push_front(VariableLookup());
+ openstack.push(t_lookup());
cmake::MessageType mtype = cmake::LOG;
do
@@ -2833,22 +2846,22 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
switch(inc)
{
case '}':
- if(this->EVISOpenStack.size() > 1)
+ if(openstack.size() > 1)
{
- VariableLookup var = this->EVISOpenStack.front();
- this->EVISOpenStack.pop_front();
- std::string& lookup = var.LookupStart;
+ t_lookup var = openstack.top();
+ openstack.pop();
+ std::string& lookup = var.lookup;
lookup.append(last, in - last);
const char* value = NULL;
static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
- switch(var.Domain)
+ switch(var.domain)
{
case NORMAL:
if(filename && lookup == lineVar)
{
cmOStringStream ostr;
ostr << line;
- this->EVISOpenStack.front().LookupStart.append(ostr.str());
+ openstack.top().lookup.append(ostr.str());
}
else
{
@@ -2901,7 +2914,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
}
}
}
- this->EVISOpenStack.front().LookupStart.append(result);
+ openstack.top().lookup.append(result);
// Start looking from here on out.
last = in + 1;
}
@@ -2909,7 +2922,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
case '$':
if(!atOnly)
{
- VariableLookup lookup;
+ t_lookup lookup;
const char* next = in + 1;
const char* start = NULL;
char nextc = *next;
@@ -2917,27 +2930,27 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
{
// Looking for a variable.
start = in + 2;
- lookup.Domain = NORMAL;
+ lookup.domain = NORMAL;
}
else if(nextc == '<')
{
}
else if(!nextc)
{
- this->EVISOpenStack.front().LookupStart.append(last, next - last);
+ openstack.top().lookup.append(last, next - last);
last = next;
}
else if(cmHasLiteralPrefix(next, "ENV{"))
{
// Looking for an environment variable.
start = in + 5;
- lookup.Domain = ENVIRONMENT;
+ lookup.domain = ENVIRONMENT;
}
else if(cmHasLiteralPrefix(next, "CACHE{"))
{
// Looking for a cache variable.
start = in + 7;
- lookup.Domain = CACHE;
+ lookup.domain = CACHE;
}
else
{
@@ -2953,10 +2966,10 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
}
if(start)
{
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ openstack.top().lookup.append(last, in - last);
last = start;
in = start - 1;
- this->EVISOpenStack.push_front(lookup);
+ openstack.push(lookup);
}
break;
}
@@ -2967,23 +2980,23 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
char nextc = *next;
if(nextc == 't')
{
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
- this->EVISOpenStack.front().LookupStart.append("\t");
+ openstack.top().lookup.append(last, in - last);
+ openstack.top().lookup.append("\t");
last = next + 1;
}
else if(nextc == 'n')
{
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
- this->EVISOpenStack.front().LookupStart.append("\n");
+ openstack.top().lookup.append(last, in - last);
+ openstack.top().lookup.append("\n");
last = next + 1;
}
else if(nextc == 'r')
{
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
- this->EVISOpenStack.front().LookupStart.append("\r");
+ openstack.top().lookup.append(last, in - last);
+ openstack.top().lookup.append("\r");
last = next + 1;
}
- else if(nextc == ';' && this->EVISOpenStack.size() == 1)
+ else if(nextc == ';' && openstack.size() == 1)
{
// Handled in ExpandListArgument; pass the backslash literally.
}
@@ -3004,7 +3017,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
else
{
// Take what we've found so far, skipping the escape character.
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ openstack.top().lookup.append(last, in - last);
// Start tracking from the next character.
last = in + 1;
}
@@ -3040,8 +3053,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
result = cmSystemTools::EscapeQuotes(result.c_str());
}
// Skip over the variable.
- this->EVISOpenStack.front().LookupStart.append(last, in - last);
- this->EVISOpenStack.front().LookupStart.append(result);
+ openstack.top().lookup.append(last, in - last);
+ openstack.top().lookup.append(result);
in = nextAt;
last = in + 1;
break;
@@ -3051,17 +3064,16 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
/* FALLTHROUGH */
default:
{
- if(this->EVISOpenStack.size() > 1 &&
+ if(openstack.size() > 1 &&
!(isalnum(inc) || inc == '_' ||
inc == '/' || inc == '.' ||
inc == '+' || inc == '-' ||
- (this->EVISOpenStack.front().Domain == ENVIRONMENT && (
+ (openstack.top().domain == ENVIRONMENT && (
inc == '(' || inc == ')'))))
{
errorstr += "Invalid character (\'";
errorstr += inc;
- errorstr += "\') in a variable name: " +
- this->EVISOpenStack.front().LookupStart;
+ errorstr += "\') in a variable name: " + openstack.top().lookup;
mtype = cmake::FATAL_ERROR;
error = true;
}
@@ -3072,7 +3084,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
} while(!error && !done && *++in);
// Check for open variable references yet.
- if(!error && this->EVISOpenStack.size() != 1)
+ if(!error && openstack.size() != 1)
{
// There's an open variable reference waiting. Policy CMP0010 flags
// whether this is an error or not. The new parser now enforces
@@ -3102,13 +3114,11 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
else
{
// Append the rest of the unchanged part of the string.
- this->EVISOpenStack.front().LookupStart.append(last);
+ openstack.top().lookup.append(last);
- source = this->EVISOpenStack.front().LookupStart;
+ source = openstack.top().lookup;
}
- this->EVISOpenStack.clear();
-
return mtype;
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d08019a..1e7955b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -33,8 +33,6 @@
# include <cmsys/hash_map.hxx>
#endif
-#include <deque>
-
class cmFunctionBlocker;
class cmCommand;
class cmInstallGenerator;
@@ -1056,20 +1054,6 @@ private:
long line,
bool removeEmpty,
bool replaceAt) const;
- typedef enum
- {
- NORMAL,
- ENVIRONMENT,
- CACHE
- } VariableDomain;
- struct VariableLookup
- {
- VariableDomain Domain;
- std::string LookupStart;
- };
- typedef std::deque<VariableLookup> VariableStack;
- mutable VariableStack EVISOpenStack;
-
// CMP0053 == new
cmake::MessageType ExpandVariablesInStringNew(
std::string& errorstr,
-----------------------------------------------------------------------
Summary of changes:
Source/cmMakefile.cxx | 78 ++++++++++++++++++++++++++++---------------------
Source/cmMakefile.h | 16 ----------
2 files changed, 44 insertions(+), 50 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list