Commit b5e17750 by Zhenyao Mo

Get rid of use of "static const std::string".

BUG=angle:807 TEST=angle_unittests Change-Id: Ifa4d713deeb25d52a7aafc362a7e4630024fd511 Reviewed-on: https://chromium-review.googlesource.com/225004Tested-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 30bc2ecd
...@@ -38,19 +38,19 @@ enum DirectiveType ...@@ -38,19 +38,19 @@ enum DirectiveType
DirectiveType getDirective(const pp::Token *token) DirectiveType getDirective(const pp::Token *token)
{ {
static const std::string kDirectiveDefine("define"); const char kDirectiveDefine[] = "define";
static const std::string kDirectiveUndef("undef"); const char kDirectiveUndef[] = "undef";
static const std::string kDirectiveIf("if"); const char kDirectiveIf[] = "if";
static const std::string kDirectiveIfdef("ifdef"); const char kDirectiveIfdef[] = "ifdef";
static const std::string kDirectiveIfndef("ifndef"); const char kDirectiveIfndef[] = "ifndef";
static const std::string kDirectiveElse("else"); const char kDirectiveElse[] = "else";
static const std::string kDirectiveElif("elif"); const char kDirectiveElif[] = "elif";
static const std::string kDirectiveEndif("endif"); const char kDirectiveEndif[] = "endif";
static const std::string kDirectiveError("error"); const char kDirectiveError[] = "error";
static const std::string kDirectivePragma("pragma"); const char kDirectivePragma[] = "pragma";
static const std::string kDirectiveExtension("extension"); const char kDirectiveExtension[] = "extension";
static const std::string kDirectiveVersion("version"); const char kDirectiveVersion[] = "version";
static const std::string kDirectiveLine("line"); const char kDirectiveLine[] = "line";
if (token->type != pp::Token::IDENTIFIER) if (token->type != pp::Token::IDENTIFIER)
return DIRECTIVE_NONE; return DIRECTIVE_NONE;
...@@ -155,7 +155,7 @@ class DefinedParser : public Lexer ...@@ -155,7 +155,7 @@ class DefinedParser : public Lexer
protected: protected:
virtual void lex(Token *token) virtual void lex(Token *token)
{ {
static const std::string kDefined("defined"); const char kDefined[] = "defined";
mLexer->lex(token); mLexer->lex(token);
if (token->type != Token::IDENTIFIER) if (token->type != Token::IDENTIFIER)
......
...@@ -194,8 +194,8 @@ bool MacroExpander::expandMacro(const Macro &macro, ...@@ -194,8 +194,8 @@ bool MacroExpander::expandMacro(const Macro &macro,
if (macro.predefined) if (macro.predefined)
{ {
static const std::string kLine = "__LINE__"; const char kLine[] = "__LINE__";
static const std::string kFile = "__FILE__"; const char kFile[] = "__FILE__";
assert(replacements->size() == 1); assert(replacements->size() == 1);
Token& repl = replacements->front(); Token& repl = replacements->front();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment