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
diff --git a/clang/lib/Frontend/RewriteBlocks.cpp b/clang/lib/Frontend/RewriteBlocks.cpp
index d20d5cd..2848532 100644
--- a/clang/lib/Frontend/RewriteBlocks.cpp
+++ b/clang/lib/Frontend/RewriteBlocks.cpp
@@ -724,7 +724,8 @@
BlockCall += "((struct __block_impl *)";
std::string closureExprBufStr;
llvm::raw_string_ostream closureExprBuf(closureExprBufStr);
- Exp->getCallee()->printPretty(closureExprBuf, *Context);
+ Exp->getCallee()->printPretty(closureExprBuf, *Context, 0,
+ PrintingPolicy(LangOpts));
BlockCall += closureExprBuf.str();
BlockCall += ")->FuncPtr)";
@@ -735,7 +736,7 @@
E = Exp->arg_end(); I != E; ++I) {
std::string syncExprBufS;
llvm::raw_string_ostream Buf(syncExprBufS);
- (*I)->printPretty(Buf, *Context);
+ (*I)->printPretty(Buf, *Context, 0, PrintingPolicy(LangOpts));
BlockCall += ", " + Buf.str();
}
return BlockCall;