summaryrefslogtreecommitdiff
path: root/include
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
parent27490a6fcc8e24be0ee4ddfcdbdf7e9da9e5af41 (diff)
downloadllvm-f70e0c216c074bd2ae2b08178f5512849545db4e.tar.gz
llvm-f70e0c216c074bd2ae2b08178f5512849545db4e.tar.bz2
llvm-f70e0c216c074bd2ae2b08178f5512849545db4e.tar.xz
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')
-rw-r--r--include/llvm/CodeGen/InstrSelection.h8
-rw-r--r--include/llvm/CodeGen/IntrinsicLowering.h2
-rw-r--r--include/llvm/IntrinsicLowering.h2
-rw-r--r--include/llvm/Target/TargetMachine.h20
4 files changed, 17 insertions, 15 deletions
diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h
index 294bd8eb1f..5fa1ab1782 100644
--- a/include/llvm/CodeGen/InstrSelection.h
+++ b/include/llvm/CodeGen/InstrSelection.h
@@ -22,7 +22,6 @@ class Function;
class FunctionPass;
class InstrForest;
class InstructionNode;
-class IntrinsicLowering;
class MachineCodeForInstruction;
class MachineInstr;
class TargetMachine;
@@ -40,8 +39,6 @@ extern void GetInstructionsByRule (InstructionNode* subtreeRoot,
extern bool ThisIsAChainRule (int eruleno);
-//************************ Exported Functions ******************************/
-
//---------------------------------------------------------------------------
// Function: createInstructionSelectionPass
@@ -51,11 +48,8 @@ extern bool ThisIsAChainRule (int eruleno);
// Return a pass that performs machine dependent instruction selection.
//---------------------------------------------------------------------------
-FunctionPass *createInstructionSelectionPass(TargetMachine &Target,
- IntrinsicLowering &IL);
-
+FunctionPass *createInstructionSelectionPass(TargetMachine &Target);
-//************************ Exported Data Types *****************************/
//---------------------------------------------------------------------------
diff --git a/include/llvm/CodeGen/IntrinsicLowering.h b/include/llvm/CodeGen/IntrinsicLowering.h
index 7f0cd81ca6..19ccb61b47 100644
--- a/include/llvm/CodeGen/IntrinsicLowering.h
+++ b/include/llvm/CodeGen/IntrinsicLowering.h
@@ -33,6 +33,8 @@
#ifndef LLVM_INTRINSICLOWERING_H
#define LLVM_INTRINSICLOWERING_H
+#include "llvm/Intrinsics.h"
+
namespace llvm {
class CallInst;
diff --git a/include/llvm/IntrinsicLowering.h b/include/llvm/IntrinsicLowering.h
index 7f0cd81ca6..19ccb61b47 100644
--- a/include/llvm/IntrinsicLowering.h
+++ b/include/llvm/IntrinsicLowering.h
@@ -33,6 +33,8 @@
#ifndef LLVM_INTRINSICLOWERING_H
#define LLVM_INTRINSICLOWERING_H
+#include "llvm/Intrinsics.h"
+
namespace llvm {
class CallInst;
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index e326a2b68f..a653d6a47f 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