[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp X86TargetMachine.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Aug 24 14:50:00 PDT 2003
Changes in directory llvm/lib/Target/X86:
X86TargetMachine.cpp updated: 1.24 -> 1.25
X86TargetMachine.h updated: 1.11 -> 1.12
---
Log message:
Targets should configure themselves based on a Module, not some wierd flags
---
Diffs of the changes:
Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.24 llvm/lib/Target/X86/X86TargetMachine.cpp:1.25
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.24 Sun Aug 17 18:20:40 2003
+++ llvm/lib/Target/X86/X86TargetMachine.cpp Sun Aug 24 14:49:48 2003
@@ -6,6 +6,7 @@
#include "X86TargetMachine.h"
#include "X86.h"
+#include "llvm/Module.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetMachineImpls.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -13,7 +14,6 @@
#include "llvm/Transforms/Scalar.h"
#include "Support/CommandLine.h"
#include "Support/Statistic.h"
-#include <iostream>
namespace {
cl::opt<bool> NoLocalRA("disable-local-ra",
@@ -27,21 +27,21 @@
// allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
// that implements the X86 backend.
//
-TargetMachine *allocateX86TargetMachine(unsigned Configuration) {
- return new X86TargetMachine(Configuration);
+TargetMachine *allocateX86TargetMachine(const Module &M) {
+ return new X86TargetMachine(M);
}
/// X86TargetMachine ctor - Create an ILP32 architecture model
///
-X86TargetMachine::X86TargetMachine(unsigned Config)
+X86TargetMachine::X86TargetMachine(const Module &M)
: TargetMachine("X86",
- (Config & TM::EndianMask) == TM::LittleEndian,
- (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
- (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
- (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4,
- 4, (Config & TM::PtrSizeMask) == TM::PtrSize64 ? 8 : 4),
- FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) {
+ M.getEndianness() != Module::BigEndian,
+ M.getPointerSize() != Module::Pointer64 ? 4 : 8,
+ M.getPointerSize() != Module::Pointer64 ? 4 : 8,
+ M.getPointerSize() != Module::Pointer64 ? 4 : 8,
+ 4, M.getPointerSize() != Module::Pointer64 ? 4 : 8),
+ FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4) {
}
Index: llvm/lib/Target/X86/X86TargetMachine.h
diff -u llvm/lib/Target/X86/X86TargetMachine.h:1.11 llvm/lib/Target/X86/X86TargetMachine.h:1.12
--- llvm/lib/Target/X86/X86TargetMachine.h:1.11 Wed Aug 13 13:17:27 2003
+++ llvm/lib/Target/X86/X86TargetMachine.h Sun Aug 24 14:49:48 2003
@@ -16,7 +16,7 @@
X86InstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
public:
- X86TargetMachine(unsigned Configuration);
+ X86TargetMachine(const Module &M);
virtual const X86InstrInfo &getInstrInfo() const { return InstrInfo; }
virtual const TargetFrameInfo &getFrameInfo() const { return FrameInfo; }
More information about the llvm-commits
mailing list