From 06f5b8cbbf9020ca2a8d4e869e29c1ddcdeb2af6 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 20 Aug 2014 22:37:01 -0700 Subject: [PATCH] Removing dep on xenia/types.h from alloy. --- src/alloy/backend/x64/x64_emitter.h | 18 ++++++++++++------ src/alloy/backend/x64/x64_sequences.h | 6 +++++- src/alloy/hir/block.h | 4 +++- src/alloy/runtime/instrument.h | 4 +++- src/xenia/profiling.h | 3 ++- tools/alloy-sandbox/alloy-sandbox.cc | 4 ++++ 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/alloy/backend/x64/x64_emitter.h b/src/alloy/backend/x64/x64_emitter.h index 86ffba7db..d51f255ca 100644 --- a/src/alloy/backend/x64/x64_emitter.h +++ b/src/alloy/backend/x64/x64_emitter.h @@ -16,12 +16,18 @@ #include -XEDECLARECLASS2(alloy, hir, HIRBuilder); -XEDECLARECLASS2(alloy, hir, Instr); -XEDECLARECLASS2(alloy, runtime, DebugInfo); -XEDECLARECLASS2(alloy, runtime, FunctionInfo); -XEDECLARECLASS2(alloy, runtime, Runtime); -XEDECLARECLASS2(alloy, runtime, SymbolInfo); +namespace alloy { +namespace hir { +class HIRBuilder; +class Instr; +} // namespace hir +namespace runtime { +class DebugInfo; +class FunctionInfo; +class Runtime; +class SymbolInfo; +} // namespace runtime +} // namespace alloy namespace alloy { namespace backend { diff --git a/src/alloy/backend/x64/x64_sequences.h b/src/alloy/backend/x64/x64_sequences.h index 79053e31e..3bfe6d94b 100644 --- a/src/alloy/backend/x64/x64_sequences.h +++ b/src/alloy/backend/x64/x64_sequences.h @@ -12,7 +12,11 @@ #include -XEDECLARECLASS2(alloy, hir, Instr); +namespace alloy { +namespace hir { +class Instr; +} // namespace hir +} // namespace alloy namespace alloy { namespace backend { diff --git a/src/alloy/hir/block.h b/src/alloy/hir/block.h index f79147697..b62f70b58 100644 --- a/src/alloy/hir/block.h +++ b/src/alloy/hir/block.h @@ -13,7 +13,9 @@ #include #include -XEDECLARECLASS1(llvm, BitVector); +namespace llvm { +class BitVector; +} // namespace llvm namespace alloy { namespace hir { diff --git a/src/alloy/runtime/instrument.h b/src/alloy/runtime/instrument.h index c75d0ad09..631c72c55 100644 --- a/src/alloy/runtime/instrument.h +++ b/src/alloy/runtime/instrument.h @@ -12,7 +12,9 @@ #include -XEDECLARECLASS1(alloy, Memory); +namespace alloy { +class Memory; +} // namespace alloy namespace alloy { namespace runtime { diff --git a/src/xenia/profiling.h b/src/xenia/profiling.h index d3102e980..aa570ac91 100644 --- a/src/xenia/profiling.h +++ b/src/xenia/profiling.h @@ -13,9 +13,10 @@ #include #include -#include +#if XE_LIKE_WIN32 #define XE_OPTION_PROFILING 1 +#endif // XE_LIKE_WIN32 #if XE_OPTION_PROFILING // Pollutes the global namespace. Yuck. diff --git a/tools/alloy-sandbox/alloy-sandbox.cc b/tools/alloy-sandbox/alloy-sandbox.cc index 8ed74a8ac..b8f7b4e3f 100644 --- a/tools/alloy-sandbox/alloy-sandbox.cc +++ b/tools/alloy-sandbox/alloy-sandbox.cc @@ -75,8 +75,10 @@ class ThreadState : public alloy::runtime::ThreadState { // TODO(benvanik): simple memory? move more into core? int main(std::vector& args) { +#if XE_OPTION_PROFILING xe::Profiler::Initialize(); xe::Profiler::ThreadEnter("main"); +#endif // XE_OPTION_PROFILING size_t memory_size = 16 * 1024 * 1024; auto memory = std::make_unique(memory_size); @@ -116,8 +118,10 @@ int main(std::vector& args) { runtime.reset(); memory.reset(); +#if XE_OPTION_PROFILING xe::Profiler::Dump(); xe::Profiler::ThreadExit(); +#endif // XE_OPTION_PROFILING return 0; }