Starting to split up alloy/core.h.

This commit is contained in:
Ben Vanik
2014-07-14 19:18:42 -07:00
parent e9284dfaed
commit ce70978ef6
33 changed files with 146 additions and 89 deletions

View File

@@ -11,6 +11,7 @@
#define ALLOY_FRONTEND_PPC_PPC_CONTEXT_H_
#include <alloy/core.h>
#include <alloy/vec128.h>
namespace alloy { namespace runtime {

View File

@@ -9,6 +9,9 @@
#include <alloy/frontend/ppc/ppc_disasm.h>
#include <poly/poly.h>
#include <alloy/string_buffer.h>
namespace alloy {
namespace frontend {
namespace ppc {

View File

@@ -31,11 +31,9 @@ using alloy::runtime::Runtime;
using alloy::runtime::FunctionInfo;
PPCHIRBuilder::PPCHIRBuilder(PPCFrontend* frontend)
: HIRBuilder(), frontend_(frontend) {
comment_buffer_ = new StringBuffer(4096);
}
: HIRBuilder(), frontend_(frontend), comment_buffer_(4096) {}
PPCHIRBuilder::~PPCHIRBuilder() { delete comment_buffer_; }
PPCHIRBuilder::~PPCHIRBuilder() = default;
void PPCHIRBuilder::Reset() {
start_address_ = 0;
@@ -100,9 +98,9 @@ int PPCHIRBuilder::Emit(FunctionInfo* symbol_info, bool with_debug_info) {
if (label) {
AnnotateLabel(address, label);
}
comment_buffer_->Reset();
DisasmPPC(i, comment_buffer_);
Comment("%.8X %.8X %s", address, i.code, comment_buffer_->GetString());
comment_buffer_.Reset();
DisasmPPC(i, &comment_buffer_);
Comment("%.8X %.8X %s", address, i.code, comment_buffer_.GetString());
first_instr = last_instr();
}

View File

@@ -11,6 +11,7 @@
#define ALLOY_FRONTEND_PPC_PPC_HIR_BUILDER_H_
#include <alloy/core.h>
#include <alloy/string_buffer.h>
#include <alloy/hir/hir_builder.h>
#include <alloy/runtime/function.h>
#include <alloy/runtime/symbol_info.h>
@@ -78,7 +79,7 @@ class PPCHIRBuilder : public hir::HIRBuilder {
PPCFrontend* frontend_;
// Reset whenever needed:
StringBuffer* comment_buffer_;
StringBuffer comment_buffer_;
// Reset each Emit:
bool with_debug_info_;

View File

@@ -12,6 +12,7 @@
#include <sstream>
#include <alloy/frontend/ppc/ppc_instr_tables.h>
#include <poly/poly.h>
namespace alloy {
namespace frontend {

View File

@@ -10,11 +10,15 @@
#ifndef ALLOY_FRONTEND_PPC_PPC_INSTR_H_
#define ALLOY_FRONTEND_PPC_PPC_INSTR_H_
#include <alloy/core.h>
#include <string>
#include <vector>
#include <alloy/core.h>
namespace alloy {
class StringBuffer;
} // namespace alloy
namespace alloy {
namespace frontend {
namespace ppc {

View File

@@ -10,6 +10,8 @@
#ifndef ALLOY_FRONTEND_PPC_PPC_SCANNER_H_
#define ALLOY_FRONTEND_PPC_PPC_SCANNER_H_
#include <vector>
#include <alloy/core.h>
#include <alloy/runtime/symbol_info.h>

View File

@@ -13,6 +13,7 @@
#include <memory>
#include <alloy/core.h>
#include <alloy/string_buffer.h>
#include <alloy/backend/assembler.h>
#include <alloy/compiler/compiler.h>
#include <alloy/runtime/symbol_info.h>