aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetMachine.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-28 21:23:38 +0000
committerChris Lattner <sabre@nondot.org>2003-12-28 21:23:38 +0000
commitf70e0c216c074bd2ae2b08178f5512849545db4e (patch)
treeecfce5ac045e092db18b62c4cc5f4903749e9e45 /include/llvm/Target/TargetMachine.h
parent27490a6fcc8e24be0ee4ddfcdbdf7e9da9e5af41 (diff)
downloadexternal_llvm-f70e0c216c074bd2ae2b08178f5512849545db4e.zip
external_llvm-f70e0c216c074bd2ae2b08178f5512849545db4e.tar.gz
external_llvm-f70e0c216c074bd2ae2b08178f5512849545db4e.tar.bz2
Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetMachine.h')
-rw-r--r--include/llvm/Target/TargetMachine.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index e326a2b..a653d6a 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -31,6 +31,7 @@ class MRegisterInfo;
class FunctionPassManager;
class PassManager;
class Pass;
+class IntrinsicLowering;
//===----------------------------------------------------------------------===//
///
@@ -40,24 +41,27 @@ class Pass;
///
class TargetMachine {
const std::string Name;
- const TargetData DataLayout; // Calculates type size & alignment
+ const TargetData DataLayout; // Calculates type size & alignment
+ IntrinsicLowering *IL; // Specifies how to lower intrinsic calls
TargetMachine(const TargetMachine&); // DO NOT IMPLEMENT
void operator=(const TargetMachine&); // DO NOT IMPLEMENT
-protected:
- TargetMachine(const std::string &name, // Can only create subclasses...
+protected: // Can only create subclasses...
+ TargetMachine(const std::string &name, IntrinsicLowering *IL,
bool LittleEndian = false,
unsigned char PtrSize = 8, unsigned char PtrAl = 8,
unsigned char DoubleAl = 8, unsigned char FloatAl = 4,
unsigned char LongAl = 8, unsigned char IntAl = 4,
- unsigned char ShortAl = 2, unsigned char ByteAl = 1)
- : Name(name), DataLayout(name, LittleEndian,
- PtrSize, PtrAl, DoubleAl, FloatAl, LongAl,
- IntAl, ShortAl, ByteAl) {}
+ unsigned char ShortAl = 2, unsigned char ByteAl = 1);
public:
- virtual ~TargetMachine() {}
+ virtual ~TargetMachine();
const std::string &getName() const { return Name; }
+
+ // getIntrinsicLowering - This method returns a reference to an
+ // IntrinsicLowering instance which should be used by the code generator to
+ // lower unknown intrinsic functions to the equivalent LLVM expansion.
+ IntrinsicLowering &getIntrinsicLowering() const { return *IL; }
// Interfaces to the major aspects of target machine information:
// -- Instruction opcode and operand information