[llvm-commits] [llvm] r82441 - in /llvm/trunk/lib: ExecutionEngine/JIT/JITDwarfEmitter.cpp Target/ARM/ARMCodeEmitter.cpp
Daniel Dunbar
daniel at zuster.org
Sun Sep 20 22:58:35 PDT 2009
Author: ddunbar
Date: Mon Sep 21 00:58:35 2009
New Revision: 82441
URL: http://llvm.org/viewvc/llvm-project?rev=82441&view=rev
Log:
Register the MachineModuleInfo for the ARM JIT, and update JITDwarfEmitter to
assert if the setModuleInfo hasn't been called.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=82441&r1=82440&r2=82441&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Mon Sep 21 00:58:35 2009
@@ -30,7 +30,7 @@
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
-JITDwarfEmitter::JITDwarfEmitter(JIT& theJit) : Jit(theJit) {}
+JITDwarfEmitter::JITDwarfEmitter(JIT& theJit) : MMI(0), Jit(theJit) {}
unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
@@ -38,6 +38,8 @@
unsigned char* StartFunction,
unsigned char* EndFunction,
unsigned char* &EHFramePtr) {
+ assert(MMI && "MachineModuleInfo not registered!");
+
const TargetMachine& TM = F.getTarget();
TD = TM.getTargetData();
stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection();
@@ -206,6 +208,8 @@
unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
unsigned char* StartFunction,
unsigned char* EndFunction) const {
+ assert(MMI && "MachineModuleInfo not registered!");
+
// Map all labels and get rid of any dead landing pads.
MMI->TidyLandingPads();
Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=82441&r1=82440&r2=82441&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Sep 21 00:58:35 2009
@@ -31,6 +31,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Compiler.h"
@@ -67,6 +68,11 @@
const std::vector<MachineJumpTableEntry> *MJTEs;
bool IsPIC;
+ void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired<MachineModuleInfo>();
+ MachineFunctionPass::getAnalysisUsage(AU);
+ }
+
public:
static char ID;
explicit Emitter(TargetMachine &tm, CodeEmitter &mce)
@@ -204,6 +210,7 @@
MJTEs = &MF.getJumpTableInfo()->getJumpTables();
IsPIC = TM.getRelocationModel() == Reloc::PIC_;
JTI->Initialize(MF, IsPIC);
+ MCE.setModuleInfo(&getAnalysis<MachineModuleInfo>());
do {
DEBUG(errs() << "JITTing function '"
More information about the llvm-commits
mailing list