[llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp EmitBytecodeToAssembly.cpp MappingInfo.cpp MappingInfo.h PeepholeOpts.cpp PreSelection.cpp PrologEpilogCodeInserter.cpp Sparc.burg.in Sparc.cpp SparcInstrInfo.cpp SparcInstrSelection.cpp SparcInstrSelectionSupport.h SparcInternals.h SparcRegClassInfo.cpp SparcRegClassInfo.h SparcRegInfo.cpp SparcV9CodeEmitter.cpp SparcV9CodeEmitter.h StackSlots.cpp UltraSparcSchedInfo.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Nov 11 16:42:27 PST 2003
Changes in directory llvm/lib/Target/Sparc:
EmitAssembly.cpp updated: 1.94 -> 1.95
EmitBytecodeToAssembly.cpp updated: 1.10 -> 1.11
MappingInfo.cpp updated: 1.14 -> 1.15
MappingInfo.h updated: 1.5 -> 1.6
PeepholeOpts.cpp updated: 1.15 -> 1.16
PreSelection.cpp updated: 1.25 -> 1.26
PrologEpilogCodeInserter.cpp updated: 1.30 -> 1.31
Sparc.burg.in updated: 1.10 -> 1.11
Sparc.cpp updated: 1.89 -> 1.90
SparcInstrInfo.cpp updated: 1.57 -> 1.58
SparcInstrSelection.cpp updated: 1.126 -> 1.127
SparcInstrSelectionSupport.h updated: 1.12 -> 1.13
SparcInternals.h updated: 1.106 -> 1.107
SparcRegClassInfo.cpp updated: 1.31 -> 1.32
SparcRegClassInfo.h updated: 1.22 -> 1.23
SparcRegInfo.cpp updated: 1.113 -> 1.114
SparcV9CodeEmitter.cpp updated: 1.42 -> 1.43
SparcV9CodeEmitter.h updated: 1.16 -> 1.17
StackSlots.cpp updated: 1.8 -> 1.9
UltraSparcSchedInfo.cpp updated: 1.7 -> 1.8
---
Log message:
Put all LLVM code into the llvm namespace, as per bug 109.
---
Diffs of the changes: (+90 -15)
Index: llvm/lib/Target/Sparc/EmitAssembly.cpp
diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.94 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.95
--- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.94 Fri Nov 7 11:45:28 2003
+++ llvm/lib/Target/Sparc/EmitAssembly.cpp Tue Nov 11 16:41:33 2003
@@ -33,6 +33,8 @@
#include "SparcInternals.h"
#include <string>
+namespace llvm {
+
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
@@ -877,12 +879,13 @@
} // End anonymous namespace
+namespace llvm {
+
Pass *UltraSparc::getFunctionAsmPrinterPass(std::ostream &Out) {
return new SparcFunctionAsmPrinter(Out, *this);
}
-
-
+} // End llvm namespace
//===----------------------------------------------------------------------===//
@@ -954,3 +957,5 @@
Pass *UltraSparc::getModuleAsmPrinterPass(std::ostream &Out) {
return new SparcModuleAsmPrinter(Out, *this);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/EmitBytecodeToAssembly.cpp
diff -u llvm/lib/Target/Sparc/EmitBytecodeToAssembly.cpp:1.10 llvm/lib/Target/Sparc/EmitBytecodeToAssembly.cpp:1.11
--- llvm/lib/Target/Sparc/EmitBytecodeToAssembly.cpp:1.10 Mon Oct 20 14:43:17 2003
+++ llvm/lib/Target/Sparc/EmitBytecodeToAssembly.cpp Tue Nov 11 16:41:33 2003
@@ -18,6 +18,8 @@
#include "llvm/Bytecode/Writer.h"
#include <iostream>
+namespace llvm {
+
using std::ostream;
namespace {
@@ -113,3 +115,5 @@
Pass *UltraSparc::getBytecodeAsmPrinterPass(std::ostream &Out) {
return new SparcBytecodeWriter(Out);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/MappingInfo.cpp
diff -u llvm/lib/Target/Sparc/MappingInfo.cpp:1.14 llvm/lib/Target/Sparc/MappingInfo.cpp:1.15
--- llvm/lib/Target/Sparc/MappingInfo.cpp:1.14 Mon Oct 20 14:43:17 2003
+++ llvm/lib/Target/Sparc/MappingInfo.cpp Tue Nov 11 16:41:33 2003
@@ -49,6 +49,8 @@
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "Support/StringExtras.h"
+namespace llvm {
+
namespace {
class MappingInfoAsmPrinter : public FunctionPass {
std::ostream &Out;
@@ -292,4 +294,6 @@
return false;
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/MappingInfo.h
diff -u llvm/lib/Target/Sparc/MappingInfo.h:1.5 llvm/lib/Target/Sparc/MappingInfo.h:1.6
--- llvm/lib/Target/Sparc/MappingInfo.h:1.5 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/Sparc/MappingInfo.h Tue Nov 11 16:41:33 2003
@@ -18,6 +18,9 @@
#include <iosfwd>
#include <vector>
#include <string>
+
+namespace llvm {
+
class Pass;
Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
@@ -40,5 +43,7 @@
length = bytes.size(); return &bytes[0];
}
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/Sparc/PeepholeOpts.cpp
diff -u llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.15 llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.16
--- llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.15 Fri Nov 7 11:44:18 2003
+++ llvm/lib/Target/Sparc/PeepholeOpts.cpp Tue Nov 11 16:41:33 2003
@@ -20,6 +20,8 @@
#include "llvm/BasicBlock.h"
#include "llvm/Pass.h"
+namespace llvm {
+
//************************* Internal Functions *****************************/
static inline void
@@ -163,3 +165,5 @@
FunctionPass* createPeepholeOptsPass(const TargetMachine &TM) {
return new PeepholeOpts(TM);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/PreSelection.cpp
diff -u llvm/lib/Target/Sparc/PreSelection.cpp:1.25 llvm/lib/Target/Sparc/PreSelection.cpp:1.26
--- llvm/lib/Target/Sparc/PreSelection.cpp:1.25 Fri Nov 7 11:31:22 2003
+++ llvm/lib/Target/Sparc/PreSelection.cpp Tue Nov 11 16:41:33 2003
@@ -29,6 +29,8 @@
#include "llvm/Transforms/Scalar.h"
#include <algorithm>
+namespace llvm {
+
namespace {
//===--------------------------------------------------------------------===//
@@ -71,6 +73,7 @@
"Specialize LLVM code for a target machine"
createPreselectionPass);
#endif
+
} // end anonymous namespace
@@ -236,7 +239,6 @@
visitOperands(I, (/*firstOp=*/ I.getCalledFunction()? 1 : 0));
}
-
//===----------------------------------------------------------------------===//
// createPreSelectionPass - Public entrypoint for pre-selection pass
// and this file as a whole...
@@ -244,3 +246,5 @@
FunctionPass* createPreSelectionPass(const TargetMachine &TM) {
return new PreSelection(TM);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp
diff -u llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.30 llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.31
--- llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.30 Mon Oct 20 14:43:17 2003
+++ llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp Tue Nov 11 16:41:33 2003
@@ -27,6 +27,8 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
+namespace llvm {
+
namespace {
struct InsertPrologEpilogCode : public MachineFunctionPass {
const char *getPassName() const { return "Sparc Prolog/Epilog Inserter"; }
@@ -177,3 +179,5 @@
FunctionPass *UltraSparc::getPrologEpilogInsertionPass() {
return new InsertPrologEpilogCode();
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/Sparc.burg.in
diff -u llvm/lib/Target/Sparc/Sparc.burg.in:1.10 llvm/lib/Target/Sparc/Sparc.burg.in:1.11
--- llvm/lib/Target/Sparc/Sparc.burg.in:1.10 Tue Oct 21 10:24:55 2003
+++ llvm/lib/Target/Sparc/Sparc.burg.in Tue Nov 11 16:41:33 2003
@@ -11,7 +11,7 @@
Xinclude <cstdio>
Xinclude <llvm/CodeGen/InstrForest.h>
-typedef InstrTreeNode* NODEPTR_TYPE;
+typedef llvm::InstrTreeNode* NODEPTR_TYPE;
Xdefine OP_LABEL(p) ((p)->opLabel)
Xdefine LEFT_CHILD(p) ((p)->LeftChild)
Xdefine RIGHT_CHILD(p) ((p)->RightChild)
Index: llvm/lib/Target/Sparc/Sparc.cpp
diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.89 llvm/lib/Target/Sparc/Sparc.cpp:1.90
--- llvm/lib/Target/Sparc/Sparc.cpp:1.89 Fri Nov 7 18:01:39 2003
+++ llvm/lib/Target/Sparc/Sparc.cpp Tue Nov 11 16:41:33 2003
@@ -27,6 +27,8 @@
#include "llvm/Target/TargetMachineImpls.h"
#include "Support/CommandLine.h"
+namespace llvm {
+
static const unsigned ImplicitRegUseList[] = { 0 }; /* not used yet */
// Build the MachineInstruction Description Array...
const TargetInstrDescriptor SparcMachineInstrDesc[] = {
@@ -267,3 +269,5 @@
return false; // success!
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/SparcInstrInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.57 llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.58
--- llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.57 Fri Nov 7 11:29:48 2003
+++ llvm/lib/Target/Sparc/SparcInstrInfo.cpp Tue Nov 11 16:41:33 2003
@@ -23,6 +23,8 @@
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
+namespace llvm {
+
static const uint32_t MAXLO = (1 << 10) - 1; // set bits set by %lo(*)
static const uint32_t MAXSIMM = (1 << 12) - 1; // set bits in simm13 field of OR
@@ -792,3 +794,5 @@
CreateBitExtensionInstructions(/*signExtend*/ false, target, F, srcVal,
destVal, numLowBits, mvec, mcfi);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.126 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.127
--- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.126 Thu Oct 23 11:48:30 2003
+++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp Tue Nov 11 16:41:33 2003
@@ -32,6 +32,8 @@
#include <algorithm>
#include <cmath>
+namespace llvm {
+
static inline void Add3OperandInstr(unsigned Opcode, InstructionNode* Node,
std::vector<MachineInstr*>& mvec) {
mvec.push_back(BuildMI(Opcode, 3).addReg(Node->leftChild()->getValue())
@@ -1390,12 +1392,12 @@
// instead of a regular call. If not that kind of intrinsic, do nothing.
// Returns true if code was generated, otherwise false.
//
-bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
+bool CodeGenIntrinsic(Intrinsic::ID iid, CallInst &callInstr,
TargetMachine &target,
std::vector<MachineInstr*>& mvec)
{
switch (iid) {
- case LLVMIntrinsic::va_start: {
+ case Intrinsic::va_start: {
// Get the address of the first incoming vararg argument on the stack
bool ignore;
Function* func = cast<Function>(callInstr.getParent()->getParent());
@@ -1409,10 +1411,10 @@
return true;
}
- case LLVMIntrinsic::va_end:
+ case Intrinsic::va_end:
return true; // no-op on Sparc
- case LLVMIntrinsic::va_copy:
+ case Intrinsic::va_copy:
// Simple copy of current va_list (arg1) to new va_list (result)
mvec.push_back(BuildMI(V9::ORr, 3).
addMReg(target.getRegInfo().getZeroRegNum()).
@@ -1420,8 +1422,8 @@
addRegDef(&callInstr));
return true;
- case LLVMIntrinsic::sigsetjmp:
- case LLVMIntrinsic::setjmp: {
+ case Intrinsic::sigsetjmp:
+ case Intrinsic::setjmp: {
// act as if we return 0
unsigned g0 = target.getRegInfo().getZeroRegNum();
mvec.push_back(BuildMI(V9::ORr,3).addMReg(g0).addMReg(g0)
@@ -1429,8 +1431,8 @@
return true;
}
- case LLVMIntrinsic::siglongjmp:
- case LLVMIntrinsic::longjmp: {
+ case Intrinsic::siglongjmp:
+ case Intrinsic::longjmp: {
// call abort()
Module* M = callInstr.getParent()->getParent()->getParent();
const FunctionType *voidvoidFuncTy =
@@ -2474,8 +2476,8 @@
// sequence (e.g., va_start). Indirect calls cannot be special.
//
bool specialIntrinsic = false;
- LLVMIntrinsic::ID iid;
- if (calledFunc && (iid=(LLVMIntrinsic::ID)calledFunc->getIntrinsicID()))
+ Intrinsic::ID iid;
+ if (calledFunc && (iid=(Intrinsic::ID)calledFunc->getIntrinsicID()))
specialIntrinsic = CodeGenIntrinsic(iid, *callInstr, target, mvec);
// If not, generate the normal call sequence for the function.
@@ -2928,4 +2930,6 @@
}
}
}
+}
+
}
Index: llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h
diff -u llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.12 llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.13
--- llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.12 Wed Oct 22 00:50:40 2003
+++ llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h Tue Nov 11 16:41:33 2003
@@ -17,6 +17,8 @@
#include "llvm/DerivedTypes.h"
#include "SparcInternals.h"
+namespace llvm {
+
// Choose load instruction opcode based on type of value
inline MachineOpCode
ChooseLoadInstruction(const Type *DestTy)
@@ -219,5 +221,7 @@
return Opcode;
}
}
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/Sparc/SparcInternals.h
diff -u llvm/lib/Target/Sparc/SparcInternals.h:1.106 llvm/lib/Target/Sparc/SparcInternals.h:1.107
--- llvm/lib/Target/Sparc/SparcInternals.h:1.106 Fri Nov 7 11:43:43 2003
+++ llvm/lib/Target/Sparc/SparcInternals.h Tue Nov 11 16:41:33 2003
@@ -25,6 +25,8 @@
#include "SparcRegClassInfo.h"
#include "Config/sys/types.h"
+namespace llvm {
+
class LiveRange;
class UltraSparc;
class Pass;
@@ -692,5 +694,7 @@
// getBytecodeAsmPrinterPass - Emits final LLVM bytecode to assembly file.
Pass* getBytecodeAsmPrinterPass(std::ostream &Out);
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.31 llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.32
--- llvm/lib/Target/Sparc/SparcRegClassInfo.cpp:1.31 Mon Oct 20 14:43:17 2003
+++ llvm/lib/Target/Sparc/SparcRegClassInfo.cpp Tue Nov 11 16:41:33 2003
@@ -17,6 +17,8 @@
#include "../../CodeGen/RegAlloc/RegAllocCommon.h" // FIXME!
#include "../../CodeGen/RegAlloc/IGNode.h" // FIXME!
+namespace llvm {
+
//-----------------------------------------------------------------------------
// Int Register Class - method for coloring a node in the interference graph.
//
@@ -390,3 +392,5 @@
return -1;
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/SparcRegClassInfo.h
diff -u llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.22 llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.23
--- llvm/lib/Target/Sparc/SparcRegClassInfo.h:1.22 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/Sparc/SparcRegClassInfo.h Tue Nov 11 16:41:33 2003
@@ -16,6 +16,8 @@
#include "llvm/Target/TargetRegInfo.h"
+namespace llvm {
+
//-----------------------------------------------------------------------------
// Integer Register Class
//-----------------------------------------------------------------------------
@@ -216,5 +218,7 @@
const char * const getRegName(unsigned reg) const;
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.113 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.114
--- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.113 Sat Nov 8 12:12:24 2003
+++ llvm/lib/Target/Sparc/SparcRegInfo.cpp Tue Nov 11 16:41:33 2003
@@ -27,6 +27,8 @@
#include "llvm/Function.h"
#include "llvm/DerivedTypes.h"
+namespace llvm {
+
enum {
BadRegClass = ~0
};
@@ -967,3 +969,5 @@
std::cerr << "+" << getUnifiedRegName(uRegName+1);
std::cerr << "]\n";
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp
diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.42 llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.43
--- llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.42 Sun Nov 9 01:08:34 2003
+++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Tue Nov 11 16:41:33 2003
@@ -38,6 +38,8 @@
#include "SparcV9CodeEmitter.h"
#include "Config/alloca.h"
+namespace llvm {
+
namespace {
Statistic<> OverwrittenCalls("call-ovwr", "Number of over-written calls");
Statistic<> UnmodifiedCalls("call-skip", "Number of unmodified calls");
@@ -443,7 +445,6 @@
return (intptr_t)MCE.finishFunctionStub(*F)+4; /* 1 instr past the restore */
}
-
SparcV9CodeEmitter::SparcV9CodeEmitter(TargetMachine &tm,
MachineCodeEmitter &M): TM(tm), MCE(M)
{
@@ -808,5 +809,7 @@
return (void*)(intptr_t)MCE.getGlobalValueAddress(V);
}
}
+
+} // End llvm namespace
#include "SparcV9CodeEmitter.inc"
Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.h
diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.16 llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.17
--- llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.16 Fri Nov 7 12:06:26 2003
+++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.h Tue Nov 11 16:41:33 2003
@@ -19,6 +19,8 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Target/TargetMachine.h"
+namespace llvm {
+
class GlobalValue;
class MachineInstr;
class MachineOperand;
@@ -80,5 +82,7 @@
unsigned getRealRegNum(unsigned fakeReg, MachineInstr &MI);
};
+
+} // End llvm namespace
#endif
Index: llvm/lib/Target/Sparc/StackSlots.cpp
diff -u llvm/lib/Target/Sparc/StackSlots.cpp:1.8 llvm/lib/Target/Sparc/StackSlots.cpp:1.9
--- llvm/lib/Target/Sparc/StackSlots.cpp:1.8 Thu Nov 6 12:06:13 2003
+++ llvm/lib/Target/Sparc/StackSlots.cpp Tue Nov 11 16:41:33 2003
@@ -20,6 +20,8 @@
#include "llvm/CodeGen/MachineFunctionInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
+namespace llvm {
+
namespace {
class StackSlots : public MachineFunctionPass {
const TargetMachine &Target;
@@ -48,3 +50,5 @@
Pass *createStackSlotsPass(const TargetMachine &Target) {
return new StackSlots(Target);
}
+
+} // End llvm namespace
Index: llvm/lib/Target/Sparc/UltraSparcSchedInfo.cpp
diff -u llvm/lib/Target/Sparc/UltraSparcSchedInfo.cpp:1.7 llvm/lib/Target/Sparc/UltraSparcSchedInfo.cpp:1.8
--- llvm/lib/Target/Sparc/UltraSparcSchedInfo.cpp:1.7 Mon Oct 20 14:43:17 2003
+++ llvm/lib/Target/Sparc/UltraSparcSchedInfo.cpp Tue Nov 11 16:41:33 2003
@@ -13,6 +13,8 @@
#include "SparcInternals.h"
+using namespace llvm;
+
/*---------------------------------------------------------------------------
Scheduling guidelines for SPARC IIi:
More information about the llvm-commits
mailing list