Skip to content

Commit

Permalink
[Lex] TokenConcatenation now takes const Preprocessor
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D52502

llvm-svn: 343204
  • Loading branch information
Szelethus committed Sep 27, 2018
1 parent b35d3a2 commit b416dbf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/Lex/TokenConcatenation.h
Expand Up @@ -29,7 +29,7 @@ namespace clang {
/// and ")" next to each other is safe.
///
class TokenConcatenation {
Preprocessor &PP;
const Preprocessor &PP;

enum AvoidConcatInfo {
/// By default, a token never needs to avoid concatenation. Most tokens
Expand All @@ -56,7 +56,7 @@ namespace clang {
/// method.
char TokenInfo[tok::NUM_TOKENS];
public:
TokenConcatenation(Preprocessor &PP);
TokenConcatenation(const Preprocessor &PP);

bool AvoidConcat(const Token &PrevPrevTok,
const Token &PrevTok,
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Lex/TokenConcatenation.cpp
Expand Up @@ -67,7 +67,7 @@ bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11);
}

TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) {
TokenConcatenation::TokenConcatenation(const Preprocessor &pp) : PP(pp) {
memset(TokenInfo, 0, sizeof(TokenInfo));

// These tokens have custom code in AvoidConcat.
Expand Down Expand Up @@ -126,7 +126,7 @@ TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) {

/// GetFirstChar - Get the first character of the token \arg Tok,
/// avoiding calls to getSpelling where possible.
static char GetFirstChar(Preprocessor &PP, const Token &Tok) {
static char GetFirstChar(const Preprocessor &PP, const Token &Tok) {
if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
// Avoid spelling identifiers, the most common form of token.
return II->getNameStart()[0];
Expand Down
Expand Up @@ -79,9 +79,9 @@ class FieldNode {
protected:
const FieldRegion *FR;

/// FieldNodes are never meant to be created on the heap, see
/// FindUninitializedFields::addFieldToUninits().
/* non-virtual */ ~FieldNode() = default;
// TODO: This destructor shouldn't be virtual, but breaks buildbots with
// -Werror -Wnon-virtual-dtor.
virtual ~FieldNode() = default;

public:
FieldNode(const FieldRegion *FR) : FR(FR) {}
Expand Down

0 comments on commit b416dbf

Please sign in to comment.