OSDN Git Service

Subzero: Fix asm (non-ELF) output files.
authorJim Stichnoth <stichnot@chromium.org>
Tue, 28 Apr 2015 21:12:20 +0000 (14:12 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Tue, 28 Apr 2015 21:12:20 +0000 (14:12 -0700)
commit620ad732db0def93eee3928f9ebebe88b279f63d
tree3849de784aab5a48aab339c6966e0e15a2629f3e
parent2f67b929c15a30d5ed43b9929cac95a96fec0bbe
Subzero: Fix asm (non-ELF) output files.

In an earlier version of Subzero, the text output stream object was
stack-allocated within main.  A later refactoring moved its allocation
into a helper function, but it was still being stack-allocated, which
was bad when the helper function returned.

This change allocates the object via "new", which fixes that problem,
but reveals another problem: the raw_ostream object for some reason
doesn't finish writing everything to disk and yielding a truncated
output file.  This is solved in the style of the ELF streamer, by
using raw_fd_ostream instead.

BUG= none
R=kschimpf@google.com

Review URL: https://codereview.chromium.org/1111603003
src/IceBrowserCompileServer.h
src/IceCompileServer.cpp
src/IceGlobalContext.h