LLVM 20.0.0git
BasicBlock.h
Go to the documentation of this file.
1//===- llvm/BasicBlock.h - Represent a basic block in the VM ----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the declaration of the BasicBlock class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_IR_BASICBLOCK_H
14#define LLVM_IR_BASICBLOCK_H
15
16#include "llvm-c/Types.h"
17#include "llvm/ADT/DenseMap.h"
18#include "llvm/ADT/Twine.h"
19#include "llvm/ADT/ilist.h"
20#include "llvm/ADT/ilist_node.h"
21#include "llvm/ADT/iterator.h"
24#include "llvm/IR/Instruction.h"
26#include "llvm/IR/Value.h"
27#include <cassert>
28#include <cstddef>
29#include <iterator>
30
31namespace llvm {
32
33class AssemblyAnnotationWriter;
34class CallInst;
35class DataLayout;
36class Function;
37class LandingPadInst;
38class LLVMContext;
39class Module;
40class PHINode;
41class ValueSymbolTable;
42class DbgVariableRecord;
43class DbgMarker;
44
45/// LLVM Basic Block Representation
46///
47/// This represents a single basic block in LLVM. A basic block is simply a
48/// container of instructions that execute sequentially. Basic blocks are Values
49/// because they are referenced by instructions such as branches and switch
50/// tables. The type of a BasicBlock is "Type::LabelTy" because the basic block
51/// represents a label to which a branch can jump.
52///
53/// A well formed basic block is formed of a list of non-terminating
54/// instructions followed by a single terminator instruction. Terminator
55/// instructions may not occur in the middle of basic blocks, and must terminate
56/// the blocks. The BasicBlock class allows malformed basic blocks to occur
57/// because it may be useful in the intermediate stage of constructing or
58/// modifying a program. However, the verifier will ensure that basic blocks are
59/// "well formed".
60class BasicBlock final : public Value, // Basic blocks are data objects also
61 public ilist_node_with_parent<BasicBlock, Function> {
62public:
65 /// Flag recording whether or not this block stores debug-info in the form
66 /// of intrinsic instructions (false) or non-instruction records (true).
68
69private:
70 // Allow Function to renumber blocks.
71 friend class Function;
72 /// Per-function unique number.
73 unsigned Number = -1u;
74
75 friend class BlockAddress;
77
78 InstListType InstList;
79 Function *Parent;
80
81public:
82 /// Attach a DbgMarker to the given instruction. Enables the storage of any
83 /// debug-info at this position in the program.
86
87 /// Convert variable location debugging information stored in dbg.value
88 /// intrinsics into DbgMarkers / DbgRecords. Deletes all dbg.values in
89 /// the process and sets IsNewDbgInfoFormat = true. Only takes effect if
90 /// the UseNewDbgInfoFormat LLVM command line option is given.
92
93 /// Convert variable location debugging information stored in DbgMarkers and
94 /// DbgRecords into the dbg.value intrinsic representation. Sets
95 /// IsNewDbgInfoFormat = false.
97
98 /// Ensure the block is in "old" dbg.value format (\p NewFlag == false) or
99 /// in the new format (\p NewFlag == true), converting to the desired format
100 /// if necessary.
101 void setIsNewDbgInfoFormat(bool NewFlag);
102 void setNewDbgInfoFormatFlag(bool NewFlag);
103
104 unsigned getNumber() const {
105 assert(getParent() && "only basic blocks in functions have valid numbers");
106 return Number;
107 }
108
109 /// Record that the collection of DbgRecords in \p M "trails" after the last
110 /// instruction of this block. These are equivalent to dbg.value intrinsics
111 /// that exist at the end of a basic block with no terminator (a transient
112 /// state that occurs regularly).
114
115 /// Fetch the collection of DbgRecords that "trail" after the last instruction
116 /// of this block, see \ref setTrailingDbgRecords. If there are none, returns
117 /// nullptr.
119
120 /// Delete any trailing DbgRecords at the end of this block, see
121 /// \ref setTrailingDbgRecords.
123
124 void dumpDbgValues() const;
125
126 /// Return the DbgMarker for the position given by \p It, so that DbgRecords
127 /// can be inserted there. This will either be nullptr if not present, a
128 /// DbgMarker, or TrailingDbgRecords if It is end().
130
131 /// Return the DbgMarker for the position that comes after \p I. \see
132 /// BasicBlock::getMarker, this can be nullptr, a DbgMarker, or
133 /// TrailingDbgRecords if there is no next instruction.
135
136 /// Insert a DbgRecord into a block at the position given by \p I.
138
139 /// Insert a DbgRecord into a block at the position given by \p Here.
141
142 /// Eject any debug-info trailing at the end of a block. DbgRecords can
143 /// transiently be located "off the end" of a block if the blocks terminator
144 /// is temporarily removed. Once a terminator is re-inserted this method will
145 /// move such DbgRecords back to the right place (ahead of the terminator).
147
148 /// In rare circumstances instructions can be speculatively removed from
149 /// blocks, and then be re-inserted back into that position later. When this
150 /// happens in RemoveDIs debug-info mode, some special patching-up needs to
151 /// occur: inserting into the middle of a sequence of dbg.value intrinsics
152 /// does not have an equivalent with DbgRecords.
154 std::optional<DbgRecord::self_iterator> Pos);
155
156private:
157 void setParent(Function *parent);
158
159 /// Constructor.
160 ///
161 /// If the function parameter is specified, the basic block is automatically
162 /// inserted at either the end of the function (if InsertBefore is null), or
163 /// before the specified basic block.
164 explicit BasicBlock(LLVMContext &C, const Twine &Name = "",
165 Function *Parent = nullptr,
166 BasicBlock *InsertBefore = nullptr);
167
168public:
169 BasicBlock(const BasicBlock &) = delete;
170 BasicBlock &operator=(const BasicBlock &) = delete;
171 ~BasicBlock();
172
173 /// Get the context in which this basic block lives.
174 LLVMContext &getContext() const;
175
176 /// Instruction iterators...
181
182 // These functions and classes need access to the instruction list.
187 friend class llvm::SymbolTableListTraits<
188 llvm::Instruction, ilist_iterator_bits<true>, ilist_parent<BasicBlock>>;
189 friend class llvm::ilist_node_with_parent<llvm::Instruction, llvm::BasicBlock,
190 ilist_iterator_bits<true>,
191 ilist_parent<BasicBlock>>;
192
193 // Friendly methods that need to access us for the maintenence of
194 // debug-info attachments.
195 friend void Instruction::insertBefore(BasicBlock::iterator InsertPos);
196 friend void Instruction::insertAfter(Instruction *InsertPos);
197 friend void Instruction::insertAfter(BasicBlock::iterator InsertPos);
198 friend void Instruction::insertBefore(BasicBlock &BB,
199 InstListType::iterator InsertPos);
200 friend void Instruction::moveBeforeImpl(BasicBlock &BB,
201 InstListType::iterator I,
202 bool Preserve);
203 friend iterator_range<DbgRecord::self_iterator>
205 const Instruction *From, std::optional<DbgRecord::self_iterator> FromHere,
206 bool InsertAtHead);
207
208 /// Creates a new BasicBlock.
209 ///
210 /// If the Parent parameter is specified, the basic block is automatically
211 /// inserted at either the end of the function (if InsertBefore is 0), or
212 /// before the specified basic block.
213 static BasicBlock *Create(LLVMContext &Context, const Twine &Name = "",
214 Function *Parent = nullptr,
215 BasicBlock *InsertBefore = nullptr) {
216 return new BasicBlock(Context, Name, Parent, InsertBefore);
217 }
218
219 /// Return the enclosing method, or null if none.
220 const Function *getParent() const { return Parent; }
221 Function *getParent() { return Parent; }
222
223 /// Return the module owning the function this basic block belongs to, or
224 /// nullptr if the function does not have a module.
225 ///
226 /// Note: this is undefined behavior if the block does not have a parent.
227 const Module *getModule() const;
229 return const_cast<Module *>(
230 static_cast<const BasicBlock *>(this)->getModule());
231 }
232
233 /// Get the data layout of the module this basic block belongs to.
234 ///
235 /// Requires the basic block to have a parent module.
236 const DataLayout &getDataLayout() const;
237
238 /// Returns the terminator instruction if the block is well formed or null
239 /// if the block is not well formed.
241 if (InstList.empty() || !InstList.back().isTerminator())
242 return nullptr;
243 return &InstList.back();
244 }
246 return const_cast<Instruction *>(
247 static_cast<const BasicBlock *>(this)->getTerminator());
248 }
249
250 /// Returns the call instruction calling \@llvm.experimental.deoptimize
251 /// prior to the terminating return instruction of this basic block, if such
252 /// a call is present. Otherwise, returns null.
255 return const_cast<CallInst *>(
256 static_cast<const BasicBlock *>(this)->getTerminatingDeoptimizeCall());
257 }
258
259 /// Returns the call instruction calling \@llvm.experimental.deoptimize
260 /// that is present either in current basic block or in block that is a unique
261 /// successor to current block, if such call is present. Otherwise, returns null.
264 return const_cast<CallInst *>(
265 static_cast<const BasicBlock *>(this)->getPostdominatingDeoptimizeCall());
266 }
267
268 /// Returns the call instruction marked 'musttail' prior to the terminating
269 /// return instruction of this basic block, if such a call is present.
270 /// Otherwise, returns null.
273 return const_cast<CallInst *>(
274 static_cast<const BasicBlock *>(this)->getTerminatingMustTailCall());
275 }
276
277 /// Returns a pointer to the first instruction in this block that is not a
278 /// PHINode instruction.
279 ///
280 /// When adding instructions to the beginning of the basic block, they should
281 /// be added before the returned value, not before the first instruction,
282 /// which might be PHI. Returns 0 is there's no non-PHI instruction.
283 const Instruction* getFirstNonPHI() const;
285 return const_cast<Instruction *>(
286 static_cast<const BasicBlock *>(this)->getFirstNonPHI());
287 }
288
289 /// Iterator returning form of getFirstNonPHI. Installed as a placeholder for
290 /// the RemoveDIs project that will eventually remove debug intrinsics.
294 static_cast<const BasicBlock *>(this)->getFirstNonPHIIt().getNonConst();
295 It.setHeadBit(true);
296 return It;
297 }
298
299 /// Returns a pointer to the first instruction in this block that is not a
300 /// PHINode or a debug intrinsic, or any pseudo operation if \c SkipPseudoOp
301 /// is true.
302 const Instruction *getFirstNonPHIOrDbg(bool SkipPseudoOp = true) const;
303 Instruction *getFirstNonPHIOrDbg(bool SkipPseudoOp = true) {
304 return const_cast<Instruction *>(
305 static_cast<const BasicBlock *>(this)->getFirstNonPHIOrDbg(
306 SkipPseudoOp));
307 }
308
309 /// Returns a pointer to the first instruction in this block that is not a
310 /// PHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo
311 /// operation if \c SkipPseudoOp is true.
312 const Instruction *
313 getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp = true) const;
314 Instruction *getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp = true) {
315 return const_cast<Instruction *>(
316 static_cast<const BasicBlock *>(this)->getFirstNonPHIOrDbgOrLifetime(
317 SkipPseudoOp));
318 }
319
320 /// Returns an iterator to the first instruction in this block that is
321 /// suitable for inserting a non-PHI instruction.
322 ///
323 /// In particular, it skips all PHIs and LandingPad instructions.
326 return static_cast<const BasicBlock *>(this)
327 ->getFirstInsertionPt().getNonConst();
328 }
329
330 /// Returns an iterator to the first instruction in this block that is
331 /// not a PHINode, a debug intrinsic, a static alloca or any pseudo operation.
334 return static_cast<const BasicBlock *>(this)
336 .getNonConst();
337 }
338
339 /// Returns the first potential AsynchEH faulty instruction
340 /// currently it checks for loads/stores (which may dereference a null
341 /// pointer) and calls/invokes (which may propagate exceptions)
342 const Instruction* getFirstMayFaultInst() const;
344 return const_cast<Instruction*>(
345 static_cast<const BasicBlock*>(this)->getFirstMayFaultInst());
346 }
347
348 /// Return a const iterator range over the instructions in the block, skipping
349 /// any debug instructions. Skip any pseudo operations as well if \c
350 /// SkipPseudoOp is true.
352 std::function<bool(const Instruction &)>>>
353 instructionsWithoutDebug(bool SkipPseudoOp = true) const;
354
355 /// Return an iterator range over the instructions in the block, skipping any
356 /// debug instructions. Skip and any pseudo operations as well if \c
357 /// SkipPseudoOp is true.
360 instructionsWithoutDebug(bool SkipPseudoOp = true);
361
362 /// Return the size of the basic block ignoring debug instructions
364 std::function<bool(const Instruction &)>>::difference_type
365 sizeWithoutDebug() const;
366
367 /// Unlink 'this' from the containing function, but do not delete it.
368 void removeFromParent();
369
370 /// Unlink 'this' from the containing function and delete it.
371 ///
372 // \returns an iterator pointing to the element after the erased one.
374
375 /// Unlink this basic block from its current function and insert it into
376 /// the function that \p MovePos lives in, right before \p MovePos.
377 inline void moveBefore(BasicBlock *MovePos) {
378 moveBefore(MovePos->getIterator());
379 }
381
382 /// Unlink this basic block from its current function and insert it
383 /// right after \p MovePos in the function \p MovePos lives in.
384 void moveAfter(BasicBlock *MovePos);
385
386 /// Insert unlinked basic block into a function.
387 ///
388 /// Inserts an unlinked basic block into \c Parent. If \c InsertBefore is
389 /// provided, inserts before that basic block, otherwise inserts at the end.
390 ///
391 /// \pre \a getParent() is \c nullptr.
392 void insertInto(Function *Parent, BasicBlock *InsertBefore = nullptr);
393
394 /// Return the predecessor of this block if it has a single predecessor
395 /// block. Otherwise return a null pointer.
396 const BasicBlock *getSinglePredecessor() const;
398 return const_cast<BasicBlock *>(
399 static_cast<const BasicBlock *>(this)->getSinglePredecessor());
400 }
401
402 /// Return the predecessor of this block if it has a unique predecessor
403 /// block. Otherwise return a null pointer.
404 ///
405 /// Note that unique predecessor doesn't mean single edge, there can be
406 /// multiple edges from the unique predecessor to this block (for example a
407 /// switch statement with multiple cases having the same destination).
408 const BasicBlock *getUniquePredecessor() const;
410 return const_cast<BasicBlock *>(
411 static_cast<const BasicBlock *>(this)->getUniquePredecessor());
412 }
413
414 /// Return true if this block has exactly N predecessors.
415 bool hasNPredecessors(unsigned N) const;
416
417 /// Return true if this block has N predecessors or more.
418 bool hasNPredecessorsOrMore(unsigned N) const;
419
420 /// Return the successor of this block if it has a single successor.
421 /// Otherwise return a null pointer.
422 ///
423 /// This method is analogous to getSinglePredecessor above.
424 const BasicBlock *getSingleSuccessor() const;
426 return const_cast<BasicBlock *>(
427 static_cast<const BasicBlock *>(this)->getSingleSuccessor());
428 }
429
430 /// Return the successor of this block if it has a unique successor.
431 /// Otherwise return a null pointer.
432 ///
433 /// This method is analogous to getUniquePredecessor above.
434 const BasicBlock *getUniqueSuccessor() const;
436 return const_cast<BasicBlock *>(
437 static_cast<const BasicBlock *>(this)->getUniqueSuccessor());
438 }
439
440 /// Print the basic block to an output stream with an optional
441 /// AssemblyAnnotationWriter.
442 void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
443 bool ShouldPreserveUseListOrder = false,
444 bool IsForDebug = false) const;
445
446 //===--------------------------------------------------------------------===//
447 /// Instruction iterator methods
448 ///
449 inline iterator begin() {
450 iterator It = InstList.begin();
451 // Set the head-inclusive bit to indicate that this iterator includes
452 // any debug-info at the start of the block. This is a no-op unless the
453 // appropriate CMake flag is set.
454 It.setHeadBit(true);
455 return It;
456 }
457 inline const_iterator begin() const {
458 const_iterator It = InstList.begin();
459 It.setHeadBit(true);
460 return It;
461 }
462 inline iterator end () { return InstList.end(); }
463 inline const_iterator end () const { return InstList.end(); }
464
465 inline reverse_iterator rbegin() { return InstList.rbegin(); }
466 inline const_reverse_iterator rbegin() const { return InstList.rbegin(); }
467 inline reverse_iterator rend () { return InstList.rend(); }
468 inline const_reverse_iterator rend () const { return InstList.rend(); }
469
470 inline size_t size() const { return InstList.size(); }
471 inline bool empty() const { return InstList.empty(); }
472 inline const Instruction &front() const { return InstList.front(); }
473 inline Instruction &front() { return InstList.front(); }
474 inline const Instruction &back() const { return InstList.back(); }
475 inline Instruction &back() { return InstList.back(); }
476
477 /// Iterator to walk just the phi nodes in the basic block.
478 template <typename PHINodeT = PHINode, typename BBIteratorT = iterator>
480 : public iterator_facade_base<phi_iterator_impl<PHINodeT, BBIteratorT>,
481 std::forward_iterator_tag, PHINodeT> {
482 friend BasicBlock;
483
484 PHINodeT *PN;
485
486 phi_iterator_impl(PHINodeT *PN) : PN(PN) {}
487
488 public:
489 // Allow default construction to build variables, but this doesn't build
490 // a useful iterator.
491 phi_iterator_impl() = default;
492
493 // Allow conversion between instantiations where valid.
494 template <typename PHINodeU, typename BBIteratorU,
495 typename = std::enable_if_t<
496 std::is_convertible<PHINodeU *, PHINodeT *>::value>>
498 : PN(Arg.PN) {}
499
500 bool operator==(const phi_iterator_impl &Arg) const { return PN == Arg.PN; }
501
502 PHINodeT &operator*() const { return *PN; }
503
504 using phi_iterator_impl::iterator_facade_base::operator++;
506 assert(PN && "Cannot increment the end iterator!");
507 PN = dyn_cast<PHINodeT>(std::next(BBIteratorT(PN)));
508 return *this;
509 }
510 };
514
515 /// Returns a range that iterates over the phis in the basic block.
516 ///
517 /// Note that this cannot be used with basic blocks that have no terminator.
519 return const_cast<BasicBlock *>(this)->phis();
520 }
522
523private:
524 /// Return the underlying instruction list container.
525 /// This is deliberately private because we have implemented an adequate set
526 /// of functions to modify the list, including BasicBlock::splice(),
527 /// BasicBlock::erase(), Instruction::insertInto() etc.
528 const InstListType &getInstList() const { return InstList; }
529 InstListType &getInstList() { return InstList; }
530
531 /// Returns a pointer to a member of the instruction list.
532 /// This is private on purpose, just like `getInstList()`.
533 static InstListType BasicBlock::*getSublistAccess(Instruction *) {
534 return &BasicBlock::InstList;
535 }
536
537 /// Dedicated function for splicing debug-info: when we have an empty
538 /// splice (i.e. zero instructions), the caller may still intend any
539 /// debug-info in between the two "positions" to be spliced.
540 void spliceDebugInfoEmptyBlock(BasicBlock::iterator ToIt, BasicBlock *FromBB,
541 BasicBlock::iterator FromBeginIt,
542 BasicBlock::iterator FromEndIt);
543
544 /// Perform any debug-info specific maintenence for the given splice
545 /// activity. In the DbgRecord debug-info representation, debug-info is not
546 /// in instructions, and so it does not automatically move from one block
547 /// to another.
548 void spliceDebugInfo(BasicBlock::iterator ToIt, BasicBlock *FromBB,
549 BasicBlock::iterator FromBeginIt,
550 BasicBlock::iterator FromEndIt);
551 void spliceDebugInfoImpl(BasicBlock::iterator ToIt, BasicBlock *FromBB,
552 BasicBlock::iterator FromBeginIt,
553 BasicBlock::iterator FromEndIt);
554
555public:
556 /// Returns a pointer to the symbol table if one exists.
557 ValueSymbolTable *getValueSymbolTable();
558
559 /// Methods for support type inquiry through isa, cast, and dyn_cast.
560 static bool classof(const Value *V) {
561 return V->getValueID() == Value::BasicBlockVal;
562 }
563
564 /// Cause all subinstructions to "let go" of all the references that said
565 /// subinstructions are maintaining.
566 ///
567 /// This allows one to 'delete' a whole class at a time, even though there may
568 /// be circular references... first all references are dropped, and all use
569 /// counts go to zero. Then everything is delete'd for real. Note that no
570 /// operations are valid on an object that has "dropped all references",
571 /// except operator delete.
572 void dropAllReferences();
573
574 /// Update PHI nodes in this BasicBlock before removal of predecessor \p Pred.
575 /// Note that this function does not actually remove the predecessor.
576 ///
577 /// If \p KeepOneInputPHIs is true then don't remove PHIs that are left with
578 /// zero or one incoming values, and don't simplify PHIs with all incoming
579 /// values the same.
580 void removePredecessor(BasicBlock *Pred, bool KeepOneInputPHIs = false);
581
582 bool canSplitPredecessors() const;
583
584 /// Split the basic block into two basic blocks at the specified instruction.
585 ///
586 /// If \p Before is true, splitBasicBlockBefore handles the
587 /// block splitting. Otherwise, execution proceeds as described below.
588 ///
589 /// Note that all instructions BEFORE the specified iterator
590 /// stay as part of the original basic block, an unconditional branch is added
591 /// to the original BB, and the rest of the instructions in the BB are moved
592 /// to the new BB, including the old terminator. The newly formed basic block
593 /// is returned. This function invalidates the specified iterator.
594 ///
595 /// Note that this only works on well formed basic blocks (must have a
596 /// terminator), and \p 'I' must not be the end of instruction list (which
597 /// would cause a degenerate basic block to be formed, having a terminator
598 /// inside of the basic block).
599 ///
600 /// Also note that this doesn't preserve any passes. To split blocks while
601 /// keeping loop information consistent, use the SplitBlock utility function.
602 BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = "",
603 bool Before = false);
605 bool Before = false) {
606 return splitBasicBlock(I->getIterator(), BBName, Before);
607 }
608
609 /// Split the basic block into two basic blocks at the specified instruction
610 /// and insert the new basic blocks as the predecessor of the current block.
611 ///
612 /// This function ensures all instructions AFTER and including the specified
613 /// iterator \p I are part of the original basic block. All Instructions
614 /// BEFORE the iterator \p I are moved to the new BB and an unconditional
615 /// branch is added to the new BB. The new basic block is returned.
616 ///
617 /// Note that this only works on well formed basic blocks (must have a
618 /// terminator), and \p 'I' must not be the end of instruction list (which
619 /// would cause a degenerate basic block to be formed, having a terminator
620 /// inside of the basic block). \p 'I' cannot be a iterator for a PHINode
621 /// with multiple incoming blocks.
622 ///
623 /// Also note that this doesn't preserve any passes. To split blocks while
624 /// keeping loop information consistent, use the SplitBlockBefore utility
625 /// function.
626 BasicBlock *splitBasicBlockBefore(iterator I, const Twine &BBName = "");
628 return splitBasicBlockBefore(I->getIterator(), BBName);
629 }
630
631 /// Transfer all instructions from \p FromBB to this basic block at \p ToIt.
633 splice(ToIt, FromBB, FromBB->begin(), FromBB->end());
634 }
635
636 /// Transfer one instruction from \p FromBB at \p FromIt to this basic block
637 /// at \p ToIt.
639 BasicBlock::iterator FromIt) {
640 auto FromItNext = std::next(FromIt);
641 // Single-element splice is a noop if destination == source.
642 if (ToIt == FromIt || ToIt == FromItNext)
643 return;
644 splice(ToIt, FromBB, FromIt, FromItNext);
645 }
646
647 /// Transfer a range of instructions that belong to \p FromBB from \p
648 /// FromBeginIt to \p FromEndIt, to this basic block at \p ToIt.
649 void splice(BasicBlock::iterator ToIt, BasicBlock *FromBB,
650 BasicBlock::iterator FromBeginIt,
651 BasicBlock::iterator FromEndIt);
652
653 /// Erases a range of instructions from \p FromIt to (not including) \p ToIt.
654 /// \Returns \p ToIt.
656
657 /// Returns true if there are any uses of this basic block other than
658 /// direct branches, switches, etc. to it.
659 bool hasAddressTaken() const {
660 return getBasicBlockBits().BlockAddressRefCount != 0;
661 }
662
663 /// Update all phi nodes in this basic block to refer to basic block \p New
664 /// instead of basic block \p Old.
666
667 /// Update all phi nodes in this basic block's successors to refer to basic
668 /// block \p New instead of basic block \p Old.
670
671 /// Update all phi nodes in this basic block's successors to refer to basic
672 /// block \p New instead of to it.
674
675 /// Return true if this basic block is an exception handling block.
676 bool isEHPad() const { return getFirstNonPHIIt()->isEHPad(); }
677
678 /// Return true if this basic block is a landing pad.
679 ///
680 /// Being a ``landing pad'' means that the basic block is the destination of
681 /// the 'unwind' edge of an invoke instruction.
682 bool isLandingPad() const;
683
684 /// Return the landingpad instruction associated with the landing pad.
685 const LandingPadInst *getLandingPadInst() const;
687 return const_cast<LandingPadInst *>(
688 static_cast<const BasicBlock *>(this)->getLandingPadInst());
689 }
690
691 /// Return true if it is legal to hoist instructions into this block.
692 bool isLegalToHoistInto() const;
693
694 /// Return true if this is the entry block of the containing function.
695 /// This method can only be used on blocks that have a parent function.
696 bool isEntryBlock() const;
697
698 std::optional<uint64_t> getIrrLoopHeaderWeight() const;
699
700 /// Returns true if the Order field of child Instructions is valid.
701 bool isInstrOrderValid() const {
702 return getBasicBlockBits().InstrOrderValid;
703 }
704
705 /// Mark instruction ordering invalid. Done on every instruction insert.
708 BasicBlockBits Bits = getBasicBlockBits();
709 Bits.InstrOrderValid = false;
710 setBasicBlockBits(Bits);
711 }
712
713 /// Renumber instructions and mark the ordering as valid.
715
716 /// Asserts that instruction order numbers are marked invalid, or that they
717 /// are in ascending order. This is constant time if the ordering is invalid,
718 /// and linear in the number of instructions if the ordering is valid. Callers
719 /// should be careful not to call this in ways that make common operations
720 /// O(n^2). For example, it takes O(n) time to assign order numbers to
721 /// instructions, so the order should be validated no more than once after
722 /// each ordering to ensure that transforms have the same algorithmic
723 /// complexity when asserts are enabled as when they are disabled.
724 void validateInstrOrdering() const;
725
726private:
727#if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
728// Except for GCC; by default, AIX compilers store bit-fields in 4-byte words
729// and give the `pack` pragma push semantics.
730#define BEGIN_TWO_BYTE_PACK() _Pragma("pack(2)")
731#define END_TWO_BYTE_PACK() _Pragma("pack(pop)")
732#else
733#define BEGIN_TWO_BYTE_PACK()
734#define END_TWO_BYTE_PACK()
735#endif
736
738 /// Bitfield to help interpret the bits in Value::SubclassData.
739 struct BasicBlockBits {
740 unsigned short BlockAddressRefCount : 15;
741 unsigned short InstrOrderValid : 1;
742 };
744
745#undef BEGIN_TWO_BYTE_PACK
746#undef END_TWO_BYTE_PACK
747
748 /// Safely reinterpret the subclass data bits to a more useful form.
749 BasicBlockBits getBasicBlockBits() const {
750 static_assert(sizeof(BasicBlockBits) == sizeof(unsigned short),
751 "too many bits for Value::SubclassData");
752 unsigned short ValueData = getSubclassDataFromValue();
753 BasicBlockBits AsBits;
754 memcpy(&AsBits, &ValueData, sizeof(AsBits));
755 return AsBits;
756 }
757
758 /// Reinterpret our subclass bits and store them back into Value.
759 void setBasicBlockBits(BasicBlockBits AsBits) {
760 unsigned short D;
761 memcpy(&D, &AsBits, sizeof(D));
763 }
764
765 /// Increment the internal refcount of the number of BlockAddresses
766 /// referencing this BasicBlock by \p Amt.
767 ///
768 /// This is almost always 0, sometimes one possibly, but almost never 2, and
769 /// inconceivably 3 or more.
770 void AdjustBlockAddressRefCount(int Amt) {
771 BasicBlockBits Bits = getBasicBlockBits();
772 Bits.BlockAddressRefCount += Amt;
773 setBasicBlockBits(Bits);
774 assert(Bits.BlockAddressRefCount < 255 && "Refcount wrap-around");
775 }
776
777 /// Shadow Value::setValueSubclassData with a private forwarding method so
778 /// that any future subclasses cannot accidentally use it.
779 void setValueSubclassData(unsigned short D) {
781 }
782};
783
784// Create wrappers for C Binding types (see CBindingWrapping.h).
786
787/// Advance \p It while it points to a debug instruction and return the result.
788/// This assumes that \p It is not at the end of a block.
790
791#ifdef NDEBUG
792/// In release builds, this is a no-op. For !NDEBUG builds, the checks are
793/// implemented in the .cpp file to avoid circular header deps.
794inline void BasicBlock::validateInstrOrdering() const {}
795#endif
796
797// Specialize DenseMapInfo for iterators, so that ththey can be installed into
798// maps and sets. The iterator is made up of its node pointer, and the
799// debug-info "head" bit.
800template <> struct DenseMapInfo<BasicBlock::iterator> {
802 return BasicBlock::iterator(nullptr);
803 }
804
806 BasicBlock::iterator It(nullptr);
807 It.setHeadBit(true);
808 return It;
809 }
810
811 static unsigned getHashValue(const BasicBlock::iterator &It) {
813 reinterpret_cast<void *>(It.getNodePtr())) ^
814 (unsigned)It.getHeadBit();
815 }
816
817 static bool isEqual(const BasicBlock::iterator &LHS,
818 const BasicBlock::iterator &RHS) {
819 return LHS == RHS && LHS.getHeadBit() == RHS.getHeadBit();
820 }
821};
822
823} // end namespace llvm
824
825#endif // LLVM_IR_BASICBLOCK_H
aarch64 promote const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
#define LLVM_READONLY
Definition: Compiler.h:306
This file defines the DenseMap class.
std::string Name
#define I(x, y, z)
Definition: MD5.cpp:58
Machine Check Debug Module
uint32_t Number
Definition: Profile.cpp:47
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
#define END_TWO_BYTE_PACK()
#define BEGIN_TWO_BYTE_PACK()
Value * RHS
Value * LHS
Iterator to walk just the phi nodes in the basic block.
Definition: BasicBlock.h:481
bool operator==(const phi_iterator_impl &Arg) const
Definition: BasicBlock.h:500
phi_iterator_impl(const phi_iterator_impl< PHINodeU, BBIteratorU > &Arg)
Definition: BasicBlock.h:497
phi_iterator_impl & operator++()
Definition: BasicBlock.h:505
LLVM Basic Block Representation.
Definition: BasicBlock.h:61
BasicBlock::iterator erase(BasicBlock::iterator FromIt, BasicBlock::iterator ToIt)
Erases a range of instructions from FromIt to (not including) ToIt.
Definition: BasicBlock.cpp:644
void replaceSuccessorsPhiUsesWith(BasicBlock *Old, BasicBlock *New)
Update all phi nodes in this basic block's successors to refer to basic block New instead of basic bl...
Definition: BasicBlock.cpp:662
BasicBlock(const BasicBlock &)=delete
iterator end()
Definition: BasicBlock.h:462
unsigned getNumber() const
Definition: BasicBlock.h:104
Instruction * getFirstMayFaultInst()
Definition: BasicBlock.h:343
iterator begin()
Instruction iterator methods.
Definition: BasicBlock.h:449
void deleteTrailingDbgRecords()
Delete any trailing DbgRecords at the end of this block, see setTrailingDbgRecords.
iterator_range< const_phi_iterator > phis() const
Returns a range that iterates over the phis in the basic block.
Definition: BasicBlock.h:518
const_iterator begin() const
Definition: BasicBlock.h:457
const LandingPadInst * getLandingPadInst() const
Return the landingpad instruction associated with the landing pad.
Definition: BasicBlock.cpp:681
void setTrailingDbgRecords(DbgMarker *M)
Record that the collection of DbgRecords in M "trails" after the last instruction of this block.
const_iterator getFirstInsertionPt() const
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
Definition: BasicBlock.cpp:416
reverse_iterator rbegin()
Definition: BasicBlock.h:465
static bool classof(const Value *V)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: BasicBlock.h:560
void renumberInstructions()
Renumber instructions and mark the ordering as valid.
Definition: BasicBlock.cpp:704
iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > instructionsWithoutDebug(bool SkipPseudoOp=true) const
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Definition: BasicBlock.cpp:250
InstListType::iterator getFirstNonPHIIt()
Definition: BasicBlock.h:292
bool empty() const
Definition: BasicBlock.h:471
DbgMarker * createMarker(Instruction *I)
Attach a DbgMarker to the given instruction.
Definition: BasicBlock.cpp:52
BasicBlock * splitBasicBlock(Instruction *I, const Twine &BBName="", bool Before=false)
Definition: BasicBlock.h:604
BasicBlock * splitBasicBlockBefore(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction and insert the new basic blo...
Definition: BasicBlock.cpp:608
bool hasAddressTaken() const
Returns true if there are any uses of this basic block other than direct branches,...
Definition: BasicBlock.h:659
InstListType::const_iterator getFirstNonPHIIt() const
Iterator returning form of getFirstNonPHI.
Definition: BasicBlock.cpp:374
void insertDbgRecordBefore(DbgRecord *DR, InstListType::iterator Here)
Insert a DbgRecord into a block at the position given by Here.
BasicBlock * splitBasicBlockBefore(Instruction *I, const Twine &BBName="")
Definition: BasicBlock.h:627
void invalidateOrders()
Mark instruction ordering invalid. Done on every instruction insert.
Definition: BasicBlock.h:706
friend void Instruction::removeFromParent()
void convertToNewDbgValues()
Convert variable location debugging information stored in dbg.value intrinsics into DbgMarkers / DbgR...
Definition: BasicBlock.cpp:76
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW=nullptr, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
Print the basic block to an output stream with an optional AssemblyAnnotationWriter.
Definition: AsmWriter.cpp:4901
InstListType::const_iterator const_iterator
Definition: BasicBlock.h:178
void setIsNewDbgInfoFormat(bool NewFlag)
Ensure the block is in "old" dbg.value format (NewFlag == false) or in the new format (NewFlag == tru...
Definition: BasicBlock.cpp:152
const Instruction * getFirstNonPHI() const
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
Definition: BasicBlock.cpp:367
BasicBlock * getUniqueSuccessor()
Definition: BasicBlock.h:435
const Instruction & front() const
Definition: BasicBlock.h:472
Module * getModule()
Definition: BasicBlock.h:228
Instruction & front()
Definition: BasicBlock.h:473
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
Definition: BasicBlock.h:213
BasicBlock * getSingleSuccessor()
Definition: BasicBlock.h:425
friend BasicBlock::iterator Instruction::eraseFromParent()
void setNewDbgInfoFormatFlag(bool NewFlag)
Definition: BasicBlock.cpp:158
bool isEntryBlock() const
Return true if this is the entry block of the containing function.
Definition: BasicBlock.cpp:571
ValueSymbolTable * getValueSymbolTable()
Returns a pointer to the symbol table if one exists.
Definition: BasicBlock.cpp:162
BasicBlock * getUniquePredecessor()
Definition: BasicBlock.h:409
void moveAfter(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it right after MovePos in the function M...
Definition: BasicBlock.cpp:287
bool hasNPredecessors(unsigned N) const
Return true if this block has exactly N predecessors.
Definition: BasicBlock.cpp:481
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="", bool Before=false)
Split the basic block into two basic blocks at the specified instruction.
Definition: BasicBlock.cpp:577
BasicBlock * getSinglePredecessor()
Definition: BasicBlock.h:397
void convertFromNewDbgValues()
Convert variable location debugging information stored in DbgMarkers and DbgRecords into the dbg....
Definition: BasicBlock.cpp:115
const BasicBlock * getUniqueSuccessor() const
Return the successor of this block if it has a unique successor.
Definition: BasicBlock.cpp:497
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
Definition: BasicBlock.cpp:459
std::optional< uint64_t > getIrrLoopHeaderWeight() const
Definition: BasicBlock.cpp:685
Instruction * getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp=true)
Definition: BasicBlock.h:314
void dumpDbgValues() const
Definition: BasicBlock.cpp:141
const CallInst * getTerminatingDeoptimizeCall() const
Returns the call instruction calling @llvm.experimental.deoptimize prior to the terminating return in...
Definition: BasicBlock.cpp:331
Instruction & back()
Definition: BasicBlock.h:475
InstListType::reverse_iterator reverse_iterator
Definition: BasicBlock.h:179
friend void Instruction::moveBeforeImpl(BasicBlock &BB, InstListType::iterator I, bool Preserve)
void replacePhiUsesWith(BasicBlock *Old, BasicBlock *New)
Update all phi nodes in this basic block to refer to basic block New instead of basic block Old.
Definition: BasicBlock.cpp:651
const Instruction * getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp=true) const
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic,...
Definition: BasicBlock.cpp:400
const BasicBlock * getUniquePredecessor() const
Return the predecessor of this block if it has a unique predecessor block.
Definition: BasicBlock.cpp:467
const BasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition: BasicBlock.cpp:489
void flushTerminatorDbgRecords()
Eject any debug-info trailing at the end of a block.
Definition: BasicBlock.cpp:717
void splice(BasicBlock::iterator ToIt, BasicBlock *FromBB, BasicBlock::iterator FromIt)
Transfer one instruction from FromBB at FromIt to this basic block at ToIt.
Definition: BasicBlock.h:638
const Function * getParent() const
Return the enclosing method, or null if none.
Definition: BasicBlock.h:220
Function * getParent()
Definition: BasicBlock.h:221
const DataLayout & getDataLayout() const
Get the data layout of the module this basic block belongs to.
Definition: BasicBlock.cpp:296
const_reverse_iterator rend() const
Definition: BasicBlock.h:468
reverse_iterator rend()
Definition: BasicBlock.h:467
void insertDbgRecordAfter(DbgRecord *DR, Instruction *I)
Insert a DbgRecord into a block at the position given by I.
void validateInstrOrdering() const
Asserts that instruction order numbers are marked invalid, or that they are in ascending order.
const Instruction * getFirstNonPHIOrDbg(bool SkipPseudoOp=true) const
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic,...
Definition: BasicBlock.cpp:386
DbgMarker * getMarker(InstListType::iterator It)
Return the DbgMarker for the position given by It, so that DbgRecords can be inserted there.
filter_iterator< BasicBlock::const_iterator, std::function< bool(constInstruction &)> >::difference_type sizeWithoutDebug() const
Return the size of the basic block ignoring debug instructions.
Definition: BasicBlock.cpp:270
InstListType::iterator iterator
Instruction iterators...
Definition: BasicBlock.h:177
Instruction * getFirstNonPHI()
Definition: BasicBlock.h:284
LLVMContext & getContext() const
Get the context in which this basic block lives.
Definition: BasicBlock.cpp:168
CallInst * getPostdominatingDeoptimizeCall()
Definition: BasicBlock.h:263
const_iterator getFirstNonPHIOrDbgOrAlloca() const
Returns an iterator to the first instruction in this block that is not a PHINode, a debug intrinsic,...
Definition: BasicBlock.cpp:430
SymbolTableList< Instruction, ilist_iterator_bits< true >, ilist_parent< BasicBlock > > InstListType
Definition: BasicBlock.h:64
Instruction * getTerminator()
Definition: BasicBlock.h:245
BasicBlock & operator=(const BasicBlock &)=delete
iterator getFirstNonPHIOrDbgOrAlloca()
Definition: BasicBlock.h:333
bool IsNewDbgInfoFormat
Flag recording whether or not this block stores debug-info in the form of intrinsic instructions (fal...
Definition: BasicBlock.h:67
CallInst * getTerminatingDeoptimizeCall()
Definition: BasicBlock.h:254
void dropAllReferences()
Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining...
Definition: BasicBlock.cpp:454
size_t size() const
Definition: BasicBlock.h:470
void reinsertInstInDbgRecords(Instruction *I, std::optional< DbgRecord::self_iterator > Pos)
In rare circumstances instructions can be speculatively removed from blocks, and then be re-inserted ...
void moveBefore(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it into the function that MovePos lives ...
Definition: BasicBlock.h:377
bool isLandingPad() const
Return true if this basic block is a landing pad.
Definition: BasicBlock.cpp:677
InstListType::const_reverse_iterator const_reverse_iterator
Definition: BasicBlock.h:180
bool isEHPad() const
Return true if this basic block is an exception handling block.
Definition: BasicBlock.h:676
DbgMarker * getTrailingDbgRecords()
Fetch the collection of DbgRecords that "trail" after the last instruction of this block,...
CallInst * getTerminatingMustTailCall()
Definition: BasicBlock.h:272
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
Definition: BasicBlock.h:240
bool canSplitPredecessors() const
Definition: BasicBlock.cpp:545
const_iterator end() const
Definition: BasicBlock.h:463
const CallInst * getTerminatingMustTailCall() const
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this ba...
Definition: BasicBlock.cpp:300
friend BasicBlock::iterator Instruction::insertInto(BasicBlock *BB, BasicBlock::iterator It)
bool isLegalToHoistInto() const
Return true if it is legal to hoist instructions into this block.
Definition: BasicBlock.cpp:557
Instruction * getFirstNonPHIOrDbg(bool SkipPseudoOp=true)
Definition: BasicBlock.h:303
bool hasNPredecessorsOrMore(unsigned N) const
Return true if this block has N predecessors or more.
Definition: BasicBlock.cpp:485
bool isInstrOrderValid() const
Returns true if the Order field of child Instructions is valid.
Definition: BasicBlock.h:701
const CallInst * getPostdominatingDeoptimizeCall() const
Returns the call instruction calling @llvm.experimental.deoptimize that is present either in current ...
Definition: BasicBlock.cpp:346
DbgMarker * getNextMarker(Instruction *I)
Return the DbgMarker for the position that comes after I.
const Instruction * getFirstMayFaultInst() const
Returns the first potential AsynchEH faulty instruction currently it checks for loads/stores (which m...
Definition: BasicBlock.cpp:358
void splice(BasicBlock::iterator ToIt, BasicBlock *FromBB)
Transfer all instructions from FromBB to this basic block at ToIt.
Definition: BasicBlock.h:632
const_reverse_iterator rbegin() const
Definition: BasicBlock.h:466
LandingPadInst * getLandingPadInst()
Definition: BasicBlock.h:686
const Instruction & back() const
Definition: BasicBlock.h:474
const Module * getModule() const
Return the module owning the function this basic block belongs to, or nullptr if the function does no...
Definition: BasicBlock.cpp:292
iterator getFirstInsertionPt()
Definition: BasicBlock.h:325
void removePredecessor(BasicBlock *Pred, bool KeepOneInputPHIs=false)
Update PHI nodes in this BasicBlock before removal of predecessor Pred.
Definition: BasicBlock.cpp:516
The address of a basic block.
Definition: Constants.h:893
This class represents a function call, abstracting a target machine's calling convention.
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:63
Per-instruction record of debug-info.
Base class for non-instruction debug metadata records that have positions within IR.
void removeFromParent()
This method unlinks 'this' from the containing basic block, but does not delete it.
Definition: Instruction.cpp:80
iterator_range< simple_ilist< DbgRecord >::iterator > cloneDebugInfoFrom(const Instruction *From, std::optional< simple_ilist< DbgRecord >::iterator > FromHere=std::nullopt, bool InsertAtHead=false)
Clone any debug-info attached to From onto this instruction.
void insertBefore(Instruction *InsertPos)
Insert an unlinked instruction into a basic block immediately before the specified instruction.
Definition: Instruction.cpp:99
InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Definition: Instruction.cpp:94
void insertAfter(Instruction *InsertPos)
Insert an unlinked instruction into a basic block immediately after the specified instruction.
InstListType::iterator insertInto(BasicBlock *ParentBB, InstListType::iterator It)
Inserts an unlinked instruction into ParentBB at position It and returns the iterator of the inserted...
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
The landingpad instruction holds all of the information necessary to generate correct exception handl...
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
LLVM Value Representation.
Definition: Value.h:74
unsigned short getSubclassDataFromValue() const
Definition: Value.h:870
void setValueSubclassData(unsigned short D)
Definition: Value.h:871
Specialization of filter_iterator_base for forward iteration only.
Definition: STLExtras.h:498
self_iterator getIterator()
Definition: ilist_node.h:132
An ilist node that can access its parent list.
Definition: ilist_node.h:321
base_list_type::const_reverse_iterator const_reverse_iterator
Definition: ilist.h:125
base_list_type::reverse_iterator reverse_iterator
Definition: ilist.h:123
base_list_type::const_iterator const_iterator
Definition: ilist.h:122
base_list_type::iterator iterator
Definition: ilist.h:121
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:80
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
Definition: Types.h:82
This file defines classes to implement an intrusive doubly linked list class (i.e.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
BasicBlock::iterator skipDebugIntrinsics(BasicBlock::iterator It)
Advance It while it points to a debug instruction and return the result.
Definition: BasicBlock.cpp:698
#define N
static BasicBlock::iterator getEmptyKey()
Definition: BasicBlock.h:801
static unsigned getHashValue(const BasicBlock::iterator &It)
Definition: BasicBlock.h:811
static bool isEqual(const BasicBlock::iterator &LHS, const BasicBlock::iterator &RHS)
Definition: BasicBlock.h:817
static BasicBlock::iterator getTombstoneKey()
Definition: BasicBlock.h:805
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: DenseMapInfo.h:52
Option to add extra bits to the ilist_iterator.
Option to add a pointer to this list's owner in every node.