From: Daniel Dunbar Date: Fri, 9 Mar 2012 20:02:54 +0000 (+0000) Subject: [AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29c6c6ef2459195ed2031b97e65a0787e43c1585;p=clang [AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152430 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 425ee3cdb2..ab1e52d255 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -34,6 +34,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/Compiler.h" #include namespace llvm { @@ -1225,7 +1226,8 @@ public: private: CanQualType getFromTargetType(unsigned Type) const; - std::pair getTypeInfoImpl(const Type *T) const; + std::pair + getTypeInfoImpl(const Type *T) const LLVM_READONLY; //===--------------------------------------------------------------------===// // Type Predicates. @@ -1259,8 +1261,8 @@ public: /// getTypeInfo - Get the size and alignment of the specified complete type in /// bits. - std::pair getTypeInfo(const Type *T) const; - std::pair getTypeInfo(QualType T) const { + std::pair getTypeInfo(const Type *T) const LLVM_READONLY; + std::pair getTypeInfo(QualType T) const LLVM_READONLY { return getTypeInfo(T.getTypePtr()); } @@ -1661,7 +1663,7 @@ public: // The width of an integer, as defined in C99 6.2.6.2. This is the number // of bits in an integer type excluding any padding bits. - unsigned getIntWidth(QualType T) const; + unsigned getIntWidth(QualType T) const LLVM_READONLY; // Per C99 6.2.5p6, for every signed integer type, there is a corresponding // unsigned integer type. This method takes a signed type, and returns the