From: Chris Lattner Date: Mon, 27 Aug 2007 16:48:59 +0000 (+0000) Subject: Add enum type conversion policies, patch by Keith Bauer X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6569ce02671c7b33995e7ff0ee8387020fca2459;p=clang Add enum type conversion policies, patch by Keith Bauer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41495 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 4b8e0d0ca3..582e31f0e2 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -172,6 +172,20 @@ public: Align = WCharAlign; } + /// EnumTypePolicy - This enum value contains a list of the various policies + /// that a target can have about how enums are converted to integer types. + enum EnumTypePolicy { + AlwaysInt, // 'int' or 'unsigned' + ShortestType // -fshort-enums + }; + + /// getEnumTypePolicy - get the target's policy for what type an enum should + /// be compatible with. + EnumTypePolicy getEnumTypePolicy(SourceLocation Loc) { + // FIXME: implement correctly + return AlwaysInt; + } + /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this /// target, in bits. unsigned getIntMaxTWidth(SourceLocation Loc) {