Commit 3105b4b4 authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Commit Bot

gn: Swap the order of two declarations.

This allows compilers targeting the MS ABI to select the correct
inheritance model for the member function pointer types PrefixFunc
and InfixFunc using the complete type of Parser. It will allow us to
enable the new Clang flag -fcomplete-member-pointers globally.

Bug: 847724
Change-Id: I5b3488ce0b64b3ac4884bc499cd355e1651d12b3
Reviewed-on: https://chromium-review.googlesource.com/1098515
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566964}
parent 8f8fd9b0
...@@ -16,18 +16,9 @@ ...@@ -16,18 +16,9 @@
#include "tools/gn/err.h" #include "tools/gn/err.h"
#include "tools/gn/parse_tree.h" #include "tools/gn/parse_tree.h"
class Parser;
typedef std::unique_ptr<ParseNode> (Parser::*PrefixFunc)(const Token& token);
typedef std::unique_ptr<ParseNode> (
Parser::*InfixFunc)(std::unique_ptr<ParseNode> left, const Token& token);
extern const char kGrammar_Help[]; extern const char kGrammar_Help[];
struct ParserHelper { struct ParserHelper;
PrefixFunc prefix;
InfixFunc infix;
int precedence;
};
// Parses a series of tokens. The resulting AST will refer to the tokens passed // Parses a series of tokens. The resulting AST will refer to the tokens passed
// to the input, so the tokens an the file data they refer to must outlive your // to the input, so the tokens an the file data they refer to must outlive your
...@@ -146,4 +137,14 @@ class Parser { ...@@ -146,4 +137,14 @@ class Parser {
DISALLOW_COPY_AND_ASSIGN(Parser); DISALLOW_COPY_AND_ASSIGN(Parser);
}; };
typedef std::unique_ptr<ParseNode> (Parser::*PrefixFunc)(const Token& token);
typedef std::unique_ptr<ParseNode> (
Parser::*InfixFunc)(std::unique_ptr<ParseNode> left, const Token& token);
struct ParserHelper {
PrefixFunc prefix;
InfixFunc infix;
int precedence;
};
#endif // TOOLS_GN_PARSER_H_ #endif // TOOLS_GN_PARSER_H_
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