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 | 5a977d4034502b3c0829e15b53b0890d3d09515a (patch) | |
tree | 13a2271bb27f124715245aea3eea11f9fddff9ae /lib/Target/SparcV9/SparcV9StackSlots.cpp | |
parent | 600dee4aaee093b6b45011c5461f43fd7855a5d6 (diff) | |
download | external_llvm-5a977d4034502b3c0829e15b53b0890d3d09515a.zip external_llvm-5a977d4034502b3c0829e15b53b0890d3d09515a.tar.gz external_llvm-5a977d4034502b3c0829e15b53b0890d3d09515a.tar.bz2 |
Put class in anonymous namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/SparcV9StackSlots.cpp')
-rw-r--r-- | lib/Target/SparcV9/SparcV9StackSlots.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lib/Target/SparcV9/SparcV9StackSlots.cpp b/lib/Target/SparcV9/SparcV9StackSlots.cpp index 10cccd3..8f3a507 100644 --- a/lib/Target/SparcV9/SparcV9StackSlots.cpp +++ b/lib/Target/SparcV9/SparcV9StackSlots.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); |