r205718 - Revert r205646 (keeping the test in its modified form) as

Fariborz Jahanian fjahanian at apple.com
Mon Apr 7 09:32:54 PDT 2014


Author: fjahanian
Date: Mon Apr  7 11:32:54 2014
New Revision: 205718

URL: http://llvm.org/viewvc/llvm-project?rev=205718&view=rev
Log:
Revert r205646 (keeping the test in its modified form) as
it is subsumed by r205521.

Modified:
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/test/Sema/conversion.c

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=205718&r1=205717&r2=205718&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Apr  7 11:32:54 2014
@@ -6113,21 +6113,12 @@ void CheckConditionalOperator(Sema &S, C
 /// implicit conversions in the given expression.  There are a couple
 /// of competing diagnostics here, -Wconversion and -Wsign-compare.
 void AnalyzeImplicitConversions(Sema &S, Expr *OrigE, SourceLocation CC) {
+  QualType T = OrigE->getType();
   Expr *E = OrigE->IgnoreParenImpCasts();
 
   if (E->isTypeDependent() || E->isValueDependent())
     return;
   
-  QualType T = OrigE->getType();
-  // Check for conversion from an arithmetic type to a vector of arithmetic
-  // type elements. Warn if this results in truncation of each vector element.
-  if (isa<ExtVectorElementExpr>(E)) {
-    if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(OrigE))
-      if ((ICE->getCastKind() == CK_VectorSplat) &&
-          !T.isNull() && T->isExtVectorType())
-        T = cast<ExtVectorType>(T.getCanonicalType())->getElementType();
-  }
-
   // For conditional operators, we analyze the arguments as if they
   // were being fed directly into the output.
   if (isa<ConditionalOperator>(E)) {

Modified: cfe/trunk/test/Sema/conversion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/conversion.c?rev=205718&r1=205717&r2=205718&view=diff
==============================================================================
--- cfe/trunk/test/Sema/conversion.c (original)
+++ cfe/trunk/test/Sema/conversion.c Mon Apr  7 11:32:54 2014
@@ -426,6 +426,6 @@ typedef __attribute__ ((ext_vector_type(
 
 void test27(ushort16 constants) {
     uint8 pairedConstants = (uint8) constants;
-    ushort16 crCbScale = pairedConstants.s4; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'unsigned short'}}
-    ushort16 brBias = pairedConstants.s6; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'unsigned short'}}
+    ushort16 crCbScale = pairedConstants.s4; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
+    ushort16 brBias = pairedConstants.s6; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
 }





More information about the cfe-commits mailing list