1 //===-- src/src/machine.cpp -------------------------------------*- C++ -*-===//
2 // More target machine info.
4 // Copyright (C) 2013-2014 Dirk Steinke.
5 // See copyright and license notice in COPYRIGHT or include/jitcs.h
7 // IMachineDetails contain all information and methods necessary for
8 // target dependent dataflow analysis or register allocation.
9 //===----------------------------------------------------------------------===//
11 #include "jitcs_machine.h"
12 #include "jitcs_int_machine.h"
13 #include "jitcs_function.h"
14 #include "jitcs_int_function_impl.h"
16 jitcs::IMachineInfo::IMachineInfo(const CPUInfo
& c
)
20 void jitcs::IMachineInfo::_release() {
25 std::unique_ptr
<jitcs::Function
> jitcs::IMachineInfo::createFnc
26 (RefCounter
<TempAllocator
> alloc
,
27 std::shared_ptr
<const CallingConvention
> cc
) {
28 jitcs::FunctionImpl
* f
= new FunctionImpl(alloc
, cc
);
29 return std::unique_ptr
<jitcs::Function
>(reinterpret_cast<jitcs::Function
*>(f
));
32 size_t jitcs::IMachineDetails::getInsIdInfo(InsId id
) const {
33 // right now, we didn't define any instruction which are not hardware
37 void jitcs::IMachineDetails::buildCtrlFlow
38 (Ref
<Instruction
> ins
, Ref
<BasicBlockImpl
> src
) const{