[cfe-commits] r49298 - /cfe/trunk/lib/AST/ASTContext.cpp

Chris Lattner sabre at nondot.org
Sun Apr 6 16:58:54 PDT 2008


Author: lattner
Date: Sun Apr  6 18:58:54 2008
New Revision: 49298

URL: http://llvm.org/viewvc/llvm-project?rev=49298&view=rev
Log:
trivial changes to getFloatingTypeOfSizeWithinDomain, nothing significant.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=49298&r1=49297&r2=49298&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Sun Apr  6 18:58:54 2008
@@ -1026,28 +1026,25 @@
 /// point or a complex type (based on typeDomain/typeSize). 
 /// 'typeDomain' is a real floating point or complex type.
 /// 'typeSize' is a real floating point or complex type.
-QualType ASTContext::getFloatingTypeOfSizeWithinDomain(
-  QualType typeSize, QualType typeDomain) const {
-  if (typeDomain->isComplexType()) {
-    switch (getFloatingRank(typeSize)) {
+QualType ASTContext::getFloatingTypeOfSizeWithinDomain(QualType Size,
+                                                       QualType Domain) const {
+  FloatingRank EltRank = getFloatingRank(Size);
+  if (Domain->isComplexType()) {
+    switch (EltRank) {
     default: assert(0 && "getFloatingRank(): illegal value for rank");
     case FloatRank:      return FloatComplexTy;
     case DoubleRank:     return DoubleComplexTy;
     case LongDoubleRank: return LongDoubleComplexTy;
     }
   }
-  if (typeDomain->isRealFloatingType()) {
-    switch (getFloatingRank(typeSize)) {
-    default: assert(0 && "getFloatingRank(): illegal value for rank");
-    case FloatRank:      return FloatTy;
-    case DoubleRank:     return DoubleTy;
-    case LongDoubleRank: return LongDoubleTy;
-    }
+
+  assert(Domain->isRealFloatingType() && "Unknown domain!");
+  switch (EltRank) {
+  default: assert(0 && "getFloatingRank(): illegal value for rank");
+  case FloatRank:      return FloatTy;
+  case DoubleRank:     return DoubleTy;
+  case LongDoubleRank: return LongDoubleTy;
   }
-  assert(0 && "getFloatingTypeOfSizeWithinDomain(): illegal domain");
-  //an invalid return value, but the assert
-  //will ensure that this code is never reached.
-  return VoidTy;
 }
 
 /// getFloatingTypeOrder - Compare the rank of the two specified floating





More information about the cfe-commits mailing list