]> granicus.if.org Git - clang/commitdiff
Add enum type conversion policies, patch by Keith Bauer
authorChris Lattner <sabre@nondot.org>
Mon, 27 Aug 2007 16:48:59 +0000 (16:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 27 Aug 2007 16:48:59 +0000 (16:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41495 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TargetInfo.h

index 4b8e0d0ca384413d6d263217585f8915cc655347..582e31f0e2e3fde4ada604e86845fe779a390f38 100644 (file)
@@ -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) {