LLVM  3.7.0
MachineModuleInfo.cpp
Go to the documentation of this file.
1 //===-- llvm/CodeGen/MachineModuleInfo.cpp ----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "llvm/ADT/PointerUnion.h"
16 #include "llvm/CodeGen/Passes.h"
18 #include "llvm/IR/Constants.h"
19 #include "llvm/IR/DerivedTypes.h"
20 #include "llvm/IR/GlobalVariable.h"
21 #include "llvm/IR/Module.h"
23 #include "llvm/MC/MCSymbol.h"
24 #include "llvm/Support/Dwarf.h"
26 using namespace llvm;
27 using namespace llvm::dwarf;
28 
29 // Handle the Pass registration stuff necessary to use DataLayout's.
30 INITIALIZE_PASS(MachineModuleInfo, "machinemoduleinfo",
31  "Machine Module Information", false, false)
32 char MachineModuleInfo::ID = 0;
33 
34 // Out of line virtual method.
36 
37 namespace llvm {
39  MMIAddrLabelMap *Map;
40 public:
41  MMIAddrLabelMapCallbackPtr() : Map(nullptr) {}
42  MMIAddrLabelMapCallbackPtr(Value *V) : CallbackVH(V), Map(nullptr) {}
43 
44  void setPtr(BasicBlock *BB) {
46  }
47 
48  void setMap(MMIAddrLabelMap *map) { Map = map; }
49 
50  void deleted() override;
51  void allUsesReplacedWith(Value *V2) override;
52 };
53 
55  MCContext &Context;
56  struct AddrLabelSymEntry {
57  /// Symbols - The symbols for the label.
59 
60  Function *Fn; // The containing function of the BasicBlock.
61  unsigned Index; // The index in BBCallbacks for the BasicBlock.
62  };
63 
64  DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry> AddrLabelSymbols;
65 
66  /// BBCallbacks - Callbacks for the BasicBlock's that we have entries for. We
67  /// use this so we get notified if a block is deleted or RAUWd.
68  std::vector<MMIAddrLabelMapCallbackPtr> BBCallbacks;
69 
70  /// DeletedAddrLabelsNeedingEmission - This is a per-function list of symbols
71  /// whose corresponding BasicBlock got deleted. These symbols need to be
72  /// emitted at some point in the file, so AsmPrinter emits them after the
73  /// function body.
74  DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> >
75  DeletedAddrLabelsNeedingEmission;
76 public:
77 
78  MMIAddrLabelMap(MCContext &context) : Context(context) {}
80  assert(DeletedAddrLabelsNeedingEmission.empty() &&
81  "Some labels for deleted blocks never got emitted");
82  }
83 
84  ArrayRef<MCSymbol *> getAddrLabelSymbolToEmit(BasicBlock *BB);
85 
86  void takeDeletedSymbolsForFunction(Function *F,
87  std::vector<MCSymbol*> &Result);
88 
89  void UpdateForDeletedBlock(BasicBlock *BB);
90  void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New);
91 };
92 }
93 
95  assert(BB->hasAddressTaken() &&
96  "Shouldn't get label for block without address taken");
97  AddrLabelSymEntry &Entry = AddrLabelSymbols[BB];
98 
99  // If we already had an entry for this block, just return it.
100  if (!Entry.Symbols.empty()) {
101  assert(BB->getParent() == Entry.Fn && "Parent changed");
102  return Entry.Symbols;
103  }
104 
105  // Otherwise, this is a new entry, create a new symbol for it and add an
106  // entry to BBCallbacks so we can be notified if the BB is deleted or RAUWd.
107  BBCallbacks.emplace_back(BB);
108  BBCallbacks.back().setMap(this);
109  Entry.Index = BBCallbacks.size() - 1;
110  Entry.Fn = BB->getParent();
111  Entry.Symbols.push_back(Context.createTempSymbol());
112  return Entry.Symbols;
113 }
114 
115 /// takeDeletedSymbolsForFunction - If we have any deleted symbols for F, return
116 /// them.
118 takeDeletedSymbolsForFunction(Function *F, std::vector<MCSymbol*> &Result) {
119  DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> >::iterator I =
120  DeletedAddrLabelsNeedingEmission.find(F);
121 
122  // If there are no entries for the function, just return.
123  if (I == DeletedAddrLabelsNeedingEmission.end()) return;
124 
125  // Otherwise, take the list.
126  std::swap(Result, I->second);
127  DeletedAddrLabelsNeedingEmission.erase(I);
128 }
129 
130 
132  // If the block got deleted, there is no need for the symbol. If the symbol
133  // was already emitted, we can just forget about it, otherwise we need to
134  // queue it up for later emission when the function is output.
135  AddrLabelSymEntry Entry = std::move(AddrLabelSymbols[BB]);
136  AddrLabelSymbols.erase(BB);
137  assert(!Entry.Symbols.empty() && "Didn't have a symbol, why a callback?");
138  BBCallbacks[Entry.Index] = nullptr; // Clear the callback.
139 
140  assert((BB->getParent() == nullptr || BB->getParent() == Entry.Fn) &&
141  "Block/parent mismatch");
142 
143  for (MCSymbol *Sym : Entry.Symbols) {
144  if (Sym->isDefined())
145  return;
146 
147  // If the block is not yet defined, we need to emit it at the end of the
148  // function. Add the symbol to the DeletedAddrLabelsNeedingEmission list
149  // for the containing Function. Since the block is being deleted, its
150  // parent may already be removed, we have to get the function from 'Entry'.
151  DeletedAddrLabelsNeedingEmission[Entry.Fn].push_back(Sym);
152  }
153 }
154 
156  // Get the entry for the RAUW'd block and remove it from our map.
157  AddrLabelSymEntry OldEntry = std::move(AddrLabelSymbols[Old]);
158  AddrLabelSymbols.erase(Old);
159  assert(!OldEntry.Symbols.empty() && "Didn't have a symbol, why a callback?");
160 
161  AddrLabelSymEntry &NewEntry = AddrLabelSymbols[New];
162 
163  // If New is not address taken, just move our symbol over to it.
164  if (NewEntry.Symbols.empty()) {
165  BBCallbacks[OldEntry.Index].setPtr(New); // Update the callback.
166  NewEntry = std::move(OldEntry); // Set New's entry.
167  return;
168  }
169 
170  BBCallbacks[OldEntry.Index] = nullptr; // Update the callback.
171 
172  // Otherwise, we need to add the old symbols to the new block's set.
173  NewEntry.Symbols.insert(NewEntry.Symbols.end(), OldEntry.Symbols.begin(),
174  OldEntry.Symbols.end());
175 }
176 
177 
179  Map->UpdateForDeletedBlock(cast<BasicBlock>(getValPtr()));
180 }
181 
183  Map->UpdateForRAUWBlock(cast<BasicBlock>(getValPtr()), cast<BasicBlock>(V2));
184 }
185 
186 
187 //===----------------------------------------------------------------------===//
188 
190  const MCRegisterInfo &MRI,
191  const MCObjectFileInfo *MOFI)
192  : ImmutablePass(ID), Context(&MAI, &MRI, MOFI, nullptr, false) {
194 }
195 
197  : ImmutablePass(ID), Context(nullptr, nullptr, nullptr) {
198  llvm_unreachable("This MachineModuleInfo constructor should never be called, "
199  "MMI should always be explicitly constructed by "
200  "LLVMTargetMachine");
201 }
202 
204 }
205 
207 
208  ObjFileMMI = nullptr;
209  CurCallSite = 0;
210  CallsEHReturn = false;
211  CallsUnwindInit = false;
212  DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false;
213  // Always emit some info, by default "no personality" info.
214  Personalities.push_back(nullptr);
215  PersonalityTypeCache = EHPersonality::Unknown;
216  AddrLabelSymbols = nullptr;
217  TheModule = nullptr;
218 
219  return false;
220 }
221 
223 
224  Personalities.clear();
225 
226  delete AddrLabelSymbols;
227  AddrLabelSymbols = nullptr;
228 
229  Context.reset();
230 
231  delete ObjFileMMI;
232  ObjFileMMI = nullptr;
233 
234  return false;
235 }
236 
237 /// EndFunction - Discard function meta information.
238 ///
240  // Clean up frame info.
241  FrameInstructions.clear();
242 
243  // Clean up exception info.
244  LandingPads.clear();
245  PersonalityTypeCache = EHPersonality::Unknown;
246  CallSiteMap.clear();
247  TypeInfos.clear();
248  FilterIds.clear();
249  FilterEnds.clear();
250  CallsEHReturn = false;
251  CallsUnwindInit = false;
253 }
254 
255 //===- Address of Block Management ----------------------------------------===//
256 
257 /// getAddrLabelSymbolToEmit - Return the symbol to be used for the specified
258 /// basic block when its address is taken. If other blocks were RAUW'd to
259 /// this one, we may have to emit them as well, return the whole set.
262  // Lazily create AddrLabelSymbols.
263  if (!AddrLabelSymbols)
264  AddrLabelSymbols = new MMIAddrLabelMap(Context);
265  return AddrLabelSymbols->getAddrLabelSymbolToEmit(const_cast<BasicBlock*>(BB));
266 }
267 
268 
269 /// takeDeletedSymbolsForFunction - If the specified function has had any
270 /// references to address-taken blocks generated, but the block got deleted,
271 /// return the symbol now so we can emit it. This prevents emitting a
272 /// reference to a symbol that has no definition.
275  std::vector<MCSymbol*> &Result) {
276  // If no blocks have had their addresses taken, we're done.
277  if (!AddrLabelSymbols) return;
278  return AddrLabelSymbols->
279  takeDeletedSymbolsForFunction(const_cast<Function*>(F), Result);
280 }
281 
282 //===- EH -----------------------------------------------------------------===//
283 
284 /// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the
285 /// specified MachineBasicBlock.
287  (MachineBasicBlock *LandingPad) {
288  unsigned N = LandingPads.size();
289  for (unsigned i = 0; i < N; ++i) {
290  LandingPadInfo &LP = LandingPads[i];
291  if (LP.LandingPadBlock == LandingPad)
292  return LP;
293  }
294 
295  LandingPads.push_back(LandingPadInfo(LandingPad));
296  return LandingPads[N];
297 }
298 
299 /// addInvoke - Provide the begin and end labels of an invoke style call and
300 /// associate it with a try landing pad block.
302  MCSymbol *BeginLabel, MCSymbol *EndLabel) {
303  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
304  LP.BeginLabels.push_back(BeginLabel);
305  LP.EndLabels.push_back(EndLabel);
306 }
307 
308 /// addLandingPad - Provide the label of a try LandingPad block.
309 ///
311  MCSymbol *LandingPadLabel = Context.createTempSymbol();
312  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
313  LP.LandingPadLabel = LandingPadLabel;
314  return LandingPadLabel;
315 }
316 
317 /// addPersonality - Provide the personality function for the exception
318 /// information.
320  const Function *Personality) {
321  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
322  LP.Personality = Personality;
323  addPersonality(Personality);
324 }
325 
326 void MachineModuleInfo::addPersonality(const Function *Personality) {
327  for (unsigned i = 0; i < Personalities.size(); ++i)
328  if (Personalities[i] == Personality)
329  return;
330 
331  // If this is the first personality we're adding go
332  // ahead and add it at the beginning.
333  if (!Personalities[0])
334  Personalities[0] = Personality;
335  else
336  Personalities.push_back(Personality);
337 }
338 
340  int State) {
341  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
342  LP.WinEHState = State;
343 }
344 
345 /// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
346 ///
350  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
351  for (unsigned N = TyInfo.size(); N; --N)
352  LP.TypeIds.push_back(getTypeIDFor(TyInfo[N - 1]));
353 }
354 
355 /// addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
356 ///
360  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
361  std::vector<unsigned> IdsInFilter(TyInfo.size());
362  for (unsigned I = 0, E = TyInfo.size(); I != E; ++I)
363  IdsInFilter[I] = getTypeIDFor(TyInfo[I]);
364  LP.TypeIds.push_back(getFilterIDFor(IdsInFilter));
365 }
366 
367 /// addCleanup - Add a cleanup action for a landing pad.
368 ///
370  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
371  LP.TypeIds.push_back(0);
372 }
373 
375  const Function *Filter,
376  const BlockAddress *RecoverBA) {
377  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
378  SEHHandler Handler;
379  Handler.FilterOrFinally = Filter;
380  Handler.RecoverBA = RecoverBA;
381  LP.SEHHandlers.push_back(Handler);
382 }
383 
385  const Function *Cleanup) {
386  LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
387  SEHHandler Handler;
388  Handler.FilterOrFinally = Cleanup;
389  Handler.RecoverBA = nullptr;
390  LP.SEHHandlers.push_back(Handler);
391 }
392 
393 /// TidyLandingPads - Remap landing pad labels and remove any deleted landing
394 /// pads.
396  for (unsigned i = 0; i != LandingPads.size(); ) {
397  LandingPadInfo &LandingPad = LandingPads[i];
398  if (LandingPad.LandingPadLabel &&
399  !LandingPad.LandingPadLabel->isDefined() &&
400  (!LPMap || (*LPMap)[LandingPad.LandingPadLabel] == 0))
401  LandingPad.LandingPadLabel = nullptr;
402 
403  // Special case: we *should* emit LPs with null LP MBB. This indicates
404  // "nounwind" case.
405  if (!LandingPad.LandingPadLabel && LandingPad.LandingPadBlock) {
406  LandingPads.erase(LandingPads.begin() + i);
407  continue;
408  }
409 
410  for (unsigned j = 0, e = LandingPads[i].BeginLabels.size(); j != e; ++j) {
411  MCSymbol *BeginLabel = LandingPad.BeginLabels[j];
412  MCSymbol *EndLabel = LandingPad.EndLabels[j];
413  if ((BeginLabel->isDefined() ||
414  (LPMap && (*LPMap)[BeginLabel] != 0)) &&
415  (EndLabel->isDefined() ||
416  (LPMap && (*LPMap)[EndLabel] != 0))) continue;
417 
418  LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
419  LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
420  --j, --e;
421  }
422 
423  // Remove landing pads with no try-ranges.
424  if (LandingPads[i].BeginLabels.empty()) {
425  LandingPads.erase(LandingPads.begin() + i);
426  continue;
427  }
428 
429  // If there is no landing pad, ensure that the list of typeids is empty.
430  // If the only typeid is a cleanup, this is the same as having no typeids.
431  if (!LandingPad.LandingPadBlock ||
432  (LandingPad.TypeIds.size() == 1 && !LandingPad.TypeIds[0]))
433  LandingPad.TypeIds.clear();
434  ++i;
435  }
436 }
437 
438 /// setCallSiteLandingPad - Map the landing pad's EH symbol to the call site
439 /// indexes.
441  ArrayRef<unsigned> Sites) {
442  LPadToCallSiteMap[Sym].append(Sites.begin(), Sites.end());
443 }
444 
445 /// getTypeIDFor - Return the type id for the specified typeinfo. This is
446 /// function wide.
448  for (unsigned i = 0, N = TypeInfos.size(); i != N; ++i)
449  if (TypeInfos[i] == TI) return i + 1;
450 
451  TypeInfos.push_back(TI);
452  return TypeInfos.size();
453 }
454 
455 /// getFilterIDFor - Return the filter id for the specified typeinfos. This is
456 /// function wide.
457 int MachineModuleInfo::getFilterIDFor(std::vector<unsigned> &TyIds) {
458  // If the new filter coincides with the tail of an existing filter, then
459  // re-use the existing filter. Folding filters more than this requires
460  // re-ordering filters and/or their elements - probably not worth it.
461  for (std::vector<unsigned>::iterator I = FilterEnds.begin(),
462  E = FilterEnds.end(); I != E; ++I) {
463  unsigned i = *I, j = TyIds.size();
464 
465  while (i && j)
466  if (FilterIds[--i] != TyIds[--j])
467  goto try_next;
468 
469  if (!j)
470  // The new filter coincides with range [i, end) of the existing filter.
471  return -(1 + i);
472 
473 try_next:;
474  }
475 
476  // Add the new filter.
477  int FilterID = -(1 + FilterIds.size());
478  FilterIds.reserve(FilterIds.size() + TyIds.size() + 1);
479  FilterIds.insert(FilterIds.end(), TyIds.begin(), TyIds.end());
480  FilterEnds.push_back(FilterIds.size());
481  FilterIds.push_back(0); // terminator
482  return FilterID;
483 }
484 
485 /// getPersonality - Return the personality function for the current function.
487  for (const LandingPadInfo &LPI : LandingPads)
488  if (LPI.Personality)
489  return LPI.Personality;
490  return nullptr;
491 }
492 
494  if (PersonalityTypeCache == EHPersonality::Unknown) {
495  if (const Function *F = getPersonality())
496  PersonalityTypeCache = classifyEHPersonality(F);
497  }
498  return PersonalityTypeCache;
499 }
500 
501 /// getPersonalityIndex - Return unique index for current personality
502 /// function. NULL/first personality function should always get zero index.
504  const Function* Personality = nullptr;
505 
506  // Scan landing pads. If there is at least one non-NULL personality - use it.
507  for (unsigned i = 0, e = LandingPads.size(); i != e; ++i)
508  if (LandingPads[i].Personality) {
509  Personality = LandingPads[i].Personality;
510  break;
511  }
512 
513  for (unsigned i = 0, e = Personalities.size(); i < e; ++i) {
514  if (Personalities[i] == Personality)
515  return i;
516  }
517 
518  // This will happen if the current personality function is
519  // in the zero index.
520  return 0;
521 }
522 
524  StringRef WinEHParentName =
525  F->getFnAttribute("wineh-parent").getValueAsString();
526  if (WinEHParentName.empty() || WinEHParentName == F->getName())
527  return F;
528  return F->getParent()->getFunction(WinEHParentName);
529 }
530 
532  auto &Ptr = FuncInfoMap[getWinEHParent(F)];
533  if (!Ptr)
534  Ptr.reset(new WinEHFuncInfo);
535  return *Ptr;
536 }
unsigned getTypeIDFor(const GlobalValue *TI)
getTypeIDFor - Return the type id for the specified typeinfo.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool doFinalization(Module &) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:114
WinEHFuncInfo & getWinEHFuncInfo(const Function *F)
void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef< unsigned > Sites)
setCallSiteLandingPad - Map the landing pad's EH symbol to the call site indexes. ...
const Function * FilterOrFinally
void reset()
reset - return object to right after construction state to prepare to process a new module ...
Definition: MCContext.cpp:74
iterator end() const
Definition: ArrayRef.h:123
const Function * Personality
const Function * getParent() const
Return the enclosing method, or null if none.
Definition: BasicBlock.h:111
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
Definition: Function.h:225
F(f)
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
Definition: TinyPtrVector.h:26
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:188
void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New)
BlockAddress - The address of a basic block.
Definition: Constants.h:802
void takeDeletedSymbolsForFunction(const Function *F, std::vector< MCSymbol * > &Result)
takeDeletedSymbolsForFunction - If the specified function has had any references to address-taken blo...
SmallVector< MCSymbol *, 1 > EndLabels
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
SmallVector< SEHHandler, 1 > SEHHandlers
bool hasAddressTaken() const
Returns true if there are any uses of this basic block other than direct branches, switches, etc.
Definition: BasicBlock.h:306
#define false
Definition: ConvertUTF.c:65
MMIAddrLabelMap(MCContext &context)
Context object for machine code objects.
Definition: MCContext.h:48
LandingPadInfo - This structure is used to retain landing pad info for the current function...
LandingPadInfo & getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad)
getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the specified MachineBasicBlock.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:31
void addPersonality(MachineBasicBlock *LandingPad, const Function *Personality)
addPersonality - Provide the personality function for the exception information.
ArrayRef< MCSymbol * > getAddrLabelSymbolToEmit(const BasicBlock *BB)
getAddrLabelSymbolToEmit - Return the symbol to be used for the specified basic block when its addres...
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:134
void addFilterTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
addFilterTypeInfo - Provide the filter typeinfo for a landing pad.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
Definition: Module.cpp:188
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
Definition: MCContext.cpp:222
LLVM Basic Block Representation.
Definition: BasicBlock.h:65
void addCatchTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
SmallVector< MCSymbol *, 1 > BeginLabels
This file contains the declarations for the subclasses of Constant, which represent the different fla...
EHPersonality getPersonalityType()
Classify the personality function amongst known EH styles.
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
void takeDeletedSymbolsForFunction(Function *F, std::vector< MCSymbol * > &Result)
takeDeletedSymbolsForFunction - If we have any deleted symbols for F, return them.
std::vector< int > TypeIds
VariableDbgInfoMapTy VariableDbgInfos
iterator begin() const
Definition: ArrayRef.h:122
MCSymbol * addLandingPad(MachineBasicBlock *LandingPad)
addLandingPad - Add a new panding pad.
void addInvoke(MachineBasicBlock *LandingPad, MCSymbol *BeginLabel, MCSymbol *EndLabel)
addInvoke - Provide the begin and end labels of an invoke style call and associate it with a try land...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:56
void initializeMachineModuleInfoPass(PassRegistry &)
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Definition: MCSymbol.h:251
void addSEHCatchHandler(MachineBasicBlock *LandingPad, const Function *Filter, const BlockAddress *RecoverLabel)
ImmutablePass class - This class is used to provide information that does not need to be run...
Definition: Pass.h:262
Module.h This file contains the declarations for the Module class.
void setMap(MMIAddrLabelMap *map)
void addSEHCleanupHandler(MachineBasicBlock *LandingPad, const Function *Cleanup)
void addCleanup(MachineBasicBlock *LandingPad)
addCleanup - Add a cleanup action for a landing pad.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:576
void addWinEHState(MachineBasicBlock *LandingPad, int State)
MachineBasicBlock * LandingPadBlock
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
const Function * getWinEHParent(const Function *F) const
int getFilterIDFor(std::vector< unsigned > &TyIds)
getFilterIDFor - Return the id of the filter encoded by TyIds.
#define I(x, y, z)
Definition: MD5.cpp:54
#define N
unsigned getPersonalityIndex() const
getPersonalityIndex - Get index of the current personality function inside Personalitites array ...
void allUsesReplacedWith(Value *V2) override
Callback for Value RAUW.
Value * operator=(Value *RHS)
Definition: ValueHandle.h:80
ArrayRef< MCSymbol * > getAddrLabelSymbolToEmit(BasicBlock *BB)
void deleted() override
Callback for Value destruction.
StringRef getValueAsString() const
Return the attribute's value as a string.
Definition: Attributes.cpp:140
void TidyLandingPads(DenseMap< MCSymbol *, uintptr_t > *LPMap=nullptr)
TidyLandingPads - Remap landing pad labels and remove any deleted landing pads.
Module * getParent()
Get the module that this global value is contained inside of...
Definition: GlobalValue.h:365
LLVM Value Representation.
Definition: Value.h:69
const BlockAddress * RecoverBA
void UpdateForDeletedBlock(BasicBlock *BB)
Value handle with callbacks on RAUW and destruction.
Definition: ValueHandle.h:344
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
void EndFunction()
EndFunction - Discard function meta information.
MachineModuleInfoImpl - This class can be derived from and used by targets to hold private target-spe...
MachineModuleInfo - This class contains meta information specific to a module.
bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:110
const Function * getPersonality() const
getPersonality - Return a personality function if available.