[cfe-commits] r56859 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/SemaExpr.cpp

Daniel Dunbar daniel at zuster.org
Tue Sep 30 10:22:49 PDT 2008


Author: ddunbar
Date: Tue Sep 30 12:22:47 2008
New Revision: 56859

URL: http://llvm.org/viewvc/llvm-project?rev=56859&view=rev
Log:
Add diagnostic for .{lo,hi,e,o} on odd-sized extended vectors.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticKinds.def
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=56859&r1=56858&r2=56859&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Tue Sep 30 12:22:47 2008
@@ -678,6 +678,8 @@
      "ext_vector_type only applies to types, not variables")
 DIAG(err_ext_vector_component_exceeds_length, ERROR,
      "vector component access exceeds type '%0'")
+DIAG(err_ext_vector_component_requires_even, ERROR,
+     "vector component access invalid for odd-sized type '%0'")
 DIAG(err_ext_vector_component_name_illegal, ERROR,
      "illegal vector component name '%0'")
 DIAG(err_ext_vector_component_access, ERROR,

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Sep 30 12:22:47 2008
@@ -846,6 +846,8 @@
   // is an even number, since all special component names return exactly half
   // the elements.
   if (SpecialComponent && (vecType->getNumElements() & 1U)) {
+    Diag(OpLoc, diag::err_ext_vector_component_requires_even, 
+         baseType.getAsString(), SourceRange(CompLoc));
     return QualType();
   }
   





More information about the cfe-commits mailing list