[llvm-commits] CVS: llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp InternalGlobalMapper.cpp MappingInfo.cpp MappingInfo.h SparcV9Internals.h SparcV9StackSlots.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Sep 19 21:46:50 PDT 2004
Changes in directory llvm/lib/Target/SparcV9:
EmitBytecodeToAssembly.cpp updated: 1.14 -> 1.15
InternalGlobalMapper.cpp updated: 1.3 -> 1.4
MappingInfo.cpp updated: 1.19 -> 1.20
MappingInfo.h updated: 1.9 -> 1.10
SparcV9Internals.h updated: 1.116 -> 1.117
SparcV9StackSlots.cpp updated: 1.13 -> 1.14
---
Log message:
'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass. Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.
---
Diffs of the changes: (+20 -24)
Index: llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp
diff -u llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp:1.14 llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp:1.15
--- llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp:1.14 Sun Apr 25 02:04:49 2004
+++ llvm/lib/Target/SparcV9/EmitBytecodeToAssembly.cpp Sun Sep 19 23:46:39 2004
@@ -17,10 +17,7 @@
#include "llvm/Pass.h"
#include "llvm/Bytecode/Writer.h"
#include <iostream>
-
-namespace llvm {
-
-using std::ostream;
+using namespace llvm;
namespace {
@@ -87,14 +84,14 @@
}
// SparcV9BytecodeWriter - Write bytecode out to a stream that is sparc'ified
- class SparcV9BytecodeWriter : public Pass {
+ class SparcV9BytecodeWriter : public ModulePass {
std::ostream &Out;
public:
SparcV9BytecodeWriter(std::ostream &out) : Out(out) {}
const char *getPassName() const { return "Emit Bytecode to SparcV9 Assembly";}
- virtual bool run(Module &M) {
+ virtual bool runOnModule(Module &M) {
// Write an object containing the bytecode to the SPARC assembly stream
writePrologue (Out, "LLVM BYTECODE OUTPUT", "LLVMBytecode");
osparcasmstream OS(Out);
@@ -112,8 +109,7 @@
};
} // end anonymous namespace
-Pass *createBytecodeAsmPrinterPass(std::ostream &Out) {
+ModulePass *llvm::createBytecodeAsmPrinterPass(std::ostream &Out) {
return new SparcV9BytecodeWriter(Out);
}
-} // End llvm namespace
Index: llvm/lib/Target/SparcV9/InternalGlobalMapper.cpp
diff -u llvm/lib/Target/SparcV9/InternalGlobalMapper.cpp:1.3 llvm/lib/Target/SparcV9/InternalGlobalMapper.cpp:1.4
--- llvm/lib/Target/SparcV9/InternalGlobalMapper.cpp:1.3 Sat Jul 17 19:36:44 2004
+++ llvm/lib/Target/SparcV9/InternalGlobalMapper.cpp Sun Sep 19 23:46:39 2004
@@ -27,13 +27,13 @@
typedef std::vector<Constant *> GVVectorTy;
-class InternalGlobalMapper : public Pass {
+class InternalGlobalMapper : public ModulePass {
public:
- bool run (Module &M);
+ bool runOnModule(Module &M);
};
-Pass *llvm::createInternalGlobalMapperPass () {
- return new InternalGlobalMapper ();
+ModulePass *llvm::createInternalGlobalMapperPass() {
+ return new InternalGlobalMapper();
}
static void maybeAddInternalValueToVector (GVVectorTy &Vector, GlobalValue &GV){
@@ -41,14 +41,14 @@
// be mangled), then put the GV, casted to sbyte*, in the vector. Otherwise
// add a null.
if (GV.hasInternalLinkage () && GV.hasName ())
- Vector.push_back (ConstantExpr::getCast
- (&GV, PointerType::get (Type::SByteTy)));
+ Vector.push_back(ConstantExpr::getCast(&GV,
+ PointerType::get(Type::SByteTy)));
else
Vector.push_back (ConstantPointerNull::get (PointerType::get
(Type::SByteTy)));
}
-bool InternalGlobalMapper::run (Module &M) {
+bool InternalGlobalMapper::runOnModule(Module &M) {
GVVectorTy gvvector;
// Populate the vector with internal global values and their names.
Index: llvm/lib/Target/SparcV9/MappingInfo.cpp
diff -u llvm/lib/Target/SparcV9/MappingInfo.cpp:1.19 llvm/lib/Target/SparcV9/MappingInfo.cpp:1.20
--- llvm/lib/Target/SparcV9/MappingInfo.cpp:1.19 Wed Sep 1 17:55:36 2004
+++ llvm/lib/Target/SparcV9/MappingInfo.cpp Sun Sep 19 23:46:39 2004
@@ -78,8 +78,8 @@
/// MappingInfoAsmPrinter Pass object, which uses OUT as its output
/// stream for assembly output.
///
-Pass *getMappingInfoAsmPrinterPass(std::ostream &out){
- return (new MappingInfoAsmPrinter(out));
+ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out){
+ return new MappingInfoAsmPrinter(out);
}
/// runOnFunction - Builds up the maps for the given function FI and then
Index: llvm/lib/Target/SparcV9/MappingInfo.h
diff -u llvm/lib/Target/SparcV9/MappingInfo.h:1.9 llvm/lib/Target/SparcV9/MappingInfo.h:1.10
--- llvm/lib/Target/SparcV9/MappingInfo.h:1.9 Thu Jun 3 00:02:59 2004
+++ llvm/lib/Target/SparcV9/MappingInfo.h Sun Sep 19 23:46:39 2004
@@ -21,10 +21,10 @@
namespace llvm {
-class Pass;
+class ModulePass;
-Pass *getMappingInfoAsmPrinterPass(std::ostream &out);
-Pass *createInternalGlobalMapperPass();
+ModulePass *getMappingInfoAsmPrinterPass(std::ostream &out);
+ModulePass *createInternalGlobalMapperPass();
class MappingInfo {
struct byteVector : public std::vector <unsigned char> {
Index: llvm/lib/Target/SparcV9/SparcV9Internals.h
diff -u llvm/lib/Target/SparcV9/SparcV9Internals.h:1.116 llvm/lib/Target/SparcV9/SparcV9Internals.h:1.117
--- llvm/lib/Target/SparcV9/SparcV9Internals.h:1.116 Wed Sep 1 17:55:36 2004
+++ llvm/lib/Target/SparcV9/SparcV9Internals.h Sun Sep 19 23:46:39 2004
@@ -28,7 +28,7 @@
class LiveRange;
class SparcV9TargetMachine;
-class Pass;
+class ModulePass;
enum SparcV9InstrSchedClass {
SPARC_NONE, /* Instructions with no scheduling restrictions */
@@ -91,7 +91,7 @@
/// createStackSlotsPass - External interface to stack-slots pass that enters 2
/// empty slots at the top of each function stack
///
-Pass *createStackSlotsPass(const TargetMachine &TM);
+FunctionPass *createStackSlotsPass(const TargetMachine &TM);
/// Specializes LLVM code for a target machine.
///
@@ -111,7 +111,7 @@
/// getBytecodeAsmPrinterPass - Emits final LLVM bytecode to assembly file.
///
-Pass* createBytecodeAsmPrinterPass(std::ostream &Out);
+ModulePass* createBytecodeAsmPrinterPass(std::ostream &Out);
FunctionPass *createSparcV9MachineCodeDestructionPass();
Index: llvm/lib/Target/SparcV9/SparcV9StackSlots.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9StackSlots.cpp:1.13 llvm/lib/Target/SparcV9/SparcV9StackSlots.cpp:1.14
--- llvm/lib/Target/SparcV9/SparcV9StackSlots.cpp:1.13 Wed Aug 18 13:13:34 2004
+++ llvm/lib/Target/SparcV9/SparcV9StackSlots.cpp Sun Sep 19 23:46:39 2004
@@ -46,7 +46,7 @@
};
}
-Pass *llvm::createStackSlotsPass(const TargetMachine &Target) {
+FunctionPass *llvm::createStackSlotsPass(const TargetMachine &Target) {
return new StackSlots(Target);
}
More information about the llvm-commits
mailing list