Adding copyright notices to most files. Also add readme file, and some
[jitcs.git] / src / src / machine.cpp
blobece142f555e4dbee13ec9d51a12ed9c266f4ab7f
1 //===-- src/src/machine.cpp -------------------------------------*- C++ -*-===//
2 // More target machine info.
3 //
4 // Copyright (C) 2013-2014 Dirk Steinke.
5 // See copyright and license notice in COPYRIGHT or include/jitcs.h
6 //
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)
17 : cpu(c) {
20 void jitcs::IMachineInfo::_release() {
21 assert(_refCnt == 0);
22 delete this;
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
34 return 0;
37 void jitcs::IMachineDetails::buildCtrlFlow
38 (Ref<Instruction> ins, Ref<BasicBlockImpl> src) const{
39 assert(0);