Skip to content

Commit c3ce78d

Browse files
authored
Merge pull request #8819 from bnbarham/cherry-rebranch-to-next
[rebranch] Push `stable/20240408` changes to `next`
2 parents db58507 + ac0c2a4 commit c3ce78d

33 files changed

+214
-106
lines changed

clang/include/clang/AST/StmtIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ struct StmtIterator : public StmtIteratorImpl<StmtIterator, Stmt*&> {
133133
StmtIterator(const VariableArrayType *t)
134134
: StmtIteratorImpl<StmtIterator, Stmt*&>(t) {}
135135

136-
private:
137136
StmtIterator(const StmtIteratorBase &RHS)
138137
: StmtIteratorImpl<StmtIterator, Stmt *&>(RHS) {}
139138

139+
private:
140140
inline friend StmtIterator
141141
cast_away_const(const ConstStmtIterator &RHS);
142142
};

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ def all__load : Flag<["-"], "all_load">;
10831083
def allowable__client : Separate<["-"], "allowable_client">;
10841084
def ansi : Flag<["-", "--"], "ansi">, Group<CompileOnly_Group>;
10851085
def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">;
1086-
def arch : Separate<["-"], "arch">, Flags<[NoXarchOption,TargetSpecific]>;
1086+
def arch : Separate<["-"], "arch">, Flags<[NoXarchOption]>;
10871087
def arch__only : Separate<["-"], "arch_only">;
10881088
def autocomplete : Joined<["--"], "autocomplete=">;
10891089
def bind__at__load : Flag<["-"], "bind_at_load">;

clang/test/Driver/arc-exceptions.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang -### -x objective-c --target=x86_64-apple-macos10.6 -fobjc-arc -fsyntax-only %s 2> %t.log
1+
// RUN: %clang -### -x objective-c -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log
22
// RUN: grep objective-c %t.log
33
// RUN: not grep "fobjc-arc-exceptions" %t.log
4-
// RUN: %clang -### -x objective-c++ --target=x86_64-apple-macos10.6 -fobjc-arc -fsyntax-only %s 2> %t.log
4+
// RUN: %clang -### -x objective-c++ -arch x86_64 -fobjc-arc -fsyntax-only %s 2> %t.log
55
// RUN: grep "fobjc-arc-exceptions" %t.log

clang/test/Driver/arm-arch-darwin.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// On Darwin, arch should override CPU for triple purposes
22
// RUN: %clang -target armv7m-apple-darwin -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7M-DARWIN %s
33
// CHECK-V7M-DARWIN: "-cc1"{{.*}} "-triple" "thumbv7m-{{.*}} "-target-cpu" "cortex-m4"
4+
// RUN: %clang -target armv7m -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-V7M-OVERRIDDEN %s
5+
// CHECK-V7M-OVERRIDDEN: "-cc1"{{.*}} "-triple" "thumbv7em-{{.*}} "-target-cpu" "cortex-m4"
46

5-
/// -arch is unsupported for non-Darwin targets.
6-
// RUN: not %clang --target=armv7m -arch armv7m -mcpu=cortex-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ERR %s
7-
// ERR: unsupported option '-arch' for target 'armv7m'
8-
9-
// RUN: not %clang --target=aarch64-linux-gnu -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ERR2 %s
10-
// ERR2: unsupported option '-arch' for target 'aarch64-linux-gnu'

clang/test/Frontend/darwin-eabi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %clang --target=armv6m-apple-darwin -dM -E %s | FileCheck %s
2-
// RUN: %clang --target=armv7m-apple-darwin -dM -E %s | FileCheck %s
3-
// RUN: %clang --target=armv7em-apple-darwin -dM -E %s | FileCheck %s
1+
// RUN: %clang -arch armv6m -dM -E %s | FileCheck %s
2+
// RUN: %clang -arch armv7m -dM -E %s | FileCheck %s
3+
// RUN: %clang -arch armv7em -dM -E %s | FileCheck %s
44
// RUN: %clang_cc1 -triple thumbv7m-apple-unknown-macho -dM -E %s | FileCheck %s
55

66
// CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__

lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "lldb/Core/Debugger.h"
1919
#include "lldb/Core/Module.h"
2020
#include "lldb/Core/PluginManager.h"
21-
#include "lldb/Core/StreamFile.h"
2221
#include "lldb/Core/ValueObject.h"
2322
#include "lldb/DataFormatters/TypeSummary.h"
2423
#include "lldb/DataFormatters/ValueObjectPrinter.h"
2524
#include "lldb/Host/HostInfo.h"
25+
#include "lldb/Host/StreamFile.h"
2626
#include "lldb/Interpreter/CommandInterpreter.h"
2727
#include "lldb/Interpreter/CommandReturnObject.h"
2828
#include "lldb/Symbol/ObjectFile.h"

lldb/source/Plugins/LanguageRuntime/Swift/SwiftMetadataCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ SwiftMetadataCache::generateHashTableBlob(
177177
}
178178

179179
// Make sure that no bucket is at offset 0.
180-
llvm::support::endian::write<uint32_t>(blobStream, 0, llvm::support::little);
180+
llvm::support::endian::write<uint32_t>(blobStream, 0, llvm::endianness::little);
181181
uint32_t table_control_offset = table_generator.Emit(blobStream, m_info);
182182
return {{std::move(table_control_offset), std::move(hash_table_blob)}};
183183
}

