summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorPedro Artigas <partigas@apple.com>2012-12-05 17:12:22 +0000
committerPedro Artigas <partigas@apple.com>2012-12-05 17:12:22 +0000
commitd1abec365aa89a8497d9b615ccb4b21c72da9447 (patch)
tree5cd1325ae59c51774105c3c912264d945035ab1e /lib/CodeGen/MachineModuleInfo.cpp
parent1e3b656be52e94c523d5fdb5a586a62ec59c3c51 (diff)
downloadllvm-d1abec365aa89a8497d9b615ccb4b21c72da9447.tar.gz
llvm-d1abec365aa89a8497d9b615ccb4b21c72da9447.tar.bz2
llvm-d1abec365aa89a8497d9b615ccb4b21c72da9447.tar.xz
- Added calls to doInitialization/doFinalization to immutable passes
- fixed ordering of calls to doFinalization to be the reverse of the pass run order due to potential dependencies - fixed machine module info to operate in the doInitialization/doFinalization model, also fixes some FIXMEs reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index 7cd8f61c45..4fbbb05ee6 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -253,15 +253,8 @@ void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) {
MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI,
const MCRegisterInfo &MRI,
const MCObjectFileInfo *MOFI)
- : ImmutablePass(ID), Context(MAI, MRI, MOFI),
- ObjFileMMI(0), CompactUnwindEncoding(0), CurCallSite(0), CallsEHReturn(0),
- CallsUnwindInit(0), DbgInfoAvailable(false),
- UsesVAFloatArgument(false) {
+ : ImmutablePass(ID), Context(MAI, MRI, MOFI) {
initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry());
- // Always emit some info, by default "no personality" info.
- Personalities.push_back(NULL);
- AddrLabelSymbols = 0;
- TheModule = 0;
}
MachineModuleInfo::MachineModuleInfo()
@@ -274,11 +267,31 @@ MachineModuleInfo::MachineModuleInfo()
MachineModuleInfo::~MachineModuleInfo() {
delete ObjFileMMI;
+}
+
+bool MachineModuleInfo::doInitialization(Module &M) {
+ ObjFileMMI = 0;
+ CompactUnwindEncoding = 0;
+ CurCallSite = 0;
+ CallsEHReturn = 0;
+ CallsUnwindInit = 0;
+ DbgInfoAvailable = UsesVAFloatArgument = false;
+ // Always emit some info, by default "no personality" info.
+ Personalities.push_back(NULL);
+ AddrLabelSymbols = 0;
+ TheModule = 0;
+
+ return false;
+}
+
+bool MachineModuleInfo::doFinalization(Module &M) {
+
+ Personalities.clear();
- // FIXME: Why isn't doFinalization being called??
- //assert(AddrLabelSymbols == 0 && "doFinalization not called");
delete AddrLabelSymbols;
AddrLabelSymbols = 0;
+
+ return false;
}
/// EndFunction - Discard function meta information.