diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-18 20:54:32 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-18 20:54:32 +0000 |
commit | 0f7f10bd0ea08abf56c69fea9316275a1ee0e40c (patch) | |
tree | 1e350f63b69a67c9dbaa38aae690d792be09f9cd /lib/AST/Comment.cpp | |
parent | 7373ead8719ceedd21c108419159ea74b02b2461 (diff) |
Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Comment.cpp')
-rw-r--r-- | lib/AST/Comment.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<TextComment>(*I)) { if (!TC->isWhitespace()) |