From 0f7f10bd0ea08abf56c69fea9316275a1ee0e40c Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 18 Jul 2012 20:54:32 +0000 Subject: Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160452 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Comment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/AST/Comment.cpp') diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index e215e63dec..f3f4d9bf16 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -100,7 +100,7 @@ Comment::child_iterator Comment::child_end() const { llvm_unreachable("Unknown comment kind!"); } -bool TextComment::isWhitespace() const { +bool TextComment::isWhitespaceNoCache() const { for (StringRef::const_iterator I = Text.begin(), E = Text.end(); I != E; ++I) { const char C = *I; @@ -111,7 +111,7 @@ bool TextComment::isWhitespace() const { return true; } -bool ParagraphComment::isWhitespace() const { +bool ParagraphComment::isWhitespaceNoCache() const { for (child_iterator I = child_begin(), E = child_end(); I != E; ++I) { if (const TextComment *TC = dyn_cast(*I)) { if (!TC->isWhitespace()) -- cgit v1.2.3-70-g09d2