summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-08-15 18:03:58 +0000
committerReid Kleckner <reid@kleckner.net>2014-08-15 18:03:58 +0000
commita6b86bef4d5f09db3e3c9906628a0b637af9ace8 (patch)
tree1fc2f530584d3a8450b7e58fb55eda6394b70db9 /llvm/lib
parent39945dcc0ba585b111a06cbe5fb9e9416676a1dc (diff)
downloadbcm5719-llvm-a6b86bef4d5f09db3e3c9906628a0b637af9ace8.tar.gz
bcm5719-llvm-a6b86bef4d5f09db3e3c9906628a0b637af9ace8.zip
Fix the build with MSVC 2013 after new shuffle code
MSVC gives this awesome diagnostic: ..\lib\Target\X86\X86ISelLowering.cpp(7085) : error C2971: 'llvm::VariadicFunction1' : template parameter 'Func' : 'isShuffleEquivalentImpl' : a local variable cannot be used as a non-type argument ..\include\llvm/ADT/VariadicFunction.h(153) : see declaration of 'llvm::VariadicFunction1' ..\lib\Target\X86\X86ISelLowering.cpp(7061) : see declaration of 'isShuffleEquivalentImpl' Using an anonymous namespace makes the problem go away. llvm-svn: 215744
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index b31aa446998..5dd85f4e28f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -7055,11 +7055,14 @@ static bool isSingleInputShuffleMask(ArrayRef<int> Mask) {
return true;
}
+// Hide this symbol with an anonymous namespace instead of 'static' so that MSVC
+// 2013 will allow us to use it as a non-type template parameter.
+namespace {
+
/// \brief Implementation of the \c isShuffleEquivalent variadic functor.
///
/// See its documentation for details.
-static bool isShuffleEquivalentImpl(ArrayRef<int> Mask,
- ArrayRef<const int *> Args) {
+bool isShuffleEquivalentImpl(ArrayRef<int> Mask, ArrayRef<const int *> Args) {
if (Mask.size() != Args.size())
return false;
for (int i = 0, e = Mask.size(); i < e; ++i) {
@@ -7071,6 +7074,9 @@ static bool isShuffleEquivalentImpl(ArrayRef<int> Mask,
}
return true;
}
+
+} // namespace
+
/// \brief Checks whether a shuffle mask is equivalent to an explicit list of
/// arguments.
///
OpenPOWER on IntegriCloud