summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-30 01:26:17 +0000
committerChris Lattner <sabre@nondot.org>2009-06-30 01:26:17 +0000
commitc61089a6c231ecf07631d767d2d1db0ec0816262 (patch)
tree28387b2d56261ad228979fd386635c9d12f4eae1 /clang/lib/Frontend/RewriteObjC.cpp
parente8eca73cddbf6a6b4adb07b7eef403226b8a6798 (diff)
downloadbcm5719-llvm-c61089a6c231ecf07631d767d2d1db0ec0816262.tar.gz
bcm5719-llvm-c61089a6c231ecf07631d767d2d1db0ec0816262.zip
Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.
This is simple enough, but then I thought it would be nice to make PrintingPolicy get a LangOptions so that various things can key off "bool" and "C++" independently. This spiraled out of control. There are many fixme's, but I think things are slightly better than they were before. One thing that can be improved: CFG should probably have an ASTContext pointer in it, which would simplify its clients. llvm-svn: 74493
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r--clang/lib/Frontend/RewriteObjC.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index dce271070e0..6c1c10278a3 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -171,7 +171,7 @@ namespace {
// Get the new text.
std::string SStr;
llvm::raw_string_ostream S(SStr);
- New->printPretty(S, *Context);
+ New->printPretty(S, *Context, 0, PrintingPolicy(LangOpts));
const std::string &Str = S.str();
// If replacement succeeded or warning disabled return with no warning.
@@ -1514,7 +1514,8 @@ Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
SourceLocation());
std::string syncExprBufS;
llvm::raw_string_ostream syncExprBuf(syncExprBufS);
- syncExpr->printPretty(syncExprBuf, *Context);
+ syncExpr->printPretty(syncExprBuf, *Context, 0,
+ PrintingPolicy(LangOpts));
buf += syncExprBuf.str();
buf += ");\n";
buf += " if (_rethrow) objc_exception_throw(_rethrow);\n";
@@ -2143,7 +2144,8 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
// The pretty printer for StringLiteral handles escape characters properly.
std::string prettyBufS;
llvm::raw_string_ostream prettyBuf(prettyBufS);
- Exp->getString()->printPretty(prettyBuf, *Context);
+ Exp->getString()->printPretty(prettyBuf, *Context, 0,
+ PrintingPolicy(LangOpts));
Preamble += prettyBuf.str();
Preamble += ",";
// The minus 2 removes the begin/end double quotes.
OpenPOWER on IntegriCloud