Fixing some clang warnings/errors.

This commit is contained in:
Ben Vanik
2015-07-15 23:26:58 -07:00
parent 74d2df2004
commit ecd4af10c9
27 changed files with 180 additions and 153 deletions

View File

@@ -372,7 +372,6 @@ uint32_t X64CodeCache::PlaceData(const void* data, size_t length) {
// Hold a lock while we bump the pointers up.
size_t high_mark;
uint8_t* data_address = nullptr;
size_t unwind_table_slot = 0;
{
std::lock_guard<xe::mutex> allocation_lock(allocation_mutex_);

View File

@@ -81,14 +81,14 @@ class X64CodeCache : public CodeCache {
// Current offset to empty space in generated code.
size_t generated_code_offset_ = 0;
// Current high water mark of COMMITTED code.
std::atomic<size_t> generated_code_commit_mark_ = 0;
std::atomic<size_t> generated_code_commit_mark_ = {0};
// Growable function table system handle.
void* unwind_table_handle_ = nullptr;
// Actual unwind table entries.
std::vector<RUNTIME_FUNCTION> unwind_table_;
// Current number of entries in the table.
std::atomic<uint32_t> unwind_table_count_ = 0;
std::atomic<uint32_t> unwind_table_count_ = {0};
};
} // namespace x64

View File

@@ -30,9 +30,9 @@ class X64Function : public Function {
void Setup(uint8_t* machine_code, size_t machine_code_length);
protected:
virtual bool AddBreakpointImpl(debug::Breakpoint* breakpoint);
virtual bool RemoveBreakpointImpl(debug::Breakpoint* breakpoint);
virtual bool CallImpl(ThreadState* thread_state, uint32_t return_address);
bool AddBreakpointImpl(debug::Breakpoint* breakpoint) override;
bool RemoveBreakpointImpl(debug::Breakpoint* breakpoint) override;
bool CallImpl(ThreadState* thread_state, uint32_t return_address) override;
private:
uint8_t* machine_code_;

View File

@@ -330,7 +330,7 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
case OPCODE_ADD:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
bool did_carry = v->Add(i->src2.value);
v->Add(i->src2.value);
i->Remove();
}
break;
@@ -357,7 +357,7 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
case OPCODE_SUB:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
bool did_carry = v->Sub(i->src2.value);
v->Sub(i->src2.value);
i->Remove();
}
break;

View File

@@ -18,7 +18,7 @@
namespace xe {
namespace cpu {
enum DebugInfoFlags {
enum DebugInfoFlags : uint32_t {
kDebugInfoNone = 0,
kDebugInfoDisasmSource = (1 << 1),
kDebugInfoDisasmRawHir = (1 << 2),

View File

@@ -66,7 +66,6 @@ class Export {
: ordinal(ordinal),
type(type),
tags(tags),
variable_ptr(0),
function_data({nullptr, nullptr, 0}) {
std::strncpy(this->name, name, xe::countof(this->name));
}

View File

@@ -71,12 +71,7 @@ class BuiltinModule : public Module {
Processor::Processor(xe::Memory* memory, ExportResolver* export_resolver,
debug::Debugger* debugger)
: memory_(memory),
debugger_(debugger),
debug_info_flags_(0),
builtin_module_(nullptr),
next_builtin_address_(0xFFFF0000ul),
export_resolver_(export_resolver) {
: memory_(memory), debugger_(debugger), export_resolver_(export_resolver) {
InitializeIfNeeded();
}

View File

@@ -83,20 +83,20 @@ class Processor {
private:
bool DemandFunction(FunctionInfo* symbol_info, Function** out_function);
Memory* memory_;
debug::Debugger* debugger_;
Memory* memory_ = nullptr;
debug::Debugger* debugger_ = nullptr;
uint32_t debug_info_flags_;
uint32_t debug_info_flags_ = 0;
std::unique_ptr<frontend::PPCFrontend> frontend_;
std::unique_ptr<backend::Backend> backend_;
ExportResolver* export_resolver_;
ExportResolver* export_resolver_ = nullptr;
EntryTable entry_table_;
xe::mutex modules_lock_;
std::vector<std::unique_ptr<Module>> modules_;
Module* builtin_module_;
uint32_t next_builtin_address_;
Module* builtin_module_ = nullptr;
uint32_t next_builtin_address_ = 0xFFFF0000u;
Irql irql_;
};

View File

@@ -33,7 +33,7 @@ TestModule::TestModule(Processor* processor, const std::string& name,
generate_(generate) {
builder_.reset(new HIRBuilder());
compiler_.reset(new Compiler(processor));
assembler_ = std::move(processor->backend()->CreateAssembler());
assembler_ = processor->backend()->CreateAssembler();
assembler_->Initialize();
// Merge blocks early. This will let us use more context in other passes.