aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/PrintPreprocessedOutput.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Driver/PrintPreprocessedOutput.cpp b/Driver/PrintPreprocessedOutput.cpp
index a7d55df34b..d1f1cef985 100644
--- a/Driver/PrintPreprocessedOutput.cpp
+++ b/Driver/PrintPreprocessedOutput.cpp
@@ -517,7 +517,11 @@ void clang::DoPrintPreprocessedInput(unsigned MainFileID, Preprocessor &PP,
OutputChar(' ');
}
- if (Tok.getLength() < 256) {
+ if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
+ const char *Str = II->getName();
+ unsigned Len = Tok.needsCleaning() ? strlen(Str) : Tok.getLength();
+ OutputString(Str, Len);
+ } else if (Tok.getLength() < 256) {
const char *TokPtr = Buffer;
unsigned Len = PP.getSpelling(Tok, TokPtr);
OutputString(TokPtr, Len);