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 | 05c3c755815888bef4ed12cce6effbdd54d82da7 (patch) | |
tree | 284c5b906b64a1a47878437f2b4bba128b228b83 /clang/lib/AST/Comment.cpp | |
parent | f0a48ec8f188d3c2ccb86cce027e3b3b7a231d8b (diff) | |
download | bcm5719-llvm-05c3c755815888bef4ed12cce6effbdd54d82da7.tar.gz bcm5719-llvm-05c3c755815888bef4ed12cce6effbdd54d82da7.zip |
Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().
llvm-svn: 160452
Diffstat (limited to 'clang/lib/AST/Comment.cpp')
-rw-r--r-- | clang/lib/AST/Comment.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/Comment.cpp b/clang/lib/AST/Comment.cpp index e215e63dec9..f3f4d9bf16e 100644 --- a/clang/lib/AST/Comment.cpp +++ b/clang/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()) |