lldb/source/Plugins/LanguageRuntime/Swift/SwiftMetadataCache.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TypeRefInfo {
6767
offset_type key_len = key.size();
6868
// Write the key length so we don't have to traverse it later.
6969
llvm::support::endian::write<offset_type>(out, key_len,
70-
llvm::support::little);
70+
llvm::endianness::little);
7171
// Since the data type is always a constant size there's no need to write
7272
// it.
7373
offset_type data_len = sizeof(data_type);
@@ -80,7 +80,7 @@ class TypeRefInfo {
8080

8181
void EmitData(llvm::raw_ostream &out, key_type_ref key, data_type_ref data,
8282
unsigned len) {
83-
llvm::support::endian::write<data_type>(out, data, llvm::support::little);
83+
llvm::support::endian::write<data_type>(out, data, llvm::endianness::little);
8484
}
8585

8686
// Decoder functions.
@@ -92,7 +92,7 @@ class TypeRefInfo {
9292
static std::pair<offset_type, offset_type>
9393
ReadKeyDataLength(const unsigned char *&data) {
9494
offset_type key_len =
95-
llvm::support::endian::readNext<offset_type, llvm::support::little,
95+
llvm::support::endian::readNext<offset_type, llvm::endianness::little,
9696
llvm::support::unaligned>(data);
9797
offset_type data_len = sizeof(data_type);
9898
return std::make_pair(key_len, data_len);
@@ -105,7 +105,7 @@ class TypeRefInfo {
105105
static data_type ReadData(internal_key_type key, const uint8_t *data,
106106
unsigned length) {
107107
data_type result =
108-
llvm::support::endian::readNext<uint32_t, llvm::support::little,
108+
llvm::support::endian::readNext<uint32_t, llvm::endianness::little,
109109
llvm::support::unaligned>(data);
110110
return result;
111111
}

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "UniqueDWARFASTType.h"
4242

4343
class DWARFASTParserClang;
44+
class DWARFASTParserSwift;
4445

4546
namespace llvm {
4647
class DWARFDebugAbbrev;

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
#include "lldb/Core/ModuleSpec.h"
9797
#include "lldb/Core/Progress.h"
9898
#include "lldb/Core/Section.h"
99-
#include "lldb/Core/StreamFile.h"
10099
#include "lldb/Expression/DiagnosticManager.h"
101100
#include "lldb/Expression/IRExecutionUnit.h"
102101
#include "lldb/Host/Host.h"
103102
#include "lldb/Host/HostInfo.h"
103+
#include "lldb/Host/StreamFile.h"
104104
#include "lldb/Host/XML.h"
105105
#include "lldb/Symbol/CompileUnit.h"
106106
#include "lldb/Symbol/ObjectFile.h"
@@ -1597,7 +1597,7 @@ void SwiftASTContext::AddExtraClangArgs(const std::vector<std::string> &source,
15971597
continue;
15981598
}
15991599
// Drop -Werror; it would only cause trouble in the debugger.
1600-
if (clang_argument.startswith("-Werror"))
1600+
if (clang_argument.starts_with("-Werror"))
16011601
continue;
16021602

16031603
// Drop `--`. This might be coming from the user-provided setting
@@ -5241,7 +5241,7 @@ swift::irgen::IRGenModule &SwiftASTContext::GetIRGenModule() {
52415241
const llvm::Target *llvm_target =
52425242
llvm::TargetRegistry::lookupTarget(llvm_triple.str(), error_str);
52435243

5244-
llvm::CodeGenOpt::Level optimization_level = llvm::CodeGenOpt::Level::None;
5244+
llvm::CodeGenOptLevel optimization_level = llvm::CodeGenOptLevel::None;
52455245

52465246
// Create a target machine.
52475247
llvm::TargetMachine *target_machine = llvm_target->createTargetMachine(
@@ -9226,7 +9226,7 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
92269226
}
92279227

92289228
std::string category = "Importing Swift module dependencies for ";
9229-
category += compile_unit->GetPrimaryFile().GetFilename();
9229+
category += compile_unit->GetPrimaryFile().GetFilename().GetString();
92309230
Progress progress(category, "", cu_imports.size());
92319231
size_t completion = 0;
92329232
for (const SourceModule &module : cu_imports) {

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,16 @@ namespace llvm {
7878
class LLVMContext;
7979
}
8080

81-
class DWARFASTParser;
8281
class SwiftEnumDescriptor;
8382

8483
namespace lldb_private {
8584

85+
namespace plugin {
86+
namespace dwarf {
87+
class DWARFASTParser;
88+
} // namespace dwarf
89+
} // namespace plugin
90+
8691
struct SourceModule;
8792
class SwiftASTContext;
8893
class ClangExternalASTSourceCallbacks;
@@ -552,7 +557,7 @@ class SwiftASTContext : public TypeSystemSwift {
552557

553558
bool IsFixedSize(CompilerType compiler_type);
554559

555-
DWARFASTParser *GetDWARFParser() override;
560+
plugin::dwarf::DWARFASTParser *GetDWARFParser() override;
556561

557562
// CompilerDecl functions
558563
ConstString DeclGetName(void *opaque_decl) override {

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ void TypeSystemSwift::Terminate() {
7171

7272
/// \}
7373

74-
void TypeSystemSwift::DumpValue(
75-
lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream &s,
76-
lldb::Format format, const DataExtractor &data, lldb::offset_t data_offset,
77-
size_t data_byte_size, uint32_t bitfield_bit_size,
78-
uint32_t bitfield_bit_offset, bool show_types, bool show_summary,
79-
bool verbose, uint32_t depth) {}
80-
8174
void TypeSystemSwift::Dump(llvm::raw_ostream &output) {
8275
// TODO: What to dump?
8376
}

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,6 @@ class TypeSystemSwift : public TypeSystem {
187187
/// For example, int is converted to Int32.
188188
virtual CompilerType ConvertClangTypeToSwiftType(CompilerType clang_type) = 0;
189189

190-
void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
191-
Stream &s, lldb::Format format, const DataExtractor &data,
192-
lldb::offset_t data_offset, size_t data_byte_size,
193-
uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
194-
bool show_types, bool show_summary, bool verbose,
195-
uint32_t depth) override;
196-
197190
/// \see lldb_private::TypeSystem::Dump
198191
void Dump(llvm::raw_ostream &output) override;
199192

@@ -231,10 +224,6 @@ class TypeSystemSwift : public TypeSystem {
231224
return {};
232225
}
233226
bool IsScalarType(lldb::opaque_compiler_type_t type) override;
234-
bool IsCStringType(lldb::opaque_compiler_type_t type,
235-
uint32_t &length) override {
236-
return false;
237-
}
238227
bool IsVectorType(lldb::opaque_compiler_type_t type,
239228
CompilerType *element_type, uint64_t *size) override {
240229
return false;
@@ -323,12 +312,6 @@ class TypeSystemSwift : public TypeSystem {
323312
CompilerType GetNonReferenceType(lldb::opaque_compiler_type_t type) override {
324313
return {};
325314
}
326-
327-
// TODO: This method appear unused. Should they be removed?
328-
void DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
329-
Stream &s, const DataExtractor &data,
330-
lldb::offset_t data_offset, size_t data_byte_size) override {
331-
}
332315
/// \}
333316
protected:
334317
/// Used in the logs.

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2525
#include "lldb/Core/Debugger.h"
2626
#include "lldb/Core/DumpDataExtractor.h"
27-
#include "lldb/Core/StreamFile.h"
27+
#include "lldb/Host/StreamFile.h"
2828
#include "lldb/Symbol/CompileUnit.h"
2929
#include "lldb/Symbol/TypeList.h"
3030
#include "lldb/Symbol/TypeMap.h"
@@ -1980,8 +1980,6 @@ void TypeSystemSwiftTypeRef::SetTriple(const llvm::Triple triple) {
19801980
// This function appears to be only called via Module::SetArchitecture(ArchSpec).
19811981
if (auto *swift_ast_context = GetSwiftASTContextOrNull(nullptr))
19821982
swift_ast_context->SetTriple(triple);
1983-
else
1984-
m_swift_ast_context_triple = triple;
19851983
}
19861984

19871985
void TypeSystemSwiftTypeRef::ClearModuleDependentCaches() {

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class TypeSystemSwiftTypeRef : public TypeSystemSwift {
109109
Status IsCompatible() override;
110110

111111
void DiagnoseWarnings(Process &process, Module &module) const override;
112-
DWARFASTParser *GetDWARFParser() override;
112+
plugin::dwarf::DWARFASTParser *GetDWARFParser() override;
113113
// CompilerDecl functions
114114
ConstString DeclGetName(void *opaque_decl) override {
115115
return ConstString("");
@@ -496,7 +496,7 @@ class TypeSystemSwiftTypeRef : public TypeSystemSwift {
496496
mutable std::unique_ptr<SwiftDWARFImporterForClangTypes>
497497
m_dwarf_importer_for_clang_types_up;
498498
mutable std::unique_ptr<ClangNameImporter> m_name_importer_up;
499-
std::unique_ptr<DWARFASTParser> m_dwarf_ast_parser_up;
499+
std::unique_ptr<plugin::dwarf::DWARFASTParser> m_dwarf_ast_parser_up;
500500

501501
/// The APINotesManager responsible for each Clang module.
502502
llvm::DenseMap<clang::Module *,

lldb/source/Symbol/Symtab.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ static bool lldb_skip_name(llvm::StringRef mangled,
275275
case Mangled::eManglingSchemeSwift:
276276
return false;
277277

278-
#ifdef LLDB_ENABLE_SWIFT
279-
case Mangled::eManglingSchemeSwift:
280-
// This is handled separately.
281-
#endif // LLDB_ENABLE_SWIFT
282278
// Don't try and demangle things we can't categorize.
283279
case Mangled::eManglingSchemeNone:
284280
return true;

llvm/include/llvm/CodeGen/MachineFunction.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,10 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
12001200
/// Find or create an LandingPadInfo for the specified MachineBasicBlock.
12011201
LandingPadInfo &getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad);
12021202

1203+
/// Remap landing pad labels and remove any deleted landing pads.
1204+
void tidyLandingPads(DenseMap<MCSymbol *, uintptr_t> *LPMap = nullptr,
1205+
bool TidyIfNoBeginLabels = true);
1206+
12031207
/// Return a reference to the landing pad info for the current function.
12041208
const std::vector<LandingPadInfo> &getLandingPads() const {
12051209
return LandingPads;
@@ -1215,11 +1219,22 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
12151219
/// entry.
12161220
MCSymbol *addLandingPad(MachineBasicBlock *LandingPad);
12171221

1222+
/// Provide the catch typeinfo for a landing pad.
1223+
void addCatchTypeInfo(MachineBasicBlock *LandingPad,
1224+
ArrayRef<const GlobalValue *> TyInfo);
1225+
1226+
/// Provide the filter typeinfo for a landing pad.
1227+
void addFilterTypeInfo(MachineBasicBlock *LandingPad,
1228+
ArrayRef<const GlobalValue *> TyInfo);
1229+
1230+
/// Add a cleanup action for a landing pad.
1231+
void addCleanup(MachineBasicBlock *LandingPad);
1232+
12181233
/// Return the type id for the specified typeinfo. This is function wide.
12191234
unsigned getTypeIDFor(const GlobalValue *TI);
12201235

12211236
/// Return the id of the filter encoded by TyIds. This is function wide.
1222-
int getFilterIDFor(ArrayRef<unsigned> TyIds);
1237+
int getFilterIDFor(std::vector<unsigned> &TyIds);
12231238

12241239
/// Map the landing pad's EH symbol to the call site indexes.
12251240
void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef<unsigned> Sites);

llvm/include/llvm/Support/GenericLoopInfoImpl.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ BlockT *LoopBase<BlockT, LoopT>::getLoopPreheader() const {
208208
return nullptr;
209209

210210
// Make sure there is only one exit out of the preheader.
211-
if (llvm::size(llvm::children<BlockT *>(Out)) != 1)
211+
typedef GraphTraits<BlockT *> BlockTraits;
212+
typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(Out);
213+
++SI;
214+
if (SI != BlockTraits::child_end(Out))
212215
return nullptr; // Multiple exits from the block, must not be a preheader.
213216

214217
// The predecessor has exactly one successor, so it is a preheader.

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ class Triple {
194194
Mesa,
195195
SUSE,
196196
OpenEmbedded,
197-
LastVendorType = OpenEmbedded
197+
Swift,
198+
LastVendorType = Swift
198199
};
199200
enum OSType {
200201
UnknownOS,

llvm/lib/CodeGen/AsmPrinter/AIXException.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121

2222
namespace llvm {
2323

24-
AIXException::AIXException(AsmPrinter *A) : EHStreamer(A) {}
24+
AIXException::AIXException(AsmPrinter *A) : DwarfCFIExceptionBase(A) {}
25+
26+
// This overrides 'DwarfCFIExceptionBase::markFunctionEnd', to avoid the call to
27+
// tidyLandingPads. This is necessary, because the
28+
// 'PPCAIXAsmPrinter::emitFunctionBodyEnd' function already checked whether we
29+
// need ehinfo, and emitted a traceback table with the bits set to indicate that
30+
// we will be emitting it, if so. Thus, if we remove it now -- so late in the
31+
// process -- we'll end up having emitted a reference to __ehinfo.N symbol, but
32+
// not emitting a definition for said symbol.
33+
void AIXException::markFunctionEnd() {}
2534

2635
void AIXException::emitExceptionInfoTable(const MCSymbol *LSDA,
2736
const MCSymbol *PerSym) {

llvm/lib/CodeGen/AsmPrinter/ARMException.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "llvm/MC/MCStreamer.h"
2020
using namespace llvm;
2121

22-
ARMException::ARMException(AsmPrinter *A) : EHStreamer(A) {}
22+
ARMException::ARMException(AsmPrinter *A) : DwarfCFIExceptionBase(A) {}
2323

2424
ARMException::~ARMException() = default;
2525

@@ -51,6 +51,7 @@ void ARMException::beginFunction(const MachineFunction *MF) {
5151
void ARMException::markFunctionEnd() {
5252
if (shouldEmitCFI)
5353
Asm->OutStreamer->emitCFIEndProc();
54+
DwarfCFIExceptionBase::markFunctionEnd();
5455
}
5556

5657
/// endFunction - Gather and emit post-function exception information.

llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@
2323
#include "llvm/Target/TargetOptions.h"
2424
using namespace llvm;
2525

26-
DwarfCFIException::DwarfCFIException(AsmPrinter *A) : EHStreamer(A) {}
26+
DwarfCFIExceptionBase::DwarfCFIExceptionBase(AsmPrinter *A) : EHStreamer(A) {}
27+
28+
void DwarfCFIExceptionBase::markFunctionEnd() {
29+
// Map all labels and get rid of any dead landing pads.
30+
if (!Asm->MF->getLandingPads().empty()) {
31+
MachineFunction *NonConstMF = const_cast<MachineFunction*>(Asm->MF);
32+
NonConstMF->tidyLandingPads();
33+
}
34+
}
35+
36+
DwarfCFIException::DwarfCFIException(AsmPrinter *A)
37+
: DwarfCFIExceptionBase(A) {}
2738

2839
DwarfCFIException::~DwarfCFIException() = default;
2940

0 commit comments

Comments
 (0)