[cfe-commits] r49101 - in /cfe/trunk/lib: Analysis/GRExprEngine.cpp Analysis/GRSimpleVals.cpp Analysis/RValues.cpp CodeGen/CodeGenFunction.cpp Sema/SemaExpr.cpp

Chris Lattner sabre at nondot.org
Wed Apr 2 10:45:07 PDT 2008


Author: lattner
Date: Wed Apr  2 12:45:06 2008
New Revision: 49101

URL: http://llvm.org/viewvc/llvm-project?rev=49101&view=rev
Log:
simplify some code by using PointerLikeType.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp
    cfe/trunk/lib/Analysis/RValues.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=49101&r1=49100&r2=49101&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Apr  2 12:45:06 2008
@@ -1201,7 +1201,7 @@
   
   QualType T = R->getType();
   
-  if (T->isPointerType() || T->isReferenceType()) {
+  if (T->isPointerLikeType()) {
     
     // Check if any of the return values return the address of a stack variable.
     

Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=49101&r1=49100&r2=49101&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Wed Apr  2 12:45:06 2008
@@ -356,7 +356,7 @@
 
 RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, LVal X, QualType T) {
   
-  if (T->isPointerType() || T->isReferenceType() || T->isObjCQualifiedIdType())
+  if (T->isPointerLikeType() || T->isObjCQualifiedIdType())
     return X;
   
   assert (T->isIntegerType());

Modified: cfe/trunk/lib/Analysis/RValues.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RValues.cpp?rev=49101&r1=49100&r2=49101&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RValues.cpp (original)
+++ cfe/trunk/lib/Analysis/RValues.cpp Wed Apr  2 12:45:06 2008
@@ -225,10 +225,9 @@
 
   QualType T = D->getType();
   
-  if (T->isPointerType() || T->isReferenceType())
+  if (T->isPointerLikeType())
     return lval::SymbolVal(SymMgr.getSymbol(D));
-  else
-    return nonlval::SymbolVal(SymMgr.getSymbol(D));
+  return nonlval::SymbolVal(SymMgr.getSymbol(D));
 }
 
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=49101&r1=49100&r2=49101&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Wed Apr  2 12:45:06 2008
@@ -51,7 +51,7 @@
 }
 
 bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
-  return !T->isRealType() && !T->isPointerType() && !T->isReferenceType() &&
+  return !T->isRealType() && !T->isPointerLikeType() &&
          !T->isVoidType() && !T->isVectorType() && !T->isFunctionType();
 }
 

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=49101&r1=49100&r2=49101&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Apr  2 12:45:06 2008
@@ -927,7 +927,7 @@
   assert(!Ty.isNull() && "DefaultFunctionArrayConversion - missing type");
 
   if (const ReferenceType *ref = Ty->getAsReferenceType()) {
-    ImpCastExprToType(E, ref->getReferenceeType()); // C++ [expr]
+    ImpCastExprToType(E, ref->getPointeeType()); // C++ [expr]
     Ty = E->getType();
   }
   if (Ty->isFunctionType())
@@ -946,7 +946,7 @@
   assert(!Ty.isNull() && "UsualUnaryConversions - missing type");
   
   if (const ReferenceType *Ref = Ty->getAsReferenceType()) {
-    ImpCastExprToType(Expr, Ref->getReferenceeType()); // C++ [expr]
+    ImpCastExprToType(Expr, Ref->getPointeeType()); // C++ [expr]
     Ty = Expr->getType();
   }
   if (Ty->isPromotableIntegerType()) // C99 6.3.1.1p2





More information about the cfe-commits mailing list