summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-04-24 15:39:47 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-04-24 15:39:47 +0000
commit24a86df13e4272ad5a492dd80741782896606e81 (patch)
tree6e6062075765b621fbe41e4df0364d69626c845d /llvm/lib/Support
parent957a81d75c224ffc468c59a25d146ece5364b4d8 (diff)
downloadbcm5719-llvm-24a86df13e4272ad5a492dd80741782896606e81.tar.gz
bcm5719-llvm-24a86df13e4272ad5a492dd80741782896606e81.zip
Use the cleaner syntx value initialization to zero initialize POD structs.
Suggestion from David Blaikie! llvm-svn: 235721
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Windows/Signals.inc9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc
index d6de403f259..d81d3c8b90b 100644
--- a/llvm/lib/Support/Windows/Signals.inc
+++ b/llvm/lib/Support/Windows/Signals.inc
@@ -247,9 +247,8 @@ static void PrintStackTraceForThread(llvm::raw_ostream &OS, HANDLE hProcess,
OS << format(", %s", (const char*)symbol->Name);
// Print the source file and line number information.
- IMAGEHLP_LINE64 line;
+ IMAGEHLP_LINE64 line = {};
DWORD dwLineDisp;
- memset(&line, 0, sizeof(line));
line.SizeOfStruct = sizeof(line);
if (SymGetLineFromAddr64(hProcess, PC, &dwLineDisp, &line)) {
OS << format(", %s, line %lu", line.FileName, line.LineNumber);
@@ -404,8 +403,7 @@ extern "C" VOID WINAPI RtlCaptureContext(PCONTEXT ContextRecord);
void llvm::sys::PrintStackTrace(raw_ostream &OS) {
STACKFRAME64 StackFrame = {};
- CONTEXT Context;
- memset(&Context, 0, sizeof(Context));
+ CONTEXT Context = {};
::RtlCaptureContext(&Context);
#if defined(_M_X64)
StackFrame.AddrPC.Offset = Context.Rip;
@@ -477,8 +475,7 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
Cleanup();
// Initialize the STACKFRAME structure.
- STACKFRAME64 StackFrame;
- memset(&StackFrame, 0, sizeof(StackFrame));
+ STACKFRAME64 StackFrame = {};
#if defined(_M_X64)
StackFrame.AddrPC.Offset = ep->ContextRecord->Rip;
OpenPOWER on IntegriCloud