[llvm-commits] CVS: llvm/lib/Target/X86/FloatingPoint.cpp InstSelectPattern.cpp InstSelectSimple.cpp PeepholeOptimizer.cpp Printer.cpp X86.h X86CodeEmitter.cpp X86InstrBuilder.h X86InstrInfo.cpp X86InstrInfo.h X86RegisterInfo.cpp X86RegisterInfo.h X86TargetMachine.cpp X86TargetMachine.h
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Nov 11 16:42:05 PST 2003
Changes in directory llvm/lib/Target/X86:
FloatingPoint.cpp updated: 1.10 -> 1.11
InstSelectPattern.cpp updated: 1.4 -> 1.5
InstSelectSimple.cpp updated: 1.138 -> 1.139
PeepholeOptimizer.cpp updated: 1.5 -> 1.6
Printer.cpp updated: 1.71 -> 1.72
X86.h updated: 1.20 -> 1.21
X86CodeEmitter.cpp updated: 1.39 -> 1.40
X86InstrBuilder.h updated: 1.8 -> 1.9
X86InstrInfo.cpp updated: 1.16 -> 1.17
X86InstrInfo.h updated: 1.27 -> 1.28
X86RegisterInfo.cpp updated: 1.39 -> 1.40
X86RegisterInfo.h updated: 1.17 -> 1.18
X86TargetMachine.cpp updated: 1.36 -> 1.37
X86TargetMachine.h updated: 1.16 -> 1.17
---
Log message:
Put all LLVM code into the llvm namespace, as per bug 109.
---
Diffs of the changes: (+71 -14)
Index: llvm/lib/Target/X86/FloatingPoint.cpp
diff -u llvm/lib/Target/X86/FloatingPoint.cpp:1.10 llvm/lib/Target/X86/FloatingPoint.cpp:1.11
--- llvm/lib/Target/X86/FloatingPoint.cpp:1.10 Mon Oct 20 14:43:18 2003
+++ llvm/lib/Target/X86/FloatingPoint.cpp Tue Nov 11 16:41:33 2003
@@ -25,6 +25,8 @@
#include <algorithm>
#include <iostream>
+namespace llvm {
+
namespace {
Statistic<> NumFXCH("x86-codegen", "Number of fxch instructions inserted");
Statistic<> NumFP ("x86-codegen", "Number of floating point instructions");
@@ -70,7 +72,7 @@
// getSTReg - Return the X86::ST(i) register which contains the specified
// FP<RegNo> register
unsigned getSTReg(unsigned RegNo) const {
- return StackTop - 1 - getSlot(RegNo) + X86::ST0;
+ return StackTop - 1 - getSlot(RegNo) + llvm::X86::ST0;
}
// pushReg - Push the specifiex FP<n> register onto the stack
@@ -598,3 +600,5 @@
I = MBB->erase(I)-1; // Remove the pseudo instruction
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/InstSelectPattern.cpp
diff -u llvm/lib/Target/X86/InstSelectPattern.cpp:1.4 llvm/lib/Target/X86/InstSelectPattern.cpp:1.5
--- llvm/lib/Target/X86/InstSelectPattern.cpp:1.4 Mon Oct 20 14:43:18 2003
+++ llvm/lib/Target/X86/InstSelectPattern.cpp Tue Nov 11 16:41:33 2003
@@ -28,6 +28,8 @@
// Include the generated instruction selector...
#include "X86GenInstrSelector.inc"
+namespace llvm {
+
namespace {
struct ISel : public FunctionPass, SelectionDAGTargetBuilder {
TargetMachine &TM;
@@ -114,7 +116,6 @@
assert(0 && "ISel::expandCall not implemented!");
}
-
/// createX86PatternInstructionSelector - This pass converts an LLVM function
/// into a machine code representation using pattern matching and a machine
/// description file.
@@ -122,3 +123,5 @@
FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.138 llvm/lib/Target/X86/InstSelectSimple.cpp:1.139
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.138 Thu Oct 23 12:21:43 2003
+++ llvm/lib/Target/X86/InstSelectSimple.cpp Tue Nov 11 16:41:33 2003
@@ -29,6 +29,8 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/InstVisitor.h"
+namespace llvm {
+
/// BMI - A special BuildMI variant that takes an iterator to insert the
/// instruction at as well as a basic block. This is the version for when you
/// have a destination register in mind.
@@ -138,7 +140,7 @@
void doCall(const ValueRecord &Ret, MachineInstr *CallMI,
const std::vector<ValueRecord> &Args);
void visitCallInst(CallInst &I);
- void visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &I);
+ void visitIntrinsicCall(Intrinsic::ID ID, CallInst &I);
// Arithmetic operators
void visitSimpleBinary(BinaryOperator &B, unsigned OpcodeClass);
@@ -1045,7 +1047,7 @@
MachineInstr *TheCall;
if (Function *F = CI.getCalledFunction()) {
// Is it an intrinsic function call?
- if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID()) {
+ if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID()) {
visitIntrinsicCall(ID, CI); // Special intrinsics are not handled here
return;
}
@@ -1066,29 +1068,29 @@
}
-void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
+void ISel::visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI) {
unsigned TmpReg1, TmpReg2;
switch (ID) {
- case LLVMIntrinsic::va_start:
+ case Intrinsic::va_start:
// Get the address of the first vararg value...
TmpReg1 = getReg(CI);
addFrameReference(BuildMI(BB, X86::LEAr32, 5, TmpReg1), VarArgsFrameIndex);
return;
- case LLVMIntrinsic::va_copy:
+ case Intrinsic::va_copy:
TmpReg1 = getReg(CI);
TmpReg2 = getReg(CI.getOperand(1));
BuildMI(BB, X86::MOVrr32, 1, TmpReg1).addReg(TmpReg2);
return;
- case LLVMIntrinsic::va_end: return; // Noop on X86
+ case Intrinsic::va_end: return; // Noop on X86
- case LLVMIntrinsic::longjmp:
- case LLVMIntrinsic::siglongjmp:
+ case Intrinsic::longjmp:
+ case Intrinsic::siglongjmp:
BuildMI(BB, X86::CALLpcrel32, 1).addExternalSymbol("abort", true);
return;
- case LLVMIntrinsic::setjmp:
- case LLVMIntrinsic::sigsetjmp:
+ case Intrinsic::setjmp:
+ case Intrinsic::sigsetjmp:
// Setjmp always returns zero...
BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
return;
@@ -2127,7 +2129,6 @@
doCall(ValueRecord(0, Type::VoidTy), TheCall, Args);
}
-
/// createX86SimpleInstructionSelector - This pass converts an LLVM function
/// into a machine code representation is a very simple peep-hole fashion. The
/// generated code sucks but the implementation is nice and simple.
@@ -2135,3 +2136,5 @@
FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/PeepholeOptimizer.cpp
diff -u llvm/lib/Target/X86/PeepholeOptimizer.cpp:1.5 llvm/lib/Target/X86/PeepholeOptimizer.cpp:1.6
--- llvm/lib/Target/X86/PeepholeOptimizer.cpp:1.5 Mon Oct 20 14:43:18 2003
+++ llvm/lib/Target/X86/PeepholeOptimizer.cpp Tue Nov 11 16:41:33 2003
@@ -15,6 +15,8 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
+namespace llvm {
+
namespace {
struct PH : public MachineFunctionPass {
virtual bool runOnMachineFunction(MachineFunction &MF);
@@ -131,3 +133,5 @@
return false;
}
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/Printer.cpp
diff -u llvm/lib/Target/X86/Printer.cpp:1.71 llvm/lib/Target/X86/Printer.cpp:1.72
--- llvm/lib/Target/X86/Printer.cpp:1.71 Tue Nov 4 10:04:32 2003
+++ llvm/lib/Target/X86/Printer.cpp Tue Nov 11 16:41:33 2003
@@ -29,6 +29,8 @@
#include "Support/StringExtras.h"
#include "Support/CommandLine.h"
+namespace llvm {
+
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
@@ -960,3 +962,5 @@
delete Mang;
return false; // success
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/X86.h
diff -u llvm/lib/Target/X86/X86.h:1.20 llvm/lib/Target/X86/X86.h:1.21
--- llvm/lib/Target/X86/X86.h:1.20 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/X86/X86.h Tue Nov 11 16:41:33 2003
@@ -16,6 +16,9 @@
#define TARGET_X86_H
#include <iosfwd>
+
+namespace llvm {
+
class TargetMachine;
class FunctionPass;
@@ -58,6 +61,8 @@
// Defines symbolic names for X86 registers. This defines a mapping from
// register name to register number.
//
+} // End llvm namespace
+
#include "X86GenRegisterNames.inc"
// Defines symbolic names for the X86 instructions.
Index: llvm/lib/Target/X86/X86CodeEmitter.cpp
diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.39 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.40
--- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.39 Mon Oct 20 14:43:18 2003
+++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue Nov 11 16:41:33 2003
@@ -24,6 +24,8 @@
#include "Support/Statistic.h"
#include "Config/alloca.h"
+namespace llvm {
+
namespace {
Statistic<>
NumEmitted("x86-emitter", "Number of machine instructions emitted");
@@ -589,3 +591,5 @@
break;
}
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/X86InstrBuilder.h
diff -u llvm/lib/Target/X86/X86InstrBuilder.h:1.8 llvm/lib/Target/X86/X86InstrBuilder.h:1.9
--- llvm/lib/Target/X86/X86InstrBuilder.h:1.8 Tue Oct 21 22:10:26 2003
+++ llvm/lib/Target/X86/X86InstrBuilder.h Tue Nov 11 16:41:33 2003
@@ -26,6 +26,8 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
+namespace llvm {
+
/// addDirectMem - This function is used to add a direct memory reference to the
/// current instruction -- that is, a dereference of an address in a register,
/// with no scale, index or displacement. An example is: DWORD PTR [EAX].
@@ -68,5 +70,7 @@
int Offset = 0) {
return MIB.addConstantPoolIndex(CPI).addZImm(1).addReg(0).addSImm(Offset);
}
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.16 llvm/lib/Target/X86/X86InstrInfo.cpp:1.17
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.16 Mon Oct 20 14:43:18 2003
+++ llvm/lib/Target/X86/X86InstrInfo.cpp Tue Nov 11 16:41:33 2003
@@ -17,6 +17,8 @@
#include "X86GenInstrInfo.inc"
+using namespace llvm;
+
X86InstrInfo::X86InstrInfo()
: TargetInstrInfo(X86Insts, sizeof(X86Insts)/sizeof(X86Insts[0]), 0) {
}
Index: llvm/lib/Target/X86/X86InstrInfo.h
diff -u llvm/lib/Target/X86/X86InstrInfo.h:1.27 llvm/lib/Target/X86/X86InstrInfo.h:1.28
--- llvm/lib/Target/X86/X86InstrInfo.h:1.27 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/X86/X86InstrInfo.h Tue Nov 11 16:41:33 2003
@@ -17,6 +17,8 @@
#include "llvm/Target/TargetInstrInfo.h"
#include "X86RegisterInfo.h"
+namespace llvm {
+
/// X86II - This namespace holds all of the target specific flags that
/// instruction info tracks.
///
@@ -180,5 +182,7 @@
return get(Opcode).TSFlags >> X86II::OpcodeShift;
}
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/X86/X86RegisterInfo.cpp
diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.39 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.40
--- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.39 Tue Nov 4 16:57:09 2003
+++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Nov 11 16:41:33 2003
@@ -25,6 +25,8 @@
#include "llvm/Target/TargetFrameInfo.h"
#include "Support/CommandLine.h"
+namespace llvm {
+
namespace {
cl::opt<bool>
NoFPElim("disable-fp-elim",
@@ -253,8 +255,12 @@
return MBB.size() - oldSize;
}
+} // End llvm namespace
+
#include "X86GenRegisterInfo.inc"
+namespace llvm {
+
const TargetRegisterClass*
X86RegisterInfo::getRegClassForType(const Type* Ty) const {
switch (Ty->getPrimitiveID()) {
@@ -274,3 +280,5 @@
case Type::DoubleTyID: return &RFPInstance;
}
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/X86RegisterInfo.h
diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.17 llvm/lib/Target/X86/X86RegisterInfo.h:1.18
--- llvm/lib/Target/X86/X86RegisterInfo.h:1.17 Tue Nov 4 16:57:09 2003
+++ llvm/lib/Target/X86/X86RegisterInfo.h Tue Nov 11 16:41:33 2003
@@ -16,10 +16,12 @@
#include "llvm/Target/MRegisterInfo.h"
-class Type;
+class llvm::Type;
#include "X86GenRegisterInfo.h.inc"
+namespace llvm {
+
struct X86RegisterInfo : public X86GenRegisterInfo {
X86RegisterInfo();
const TargetRegisterClass* getRegClassForType(const Type* Ty) const;
@@ -51,5 +53,7 @@
int emitPrologue(MachineFunction &MF) const;
int emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.36 llvm/lib/Target/X86/X86TargetMachine.cpp:1.37
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.36 Thu Nov 6 15:30:05 2003
+++ llvm/lib/Target/X86/X86TargetMachine.cpp Tue Nov 11 16:41:33 2003
@@ -22,6 +22,8 @@
#include "Support/CommandLine.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
cl::opt<bool> PrintCode("print-machineinstrs",
cl::desc("Print generated machine code"));
@@ -153,3 +155,5 @@
int32_t OldAddr = (intptr_t) OldWord;
*OldWord = NewAddr - OldAddr - 4; // Emit PC-relative addr of New code.
}
+
+} // End llvm namespace
Index: llvm/lib/Target/X86/X86TargetMachine.h
diff -u llvm/lib/Target/X86/X86TargetMachine.h:1.16 llvm/lib/Target/X86/X86TargetMachine.h:1.17
--- llvm/lib/Target/X86/X86TargetMachine.h:1.16 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/X86/X86TargetMachine.h Tue Nov 11 16:41:33 2003
@@ -19,6 +19,8 @@
#include "llvm/PassManager.h"
#include "X86InstrInfo.h"
+namespace llvm {
+
class X86TargetMachine : public TargetMachine {
X86InstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
@@ -54,5 +56,7 @@
virtual void replaceMachineCodeForFunction (void *Old, void *New);
};
+
+} // End llvm namespace
#endif
More information about the llvm-commits
mailing list