aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/LiteralSupport.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex/LiteralSupport.h')
-rw-r--r--include/clang/Lex/LiteralSupport.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h
index 6142f006c5..90ca58bff9 100644
--- a/include/clang/Lex/LiteralSupport.h
+++ b/include/clang/Lex/LiteralSupport.h
@@ -128,6 +128,7 @@ class CharLiteralParser {
tok::TokenKind Kind;
bool IsMultiChar;
bool HadError;
+ SmallString<32> UDSuffixBuf;
public:
CharLiteralParser(const char *begin, const char *end,
SourceLocation Loc, Preprocessor &PP,
@@ -140,6 +141,7 @@ public:
bool isUTF32() const { return Kind == tok::utf32_char_constant; }
bool isMultiChar() const { return IsMultiChar; }
uint64_t getValue() const { return Value; }
+ StringRef getUDSuffix() const { return UDSuffixBuf; }
};
/// StringLiteralParser - This decodes string escape characters and performs
@@ -157,6 +159,7 @@ class StringLiteralParser {
tok::TokenKind Kind;
SmallString<512> ResultBuf;
char *ResultPtr; // cursor
+ SmallString<32> UDSuffixBuf;
public:
StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
Preprocessor &PP, bool Complain = true);
@@ -196,6 +199,8 @@ public:
bool isUTF32() const { return Kind == tok::utf32_string_literal; }
bool isPascal() const { return Pascal; }
+ StringRef getUDSuffix() const { return UDSuffixBuf; }
+
private:
void init(const Token *StringToks, unsigned NumStringToks);
bool CopyStringFragment(StringRef Fragment);