summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp')
-rw-r--r--gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp b/gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
index dd7f7931b06..cbb4c48b4d8 100644
--- a/gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
+++ b/gnu/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
@@ -12,13 +12,12 @@
//===----------------------------------------------------------------------===//
#include "DwarfException.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/TargetLoweringObjectFile.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h"
@@ -31,11 +30,7 @@
#include "llvm/MC/MachineLocation.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
-#include "llvm/Target/TargetFrameLowering.h"
-#include "llvm/Target/TargetLoweringObjectFile.h"
-#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
DwarfCFIExceptionBase::DwarfCFIExceptionBase(AsmPrinter *A)
@@ -92,7 +87,7 @@ static MCSymbol *getExceptionSym(AsmPrinter *Asm) {
void DwarfCFIException::beginFunction(const MachineFunction *MF) {
shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
- const Function *F = MF->getFunction();
+ const Function &F = MF->getFunction();
// If any landing pads survive, we need an EH table.
bool hasLandingPads = !MF->getLandingPads().empty();
@@ -105,17 +100,17 @@ void DwarfCFIException::beginFunction(const MachineFunction *MF) {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
unsigned PerEncoding = TLOF.getPersonalityEncoding();
const Function *Per = nullptr;
- if (F->hasPersonalityFn())
- Per = dyn_cast<Function>(F->getPersonalityFn()->stripPointerCasts());
+ if (F.hasPersonalityFn())
+ Per = dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts());
// Emit a personality function even when there are no landing pads
forceEmitPersonality =
// ...if a personality function is explicitly specified
- F->hasPersonalityFn() &&
+ F.hasPersonalityFn() &&
// ... and it's not known to be a noop in the absence of invokes
!isNoOpWithoutInvoke(classifyEHPersonality(Per)) &&
// ... and we're not explicitly asked not to emit it
- F->needsUnwindTableEntry();
+ F.needsUnwindTableEntry();
shouldEmitPersonality =
(forceEmitPersonality ||
@@ -148,8 +143,8 @@ void DwarfCFIException::beginFragment(const MachineBasicBlock *MBB,
if (!shouldEmitPersonality)
return;
- auto *F = MBB->getParent()->getFunction();
- auto *P = dyn_cast<Function>(F->getPersonalityFn()->stripPointerCasts());
+ auto &F = MBB->getParent()->getFunction();
+ auto *P = dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts());
assert(P && "Expected personality function");
// If we are forced to emit this personality, make sure to record