r287859 - [ASTDumper] Add some more character escapes for convenience.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 24 01:41:34 PST 2016
Author: d0k
Date: Thu Nov 24 03:41:33 2016
New Revision: 287859
URL: http://llvm.org/viewvc/llvm-project?rev=287859&view=rev
Log:
[ASTDumper] Add some more character escapes for convenience.
Modified:
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/test/Misc/ast-dump-wchar.cpp
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=287859&r1=287858&r2=287859&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu Nov 24 03:41:33 2016
@@ -970,10 +970,13 @@ void StringLiteral::outputString(raw_ost
// Handle some common non-printable cases to make dumps prettier.
case '\\': OS << "\\\\"; break;
case '"': OS << "\\\""; break;
- case '\n': OS << "\\n"; break;
- case '\t': OS << "\\t"; break;
case '\a': OS << "\\a"; break;
case '\b': OS << "\\b"; break;
+ case '\f': OS << "\\f"; break;
+ case '\n': OS << "\\n"; break;
+ case '\r': OS << "\\r"; break;
+ case '\t': OS << "\\t"; break;
+ case '\v': OS << "\\v"; break;
}
}
OS << '"';
Modified: cfe/trunk/test/Misc/ast-dump-wchar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-wchar.cpp?rev=287859&r1=287858&r2=287859&view=diff
==============================================================================
--- cfe/trunk/test/Misc/ast-dump-wchar.cpp (original)
+++ cfe/trunk/test/Misc/ast-dump-wchar.cpp Thu Nov 24 03:41:33 2016
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -std=c++11 -ast-dump %s -triple x86_64-linux-gnu | FileCheck %s
-char c8[] = u8"test\0\\\"\t\a\b\234";
-// CHECK: StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234"
+char c8[] = u8"test\0\\\"\a\b\f\n\r\t\v\234";
+// CHECK: StringLiteral {{.*}} lvalue u8"test\000\\\"\a\b\f\n\r\t\v\234"
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";
// CHECK: StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234"
More information about the cfe-commits
mailing list