aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclFriend.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-03-09 19:35:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-03-09 19:35:29 +0000
commitaa49a7d70e58dac2aeb40664ba16d2ea571b8c95 (patch)
treed6c58d018f3509885a65e12c0a67f37e67c8901b /include/clang/AST/DeclFriend.h
parent69e7692ded200fc5c4afb651603316d7576f863b (diff)
[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
- The theory here is that we have these functions sprinkled in all over the place. This should allow the optimizer to at least realize it can still do load CSE across these calls. - I blindly marked all instances as such, even though the optimizer can infer this attribute in some instances (some of the inline ones) as that was easier and also, when given the choice between thinking and not thinking, I prefer the latter. You might think this is mere frivolity, but actually this is good for a .7 - 1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp, OGF/NSBezierPath-OAExtensions.m. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclFriend.h')
-rw-r--r--include/clang/AST/DeclFriend.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h
index d8fd646dcd..ba1eb8d729 100644
--- a/include/clang/AST/DeclFriend.h
+++ b/include/clang/AST/DeclFriend.h
@@ -16,6 +16,7 @@
#define LLVM_CLANG_AST_DECLFRIEND_H
#include "clang/AST/DeclCXX.h"
+#include "llvm/Support/Compiler.h"
namespace clang {
@@ -100,7 +101,7 @@ public:
}
/// Retrieves the source range for the friend declaration.
- SourceRange getSourceRange() const {
+ SourceRange getSourceRange() const LLVM_READONLY {
/* FIXME: consider the case of templates wrt start of range. */
if (NamedDecl *ND = getFriendDecl())
return SourceRange(getFriendLoc(), ND->getLocEnd());