/// 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
/// method.
char TokenInfo[tok::NUM_TOKENS];
public:
- TokenConcatenation(Preprocessor &PP);
+ TokenConcatenation(const Preprocessor &PP);
bool AvoidConcat(const Token &PrevPrevTok,
const Token &PrevTok,
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.
/// 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];
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) {}