diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-28 20:42:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-28 20:42:56 +0000 |
commit | 2ca5e23403813b12db8f7e4a4546d30ed65799df (patch) | |
tree | 669aed5156659d293ebe3292b5d72bd1f97c5d3b /llvm/lib | |
parent | bf9d12ac8b834761c49caafba4bb6d791ab83199 (diff) | |
download | llvm-2ca5e23403813b12db8f7e4a4546d30ed65799df.zip llvm-2ca5e23403813b12db8f7e4a4546d30ed65799df.tar.gz llvm-2ca5e23403813b12db8f7e4a4546d30ed65799df.tar.bz2 |
Put class in anonymous namespace
llvm-svn: 5197
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Sparc/StackSlots.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/llvm/lib/Target/Sparc/StackSlots.cpp b/llvm/lib/Target/Sparc/StackSlots.cpp index 10cccd3..8f3a507 100644 --- a/llvm/lib/Target/Sparc/StackSlots.cpp +++ b/llvm/lib/Target/Sparc/StackSlots.cpp @@ -14,30 +14,32 @@ #include "llvm/DerivedTypes.h" #include "llvm/Pass.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFunctionInfo.h" -class StackSlots : public FunctionPass { - const TargetMachine &Target; -public: - StackSlots (const TargetMachine &T) : Target(T) {} - - const char *getPassName() const { - return "Stack Slot Insertion for profiling code"; - } - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - } - - bool runOnFunction(Function &F) { - const Type *PtrInt = PointerType::get(Type::IntTy); - unsigned Size = Target.DataLayout.getTypeSize(PtrInt); - - MachineFunction &mcInfo = MachineFunction::get(&F); - Value *V = Constant::getNullValue(Type::IntTy); - mcInfo.allocateLocalVar(Target, V, 2*Size); - return true; - } -}; +namespace { + class StackSlots : public FunctionPass { + const TargetMachine &Target; + public: + StackSlots(const TargetMachine &T) : Target(T) {} + + const char *getPassName() const { + return "Stack Slot Insertion for profiling code"; + } + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + } + + bool runOnFunction(Function &F) { + const Type *PtrInt = PointerType::get(Type::IntTy); + unsigned Size = Target.getTargetData().getTypeSize(PtrInt); + + Value *V = Constant::getNullValue(Type::IntTy); + MachineFunction::get(&F).getInfo()->allocateLocalVar(V, 2*Size); + return true; + } + }; +} Pass *createStackSlotsPass(const TargetMachine &Target) { return new StackSlots(Target); |