diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-14 04:51:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-14 04:51:15 +0000 |
commit | b792b30ce3d31e3eb3cfee3321238cf3cc2165b0 (patch) | |
tree | e4d20e9b9ee47c3d8ad84f9cb695678f86a6e3a9 /lib/Sema/SemaChecking.cpp | |
parent | fd05ca03abdfb38f78b9535d996ecc9c39d3b0db (diff) |
fix rdar://9546171 - -Wshorten-64-to-32 shouldn't warn on vector bitcasts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 8dc54ae553..9c47e1e1e2 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2895,6 +2895,11 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, return; return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_vector_scalar); } + + // If the vector cast is cast between two vectors of the same size, it is + // a bitcast, not a conversion. + if (S.Context.getTypeSize(Source) == S.Context.getTypeSize(Target)) + return; Source = cast<VectorType>(Source)->getElementType().getTypePtr(); Target = cast<VectorType>(Target)->getElementType().getTypePtr(); @@ -2989,9 +2994,7 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, return; } - // People want to build with -Wshorten-64-to-32 and not -Wconversion - // and by god we'll let them. - + // People want to build with -Wshorten-64-to-32 and not -Wconversion. if (isFromSystemMacro(S, CC)) return; |