[cfe-commits] r84746 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/TargetInfo.cpp

Daniel Dunbar daniel at zuster.org
Sun Oct 25 15:45:57 PDT 2009


On Tue, Oct 20, 2009 at 11:24 PM, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Wed Oct 21 01:24:21 2009
> New Revision: 84746
>
> URL: http://llvm.org/viewvc/llvm-project?rev=84746&view=rev
> Log:
> add helpful methods to TargetInfo for querying builtin integer type properties,
> patch by Ken Dyck!
>
> Modified:
>    cfe/trunk/include/clang/Basic/TargetInfo.h
>    cfe/trunk/lib/Basic/TargetInfo.cpp
>
> Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=84746&r1=84745&r2=84746&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
> +++ cfe/trunk/include/clang/Basic/TargetInfo.h Wed Oct 21 01:24:21 2009
> @@ -98,6 +98,15 @@
>   IntType getChar32Type() const { return Char32Type; }
>   IntType getInt64Type() const { return Int64Type; }
>
> +
> +  /// getTypeWidth - Return the width (in bits) of the specified integer type
> +  /// enum. For example, SignedInt -> getIntWidth().
> +  unsigned getTypeWidth(IntType T) const;
> +
> +  /// getTypeSigned - Return whether an integer types is signed. Returns true if
> +  /// the type is signed; false otherwise.
> +  bool getTypeSigned(IntType T) const;

Wouldn't isTypeSigned be more in keeping with current naming
conventions? I expect getTypeSigned to give me back a signed version
of the type, or something.

 - Daniel




More information about the cfe-commits mailing list