summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-06-23 23:01:47 +0000
committerChris Bieneman <beanz@apple.com>2016-06-23 23:01:47 +0000
commit606f178aeb0feced07a7384bd44fdc750d58728b (patch)
treedc9700568dcdf5ff9ba1542ce9bce83adc1c74e8 /llvm/lib/ObjectYAML/MachOYAML.cpp
parent4b63a98de3589a8f62629cfcffc4b022d2716873 (diff)
downloadbcm5719-llvm-606f178aeb0feced07a7384bd44fdc750d58728b.tar.gz
bcm5719-llvm-606f178aeb0feced07a7384bd44fdc750d58728b.zip
[MachOYAML] Use a temporary to avoid gcc strict-aliasing warning
GCC complains about this with -Wstrict-aliasing. Using a temporary here should prevent the warning. llvm-svn: 273627
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index d13c84eb04f..890bc039956 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -182,8 +182,10 @@ void mapLoadCommandData<MachO::dylinker_command>(
void MappingTraits<MachOYAML::LoadCommand>::mapping(
IO &IO, MachOYAML::LoadCommand &LoadCommand) {
- IO.mapRequired(
- "cmd", (MachO::LoadCommandType &)LoadCommand.Data.load_command_data.cmd);
+ MachO::LoadCommandType TempCmd = static_cast<MachO::LoadCommandType>(
+ LoadCommand.Data.load_command_data.cmd);
+ IO.mapRequired("cmd", TempCmd);
+ LoadCommand.Data.load_command_data.cmd = TempCmd;
IO.mapRequired("cmdsize", LoadCommand.Data.load_command_data.cmdsize);
#define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) \
OpenPOWER on IntegriCloud