[cfe-commits] r85886 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/Analysis/CFRefCount.cpp
Daniel Dunbar
daniel at zuster.org
Mon Nov 9 23:42:08 PST 2009
Note that these functions already exist on the IdentifierTable itself,
although they take an IdentifierInfo.
- Daniel
On Tue, Nov 3, 2009 at 12:00 AM, Ted Kremenek <kremenek at apple.com> wrote:
> Author: kremenek
> Date: Tue Nov 3 02:00:42 2009
> New Revision: 85886
>
> URL: http://llvm.org/viewvc/llvm-project?rev=85886&view=rev
> Log:
> Move 'static inline' functions GetNullarySelector() and GetUnarySelector() from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful.
>
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/lib/Analysis/CFRefCount.cpp
>
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=85886&r1=85885&r2=85886&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Tue Nov 3 02:00:42 2009
> @@ -1124,6 +1124,18 @@
> const ASTRecordLayout &getObjCLayout(const ObjCInterfaceDecl *D,
> const ObjCImplementationDecl *Impl);
> };
> +
> +/// @brief Utility function for constructing a nullary selector.
> +static inline Selector GetNullarySelector(const char* name, ASTContext& Ctx) {
> + IdentifierInfo* II = &Ctx.Idents.get(name);
> + return Ctx.Selectors.getSelector(0, &II);
> +}
> +
> +/// @brief Utility function for constructing an unary selector.
> +static inline Selector GetUnarySelector(const char* name, ASTContext& Ctx) {
> + IdentifierInfo* II = &Ctx.Idents.get(name);
> + return Ctx.Selectors.getSelector(1, &II);
> +}
>
> } // end namespace clang
>
>
> Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=85886&r1=85885&r2=85886&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
> +++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Nov 3 02:00:42 2009
> @@ -193,20 +193,6 @@
> } // end anonymous namespace
>
> //===----------------------------------------------------------------------===//
> -// Selector creation functions.
> -//===----------------------------------------------------------------------===//
> -
> -static inline Selector GetNullarySelector(const char* name, ASTContext& Ctx) {
> - IdentifierInfo* II = &Ctx.Idents.get(name);
> - return Ctx.Selectors.getSelector(0, &II);
> -}
> -
> -static inline Selector GetUnarySelector(const char* name, ASTContext& Ctx) {
> - IdentifierInfo* II = &Ctx.Idents.get(name);
> - return Ctx.Selectors.getSelector(1, &II);
> -}
> -
> -//===----------------------------------------------------------------------===//
> // Type querying functions.
> //===----------------------------------------------------------------------===//
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list