summaryrefslogtreecommitdiffstats
path: root/clang/tools
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/tools
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/tools')
-rw-r--r--clang/tools/clang-cc/clang-cc.cpp3
-rw-r--r--clang/tools/index-test/index-test.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/tools/clang-cc/clang-cc.cpp b/clang/tools/clang-cc/clang-cc.cpp
index 641d1195c26..f1b10c56db1 100644
--- a/clang/tools/clang-cc/clang-cc.cpp
+++ b/clang/tools/clang-cc/clang-cc.cpp
@@ -784,6 +784,9 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
if (AccessControl)
Options.AccessControl = 1;
+ // OpenCL and C++ both have bool, true, false keywords.
+ Options.Bool = Options.OpenCL | Options.CPlusPlus;
+
Options.MathErrno = MathErrno;
Options.InstantiationDepth = TemplateDepth;
diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp
index d851f5c90bb..9b10c55bde0 100644
--- a/clang/tools/index-test/index-test.cpp
+++ b/clang/tools/index-test/index-test.cpp
@@ -133,7 +133,8 @@ int main(int argc, char **argv) {
if (Point.Node) {
OS << "Statement node at point: " << Point.Node->getStmtClassName()
<< " ";
- Point.Node->printPretty(OS, AST->getASTContext());
+ Point.Node->printPretty(OS, AST->getASTContext(), 0,
+ PrintingPolicy(AST->getASTContext().getLangOptions()));
OS << "\n";
}
}
OpenPOWER on IntegriCloud