#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Support/Dwarf.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Streams.h"
using namespace llvm;
using namespace llvm::dwarf;
MachineModuleInfo::MachineModuleInfo()
: ImmutablePass(&ID)
-, Lines()
, LabelIDList()
, FrameMoves()
, LandingPads()
}
// This should never happen
- assert(0 && "Personality function should be set!");
+ LLVM_UNREACHABLE("Personality function should be set!");
return 0;
}
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
// Get machine module info.
- MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+ MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
if (!MMI) return false;
// Track if change is made.
// Iterate through instructions.
for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
// Is it a label.
- if (I->isDebugLabel()) {
+ if (I->isDebugLabel() && !MMI->isDbgLabelUsed(I->getOperand(0).getImm())){
// The label ID # is always operand #0, an immediate.
unsigned NextLabel = I->getOperand(0).getImm();