diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-31 03:02:41 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-31 03:02:41 +0000 |
commit | c5b19b21d84814d19692a6bbea11fbd135f4b094 (patch) | |
tree | bb1bd4e3aa43436e497fba177d854d517f35075a /include/llvm/CodeGen | |
parent | 527695dd66971086f1a67ad30762c47fc7bce5d1 (diff) |
Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and many
failures when building assorted projects with clang.
--- Reverse-merging r77654 into '.':
U include/llvm/CodeGen/Passes.h
U include/llvm/CodeGen/MachineFunctionPass.h
U include/llvm/CodeGen/MachineFunction.h
U include/llvm/CodeGen/LazyLiveness.h
U include/llvm/CodeGen/SelectionDAGISel.h
D include/llvm/CodeGen/MachineFunctionAnalysis.h
U include/llvm/Function.h
U lib/Target/CellSPU/SPUISelDAGToDAG.cpp
U lib/Target/PowerPC/PPCISelDAGToDAG.cpp
U lib/CodeGen/LLVMTargetMachine.cpp
U lib/CodeGen/MachineVerifier.cpp
U lib/CodeGen/MachineFunction.cpp
U lib/CodeGen/PrologEpilogInserter.cpp
U lib/CodeGen/MachineLoopInfo.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
D lib/CodeGen/MachineFunctionAnalysis.cpp
D lib/CodeGen/MachineFunctionPass.cpp
U lib/CodeGen/LiveVariables.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/LazyLiveness.h | 1 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunction.h | 21 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunctionAnalysis.h | 49 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineFunctionPass.h | 16 | ||||
-rw-r--r-- | include/llvm/CodeGen/Passes.h | 5 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGISel.h | 5 |
6 files changed, 30 insertions, 67 deletions
diff --git a/include/llvm/CodeGen/LazyLiveness.h b/include/llvm/CodeGen/LazyLiveness.h index 388b638109..82e4a153d5 100644 --- a/include/llvm/CodeGen/LazyLiveness.h +++ b/include/llvm/CodeGen/LazyLiveness.h @@ -34,7 +34,6 @@ public: void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<MachineDominatorTree>(); - MachineFunctionPass::getAnalysisUsage(AU); } bool runOnMachineFunction(MachineFunction &mf); diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index b306583a5a..ea6a384d22 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -67,7 +67,7 @@ struct MachineFunctionInfo { }; class MachineFunction : private Annotation { - Function *Fn; + const Function *Fn; const TargetMachine &Target; // RegInfo - Information about each register in use in the function. @@ -115,12 +115,12 @@ class MachineFunction : private Annotation { unsigned Alignment; public: - MachineFunction(Function *Fn, const TargetMachine &TM); + MachineFunction(const Function *Fn, const TargetMachine &TM); ~MachineFunction(); /// getFunction - Return the LLVM function that this machine code represents /// - Function *getFunction() const { return Fn; } + const Function *getFunction() const { return Fn; } /// getTarget - Return the target machine this machine code is compiled with /// @@ -229,6 +229,21 @@ public: /// void dump() const; + /// construct - Allocate and initialize a MachineFunction for a given Function + /// and Target + /// + static MachineFunction& construct(const Function *F, const TargetMachine &TM); + + /// destruct - Destroy the MachineFunction corresponding to a given Function + /// + static void destruct(const Function *F); + + /// get - Return a handle to a MachineFunction corresponding to the given + /// Function. This should not be called before "construct()" for a given + /// Function. + /// + static MachineFunction& get(const Function *F); + // Provide accessors for the MachineBasicBlock list... typedef BasicBlockListType::iterator iterator; typedef BasicBlockListType::const_iterator const_iterator; diff --git a/include/llvm/CodeGen/MachineFunctionAnalysis.h b/include/llvm/CodeGen/MachineFunctionAnalysis.h deleted file mode 100644 index 5f1ff56af9..0000000000 --- a/include/llvm/CodeGen/MachineFunctionAnalysis.h +++ /dev/null @@ -1,49 +0,0 @@ -//===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file declares the MachineFunctionAnalysis class. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H -#define LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H - -#include "llvm/Pass.h" -#include "llvm/Target/TargetMachine.h" - -namespace llvm { - -class MachineFunction; - -/// MachineFunctionAnalysis - This class is a Pass that manages a -/// MachineFunction object. -struct MachineFunctionAnalysis : public FunctionPass { -private: - const TargetMachine &TM; - CodeGenOpt::Level OptLevel; - MachineFunction *MF; - -public: - static char ID; - explicit MachineFunctionAnalysis(TargetMachine &tm, - CodeGenOpt::Level OL = CodeGenOpt::Default); - - - MachineFunction &getMF() const { return *MF; } - CodeGenOpt::Level getOptLevel() const { return OptLevel; } - -private: - virtual bool runOnFunction(Function &F); - virtual void releaseMemory(); - virtual void getAnalysisUsage(AnalysisUsage &AU) const; -}; - -} // End llvm namespace - -#endif diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index 6f7c216382..6b5e64abc4 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -24,25 +24,19 @@ namespace llvm { -/// MachineFunctionPass - This class adapts the FunctionPass interface to -/// allow convenient creation of passes that operate on the MachineFunction -/// representation. Instead of overriding runOnFunction, subclasses -/// override runOnMachineFunction. -class MachineFunctionPass : public FunctionPass { -protected: + // FIXME: This pass should declare that the pass does not invalidate any LLVM + // passes. +struct MachineFunctionPass : public FunctionPass { explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} +protected: /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. /// virtual bool runOnMachineFunction(MachineFunction &MF) = 0; - /// getAnalysisUsage - Subclasses that override getAnalysisUsage - /// must call this. - virtual void getAnalysisUsage(AnalysisUsage &AU) const; - -private: +public: bool runOnFunction(Function &F); }; diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h index fa570b5855..e0ac416978 100644 --- a/include/llvm/CodeGen/Passes.h +++ b/include/llvm/CodeGen/Passes.h @@ -146,6 +146,11 @@ namespace llvm { /// by seeing if the labels map to the same reduced label. FunctionPass *createDebugLabelFoldingPass(); + /// MachineCodeDeletion Pass - This pass deletes all of the machine code for + /// the current function, which should happen after the function has been + /// emitted to a .s file or to memory. + FunctionPass *createMachineCodeDeleter(); + /// getRegisterAllocator - This creates an instance of the register allocator /// for the Sparc. FunctionPass *getRegisterAllocator(TargetMachine &T); diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h index 51f90acba4..d2c0dc420f 100644 --- a/include/llvm/CodeGen/SelectionDAGISel.h +++ b/include/llvm/CodeGen/SelectionDAGISel.h @@ -19,7 +19,6 @@ #include "llvm/Pass.h" #include "llvm/Constant.h" #include "llvm/CodeGen/SelectionDAG.h" -#include "llvm/CodeGen/MachineFunctionPass.h" namespace llvm { class FastISel; @@ -40,7 +39,7 @@ namespace llvm { /// SelectionDAGISel - This is the common base class used for SelectionDAG-based /// pattern-matching instruction selectors. -class SelectionDAGISel : public MachineFunctionPass { +class SelectionDAGISel : public FunctionPass { public: const TargetMachine &TM; TargetLowering &TLI; @@ -63,7 +62,7 @@ public: virtual void getAnalysisUsage(AnalysisUsage &AU) const; - virtual bool runOnMachineFunction(MachineFunction &MF); + virtual bool runOnFunction(Function &Fn); unsigned MakeReg(MVT VT); |