[cfe-commits] r39470 - /cfe/cfe/trunk/include/clang/Basic/TargetInfo.h

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:44:45 PDT 2007


Author: clattner
Date: Wed Jul 11 11:44:45 2007
New Revision: 39470

URL: http://llvm.org/viewvc/llvm-project?rev=39470&view=rev
Log:
add interfaces to get sizes of target integer types.

Modified:
    cfe/cfe/trunk/include/clang/Basic/TargetInfo.h

Modified: cfe/cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=39470&r1=39469&r2=39470&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/TargetInfo.h Wed Jul 11 11:44:45 2007
@@ -104,18 +104,40 @@
     return true;
   }
   
+  /// getBoolWidth - Return the size of '_Bool' and C++ 'bool' for this target,
+  /// in bits.  
+  unsigned getBoolWidth(SourceLocation Loc) {
+    return 8;    // FIXME: implement correctly: wrong for ppc32.
+  }
+  
   /// getCharWidth - Return the size of 'char', 'signed char' and
   /// 'unsigned char' for this target, in bits.  
   unsigned getCharWidth(SourceLocation Loc) {
-    // FIXME: implement correctly.
-    return 8;
+    return 8; // FIXME: implement correctly.
+  }
+  
+  /// getShortWidth - Return the size of 'signed short' and 'unsigned short' for
+  /// this target, in bits.  
+  unsigned getShortWidth(SourceLocation Loc) {
+    return 16; // FIXME: implement correctly.
   }
   
   /// getIntWidth - Return the size of 'signed int' and 'unsigned int' for this
   /// target, in bits.  
   unsigned getIntWidth(SourceLocation Loc) {
-    // FIXME: implement correctly.
-    return 32;
+    return 32; // FIXME: implement correctly.
+  }
+  
+  /// getLongWidth - Return the size of 'signed long' and 'unsigned long' for
+  /// this target, in bits.  
+  unsigned getLongWidth(SourceLocation Loc) {
+    return 32;  // FIXME: implement correctly: wrong for ppc64/x86-64
+  }
+
+  /// getLongLongWidth - Return the size of 'signed long long' and
+  /// 'unsigned long long' for this target, in bits.  
+  unsigned getLongLongWidth(SourceLocation Loc) {
+    return 64; // FIXME: implement correctly.
   }
   
   /// getWCharWidth - Return the size of wchar_t in bits.





More information about the cfe-commits mailing list