diff --git a/include/llvm/Support/EndianStream.h b/include/llvm/Support/EndianStream.h index 81908e9e5f10..43ecd4a5c97e 100644 --- a/include/llvm/Support/EndianStream.h +++ b/include/llvm/Support/EndianStream.h @@ -28,10 +28,8 @@ template struct Writer { raw_ostream &OS; Writer(raw_ostream &OS) : OS(OS) {} template void write(ArrayRef Vals) { - for (value_type V : Vals) { - value_type Swaped = byte_swap(V); - OS.write((const char *)&Swaped, sizeof(value_type)); - } + for (value_type V : Vals) + write(V); } template void write(value_type Val) { Val = byte_swap(Val);