[llvm] r372811 - [NFC] Add { } to silence compiler warning [-Wmissing-braces].
Huihui Zhang via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 21:40:07 PDT 2019
Author: huihuiz
Date: Tue Sep 24 21:40:07 2019
New Revision: 372811
URL: http://llvm.org/viewvc/llvm-project?rev=372811&view=rev
Log:
[NFC] Add { } to silence compiler warning [-Wmissing-braces].
/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Object/MachOObjectFile.cpp:2731:7: warning: suggest braces around initialization of subobject [-Wmissing-braces]
"i386", "x86_64", "x86_64h", "armv4t", "arm", "armv5e",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
1 warning generated.
/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:46: warning: suggest braces around initialization of subobject [-Wmissing-braces]
return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
^
{}
1 warning generated.
/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp:400:57: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
^~~~~~~~~~~~~~~~~~
{ }
1 warning generated.
Modified:
llvm/trunk/lib/Object/MachOObjectFile.cpp
llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=372811&r1=372810&r2=372811&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp Tue Sep 24 21:40:07 2019
@@ -2727,11 +2727,11 @@ bool MachOObjectFile::isValidArch(String
}
ArrayRef<StringRef> MachOObjectFile::getValidArchs() {
- static const std::array<StringRef, 17> validArchs = {
+ static const std::array<StringRef, 17> validArchs = {{
"i386", "x86_64", "x86_64h", "armv4t", "arm", "armv5e",
"armv6", "armv6m", "armv7", "armv7em", "armv7k", "armv7m",
"armv7s", "arm64", "arm64_32", "ppc", "ppc64",
- };
+ }};
return validArchs;
}
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp?rev=372811&r1=372810&r2=372811&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp Tue Sep 24 21:40:07 2019
@@ -352,7 +352,7 @@ AMDGPURegisterBankInfo::getInstrAlternat
{ { AMDGPU::SGPRRegBankID }, 1 }
};
- return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
+ return addMappingFromTable<1>(MI, MRI, {{ 0 }}, Table);
}
case TargetOpcode::G_AND:
case TargetOpcode::G_OR:
Modified: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp?rev=372811&r1=372810&r2=372811&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp Tue Sep 24 21:40:07 2019
@@ -397,7 +397,7 @@ void SectionWriter::visit(const OwnedDat
llvm::copy(Sec.Data, Out.getBufferStart() + Sec.Offset);
}
-static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
+static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {{'Z', 'L', 'I', 'B'}};
static bool isDataGnuCompressed(ArrayRef<uint8_t> Data) {
return Data.size() > ZlibGnuMagic.size() &&
More information about the llvm-commits
mailing list