OpenASIP  2.0
ConstantTransformer.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2015 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ConstantTransformer.hh
26  *
27  * Declaration of ConstantTransformer class.
28  *
29  * @author Pekka Jääskeläinen 2015
30  * @note reting: red
31  */
32 
33 #ifndef CONSTANT_TRANSFORMER_H
34 #define CONSTANT_TRANSFORMER_H
35 
36 #include <llvm/CodeGen/MachineFunctionPass.h>
37 #include "Machine.hh"
38 
39 /**
40  * Transforms constants in the program that cannot be
41  * encoded by the machine to ones that can be.
42  */
43 class ConstantTransformer : public llvm::MachineFunctionPass {
44 public:
45  static char ID;
47  const TTAMachine::Machine& mach) :
48  MachineFunctionPass(ID), mach_(mach) {}
49  virtual ~ConstantTransformer() {}
50 
51  bool doInitialization(llvm::Module& M);
52  bool runOnMachineFunction(llvm::MachineFunction& mf);
53  bool doFinalization(llvm::Module& M);
54 
55 private:
57 };
58 
59 #endif
ConstantTransformer::doInitialization
bool doInitialization(llvm::Module &M)
Definition: ConstantTransformer.cc:68
ConstantTransformer::ConstantTransformer
ConstantTransformer(const TTAMachine::Machine &mach)
Definition: ConstantTransformer.hh:46
ConstantTransformer::doFinalization
bool doFinalization(llvm::Module &M)
Definition: ConstantTransformer.cc:244
Machine.hh
ConstantTransformer
Definition: ConstantTransformer.hh:43
ConstantTransformer::runOnMachineFunction
bool runOnMachineFunction(llvm::MachineFunction &mf)
Definition: ConstantTransformer.cc:113
ConstantTransformer::~ConstantTransformer
virtual ~ConstantTransformer()
Definition: ConstantTransformer.hh:49
ConstantTransformer::mach_
const TTAMachine::Machine & mach_
Definition: ConstantTransformer.hh:56
ConstantTransformer::ID
static char ID
Definition: ConstantTransformer.hh:45
TTAMachine::Machine
Definition: Machine.hh:73