[PATCH] [libcxxabi] replace bzero with memset

Jon Roelofs jonathan at codesourcery.com
Wed Apr 16 15:07:02 PDT 2014


  Removed the arm bits for now.

Hi nlewycky,

http://reviews.llvm.org/D3385

CHANGE SINCE LAST DIFF
  http://reviews.llvm.org/D3385?vs=8539&id=8587#toc

Files:
  src/Unwind/Registers.hpp

Index: src/Unwind/Registers.hpp
===================================================================
--- src/Unwind/Registers.hpp
+++ src/Unwind/Registers.hpp
@@ -15,6 +15,7 @@
 
 #include <stdint.h>
 #include <strings.h>
+#include <string.h>
 
 #include "libunwind.h"
 #include "config.h"
@@ -91,7 +92,7 @@
 }
 
 inline Registers_x86::Registers_x86() {
-  bzero(&_registers, sizeof(_registers));
+  memset(&_registers, 0, sizeof(_registers));
 }
 
 inline bool Registers_x86::validRegister(int regNum) const {
@@ -282,7 +283,7 @@
 }
 
 inline Registers_x86_64::Registers_x86_64() {
-  bzero(&_registers, sizeof(_registers));
+  memset(&_registers, 0, sizeof(_registers));
 }
 
 inline bool Registers_x86_64::validRegister(int regNum) const {
@@ -548,9 +549,9 @@
 }
 
 inline Registers_ppc::Registers_ppc() {
-  bzero(&_registers, sizeof(_registers));
-  bzero(&_floatRegisters, sizeof(_floatRegisters));
-  bzero(&_vectorRegisters, sizeof(_vectorRegisters));
+  memset(&_registers, 0, sizeof(_registers));
+  memset(&_floatRegisters, 0, sizeof(_floatRegisters));
+  memset(&_vectorRegisters, 0, sizeof(_vectorRegisters));
 }
 
 inline bool Registers_ppc::validRegister(int regNum) const {
@@ -1065,8 +1066,8 @@
 }
 
 inline Registers_arm64::Registers_arm64() {
-  bzero(&_registers, sizeof(_registers));
-  bzero(&_vectorHalfRegisters, sizeof(_vectorHalfRegisters));
+  memset(&_registers, 0, sizeof(_registers));
+  memset(&_vectorHalfRegisters, 0, sizeof(_vectorHalfRegisters));
 }
 
 inline bool Registers_arm64::validRegister(int regNum) const {
@@ -1329,7 +1330,7 @@
 }
 
 inline Registers_arm::Registers_arm() {
-  bzero(&_registers, sizeof(_registers));
+  memset(&_registers, 0, sizeof(_registers));
 }
 
 inline bool Registers_arm::validRegister(int regNum) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3385.2.patch
Type: text/x-patch
Size: 1775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140416/cd8a28c0/attachment.bin>


More information about the cfe-commits mailing list