comparison clang/lib/CodeGen/CGCleanup.h @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
100 CleanupBitFields CleanupBits; 100 CleanupBitFields CleanupBits;
101 FilterBitFields FilterBits; 101 FilterBitFields FilterBits;
102 }; 102 };
103 103
104 public: 104 public:
105 enum Kind { Cleanup, Catch, Terminate, Filter, PadEnd }; 105 enum Kind { Cleanup, Catch, Terminate, Filter };
106 106
107 EHScope(Kind kind, EHScopeStack::stable_iterator enclosingEHScope) 107 EHScope(Kind kind, EHScopeStack::stable_iterator enclosingEHScope)
108 : CachedLandingPad(nullptr), CachedEHDispatchBlock(nullptr), 108 : CachedLandingPad(nullptr), CachedEHDispatchBlock(nullptr),
109 EnclosingEHScope(enclosingEHScope) { 109 EnclosingEHScope(enclosingEHScope) {
110 CommonBits.Kind = kind; 110 CommonBits.Kind = kind;
282 282
283 size_t getAllocatedSize() const { 283 size_t getAllocatedSize() const {
284 return sizeof(EHCleanupScope) + CleanupBits.CleanupSize; 284 return sizeof(EHCleanupScope) + CleanupBits.CleanupSize;
285 } 285 }
286 286
287 EHCleanupScope(bool isNormal, bool isEH, bool isActive, 287 EHCleanupScope(bool isNormal, bool isEH, unsigned cleanupSize,
288 unsigned cleanupSize, unsigned fixupDepth, 288 unsigned fixupDepth,
289 EHScopeStack::stable_iterator enclosingNormal, 289 EHScopeStack::stable_iterator enclosingNormal,
290 EHScopeStack::stable_iterator enclosingEH) 290 EHScopeStack::stable_iterator enclosingEH)
291 : EHScope(EHScope::Cleanup, enclosingEH), 291 : EHScope(EHScope::Cleanup, enclosingEH),
292 EnclosingNormal(enclosingNormal), NormalBlock(nullptr), 292 EnclosingNormal(enclosingNormal), NormalBlock(nullptr),
293 ActiveFlag(nullptr), ExtInfo(nullptr), FixupDepth(fixupDepth) { 293 ActiveFlag(nullptr), ExtInfo(nullptr), FixupDepth(fixupDepth) {
294 CleanupBits.IsNormalCleanup = isNormal; 294 CleanupBits.IsNormalCleanup = isNormal;
295 CleanupBits.IsEHCleanup = isEH; 295 CleanupBits.IsEHCleanup = isEH;
296 CleanupBits.IsActive = isActive; 296 CleanupBits.IsActive = true;
297 CleanupBits.IsLifetimeMarker = false; 297 CleanupBits.IsLifetimeMarker = false;
298 CleanupBits.TestFlagInNormalCleanup = false; 298 CleanupBits.TestFlagInNormalCleanup = false;
299 CleanupBits.TestFlagInEHCleanup = false; 299 CleanupBits.TestFlagInEHCleanup = false;
300 CleanupBits.CleanupSize = cleanupSize; 300 CleanupBits.CleanupSize = cleanupSize;
301 301
485 static bool classof(const EHScope *scope) { 485 static bool classof(const EHScope *scope) {
486 return scope->getKind() == Terminate; 486 return scope->getKind() == Terminate;
487 } 487 }
488 }; 488 };
489 489
490 class EHPadEndScope : public EHScope {
491 public:
492 EHPadEndScope(EHScopeStack::stable_iterator enclosingEHScope)
493 : EHScope(PadEnd, enclosingEHScope) {}
494 static size_t getSize() { return sizeof(EHPadEndScope); }
495
496 static bool classof(const EHScope *scope) {
497 return scope->getKind() == PadEnd;
498 }
499 };
500
501 /// A non-stable pointer into the scope stack. 490 /// A non-stable pointer into the scope stack.
502 class EHScopeStack::iterator { 491 class EHScopeStack::iterator {
503 char *Ptr; 492 char *Ptr;
504 493
505 friend class EHScopeStack; 494 friend class EHScopeStack;
532 Size = static_cast<const EHCleanupScope *>(get())->getAllocatedSize(); 521 Size = static_cast<const EHCleanupScope *>(get())->getAllocatedSize();
533 break; 522 break;
534 523
535 case EHScope::Terminate: 524 case EHScope::Terminate:
536 Size = EHTerminateScope::getSize(); 525 Size = EHTerminateScope::getSize();
537 break;
538
539 case EHScope::PadEnd:
540 Size = EHPadEndScope::getSize();
541 break; 526 break;
542 } 527 }
543 Ptr += llvm::alignTo(Size, ScopeStackAlignment); 528 Ptr += llvm::alignTo(Size, ScopeStackAlignment);
544 return *this; 529 return *this;
545 } 530 }
625 static const EHPersonality GNU_CPlusPlus_SEH; 610 static const EHPersonality GNU_CPlusPlus_SEH;
626 static const EHPersonality MSVC_except_handler; 611 static const EHPersonality MSVC_except_handler;
627 static const EHPersonality MSVC_C_specific_handler; 612 static const EHPersonality MSVC_C_specific_handler;
628 static const EHPersonality MSVC_CxxFrameHandler3; 613 static const EHPersonality MSVC_CxxFrameHandler3;
629 static const EHPersonality GNU_Wasm_CPlusPlus; 614 static const EHPersonality GNU_Wasm_CPlusPlus;
615 static const EHPersonality XL_CPlusPlus;
630 616
631 /// Does this personality use landingpads or the family of pad instructions 617 /// Does this personality use landingpads or the family of pad instructions
632 /// designed to form funclets? 618 /// designed to form funclets?
633 bool usesFuncletPads() const { 619 bool usesFuncletPads() const {
634 return isMSVCPersonality() || isWasmPersonality(); 620 return isMSVCPersonality() || isWasmPersonality();