Skip to content

Manually merge apple/stable/20200714 -> swift/main #1878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9ddb091
Add a setting to force stepping to always run all threads.
jimingham Aug 7, 2020
815b4c0
Add python enumerators for SBTypeEnumMemberList, and some tests for t…
jimingham Aug 14, 2020
823f635
Fix reporting the lack of global variables in "target var".
jimingham Sep 22, 2020
e6f2378
Add `breakpoint delete --disabled`: deletes all disabled breakpoints.
jimingham Sep 23, 2020
3887971
Add an option (-y) to "break set" and "source list" that uses the same
jimingham Jul 16, 2020
271da2a
Add a verifier check that rejects non-distinct DISubprogram function
adrian-prantl Sep 24, 2020
9b4eb32
[profile] Add %t LLVM_PROFILE_FILE option to substitute $TMPDIR
vedantk Sep 8, 2020
fdfe990
Fix Assembler/disubprogram.ll after e17f52d623cc146b7d9bf5a2e02965043…
MaskRay Sep 25, 2020
be39e9d
Revert "Add a verifier check that rejects non-distinct DISubprogram f…
adrian-prantl Sep 25, 2020
52f9998
Add a verifier check that rejects non-distinct DISubprogram function
adrian-prantl Sep 24, 2020
fe24e36
Merge pull request #1855 from apple/eng/PR-68524185
vedantk Sep 25, 2020
ecf89c5
[LLDB] Add a defensive check for member__f_
shafik Sep 24, 2020
8a75d2b
[clang][module] Improve incomplete-umbrella warning
zixu-w Jun 16, 2020
09ce641
Merge pull request #1859 from shafik/69403150_findlibcppstdfunctionca…
shafik Sep 25, 2020
45448a1
Merge pull request #1860 from apple/eng/incomplete-umbrella-improve
zixu-w Sep 25, 2020
48e913c
Merge pull request #1842 from jimingham/run-all-threads
jimingham Sep 26, 2020
a90793e
Merge pull request #1848 from jimingham/file-and-line-option
jimingham Sep 26, 2020
c410cd3
Merge pull request #1844 from jimingham/no-vars-not-no-debug-info
jimingham Sep 26, 2020
d9e4405
Merge pull request #1843 from jimingham/type-enum-iterators
jimingham Sep 26, 2020
8fd613e
Add support for firmware/standalone LC_NOTE "main bin spec" corefiles…
jasonmolenda Sep 27, 2020
594fe43
Merge commit '184a13d362e0' from llvm.org/release/11.x into apple/sta…
Sep 28, 2020
184a13d
AArch64/GlobalISel: Narrow stack passed argument access size
arsenm Sep 25, 2020
7f7e684
Merge commit '1e4b179bf821' from llvm.org/release/11.x into apple/sta…
Sep 28, 2020
1e4b179
[CodeGen] Do not call `emitGlobalConstantLargeInt` for constant requi…
atanasyan Sep 24, 2020
af4f088
Merge commit '9e367bd69b0d' from llvm.org/release/11.x into apple/sta…
Sep 28, 2020
9e367bd
C API: functions to get mask of a ShuffleVector
cdisselkoen Sep 25, 2020
2a73942
Merge commit '293924973057' from llvm.org/release/11.x into apple/sta…
Sep 28, 2020
2939249
[LLVM-C] Turn a ShuffleVector Constant Into a Getter.
CodaFi Sep 26, 2020
3de614b
Merge commit 'eb83b551d3eb' from llvm.org/release/11.x into apple/sta…
Sep 28, 2020
eb83b55
Fix mysterious failure of SupportTests FileCheckTest.Binop
zmodem Sep 28, 2020
2875ec7
Fix DISubprogram-v4.ll after e17f52d623cc146b7d9bf5a2e02965043508b4c4
MaskRay Sep 25, 2020
815c690
[ubsan] nullability-arg: Fix crash on C++ member pointers
vedantk Sep 25, 2020
6ffed6e
Merge pull request #1866 from apple/eng/PR-62476022
vedantk Sep 28, 2020
69984e8
Merge pull request #1849 from adrian-prantl/69534688
adrian-prantl Sep 28, 2020
e40e736
Merge pull request #1845 from jimingham/delete-disabled
jimingham Sep 28, 2020
afada41
Add missing NodeType enums
texasmichelle Sep 25, 2020
8994b1f
Once we've found a firmware binary and loaded it, don't search more (…
jasonmolenda Sep 28, 2020
861da5b
[clang] Selectively ena/disa-ble format-insufficient-args warning
jkorous-apple Sep 16, 2020
b3b219d
[clang] Update warning-wall.c test
jkorous-apple Sep 29, 2020
dda0a18
[LLVM 11] Add SystemZ changes to release notes
uweigand Sep 29, 2020
1222940
Merge commit 'dda0a1867cc0' from llvm.org/release/11.x into apple/sta…
Sep 29, 2020
c8e3b61
Merge pull request #1873 from texasmichelle/cherry-pick-nodetype
compnerd Sep 29, 2020
1794e47
Merge pull request #1876 from jkorous-apple/format-insufficient-args
jkorous-apple Sep 29, 2020
9fa69d8
Merge branch 'apple/stable/20200714' into swift/master
beccadax Sep 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/docs/SourceBasedCodeCoverage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ directory structure will be created. Additionally, the following special

* "%h" expands out to the hostname of the machine running the program.

* "%t" expands out to the value of the ``TMPDIR`` environment variable. On
Darwin, this is typically set to a temporary scratch directory.

* "%Nm" expands out to the instrumented binary's signature. When this pattern
is specified, the runtime creates a pool of N raw profiles which are used for
on-line profile merging. The runtime takes care of selecting a raw profile
Expand Down
4 changes: 3 additions & 1 deletion clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi,
def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
def FormatInsufficientArgs : DiagGroup<"format-insufficient-args">;
def FormatExtraArgs : DiagGroup<"format-extra-args">;
def FormatZeroLength : DiagGroup<"format-zero-length">;

Expand Down Expand Up @@ -840,7 +841,8 @@ def FormatPedantic : DiagGroup<"format-pedantic">;
def FormatTypeConfusion : DiagGroup<"format-type-confusion">;
def Format : DiagGroup<"format",
[FormatExtraArgs, FormatZeroLength, NonNull,
FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
FormatSecurity, FormatY2K, FormatInvalidSpecifier,
FormatInsufficientArgs]>,
DiagCategory<"Format String Issue">;
def FormatNonLiteral : DiagGroup<"format-nonliteral">;
def Format2 : DiagGroup<"format=2",
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -8945,7 +8945,7 @@ def note_array_declared_here : Note<
"array %0 declared here">;

def warn_printf_insufficient_data_args : Warning<
"more '%%' conversions than data arguments">, InGroup<Format>;
"more '%%' conversions than data arguments">, InGroup<FormatInsufficientArgs>;
def warn_printf_data_arg_not_used : Warning<
"data argument not used by format string">, InGroup<FormatExtraArgs>;
def warn_format_invalid_conversion : Warning<
Expand Down
5 changes: 1 addition & 4 deletions clang/lib/CodeGen/CGCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3746,10 +3746,7 @@ void CodeGenFunction::EmitNonNullArgCheck(RValue RV, QualType ArgType,
}

SanitizerScope SanScope(this);
assert(RV.isScalar());
llvm::Value *V = RV.getScalarVal();
llvm::Value *Cond =
Builder.CreateICmpNE(V, llvm::Constant::getNullValue(V->getType()));
llvm::Value *Cond = EmitNonNullRValueCheck(RV, ArgType);
llvm::Constant *StaticData[] = {
EmitCheckSourceLocation(ArgLoc), EmitCheckSourceLocation(AttrLoc),
llvm::ConstantInt::get(Int32Ty, ArgNo + 1),
Expand Down
7 changes: 7 additions & 0 deletions clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,13 @@ Address CodeGenFunction::EmitPointerWithAlignment(const Expr *E,
return Address(EmitScalarExpr(E), Align);
}

llvm::Value *CodeGenFunction::EmitNonNullRValueCheck(RValue RV, QualType T) {
llvm::Value *V = RV.getScalarVal();
if (auto MPT = T->getAs<MemberPointerType>())
return CGM.getCXXABI().EmitMemberPointerIsNotNull(*this, V, MPT);
return Builder.CreateICmpNE(V, llvm::Constant::getNullValue(V->getType()));
}

RValue CodeGenFunction::GetUndefRValue(QualType Ty) {
if (Ty->isVoidType())
return RValue::get(nullptr);
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/CodeGen/CodeGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,9 @@ class CodeGenFunction : public CodeGenTypeCache {
// LValue Expression Emission
//===--------------------------------------------------------------------===//

/// Create a check that a scalar RValue is non-null.
llvm::Value *EmitNonNullRValueCheck(RValue RV, QualType T);

/// GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.
RValue GetUndefRValue(QualType Ty);

Expand Down
12 changes: 7 additions & 5 deletions clang/lib/Lex/PPLexerChange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,12 @@ static void collectAllSubModulesWithUmbrellaHeader(
}

void Preprocessor::diagnoseMissingHeaderInUmbrellaDir(const Module &Mod) {
assert(Mod.getUmbrellaHeader() && "Module must use umbrella header");
SourceLocation StartLoc =
SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID());
if (getDiagnostics().isIgnored(diag::warn_uncovered_module_header, StartLoc))
const Module::Header &UmbrellaHeader = Mod.getUmbrellaHeader();
assert(UmbrellaHeader.Entry && "Module must use umbrella header");
const FileID &File = SourceMgr.translateFile(UmbrellaHeader.Entry);
SourceLocation ExpectedHeadersLoc = SourceMgr.getLocForEndOfFile(File);
if (getDiagnostics().isIgnored(diag::warn_uncovered_module_header,
ExpectedHeadersLoc))
return;

ModuleMap &ModMap = getHeaderSearchInfo().getModuleMap();
Expand All @@ -291,7 +293,7 @@ void Preprocessor::diagnoseMissingHeaderInUmbrellaDir(const Module &Mod) {
// Find the relative path that would access this header.
SmallString<128> RelativePath;
computeRelativePath(FileMgr, Dir, *Header, RelativePath);
Diag(StartLoc, diag::warn_uncovered_module_header)
Diag(ExpectedHeadersLoc, diag::warn_uncovered_module_header)
<< Mod.getFullModuleName() << RelativePath;
}
}
Expand Down
51 changes: 51 additions & 0 deletions clang/test/CodeGenCXX/ubsan-nullability-arg.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// RUN: %clang_cc1 -x c++ -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fsanitize=nullability-arg | FileCheck %s -check-prefixes=ITANIUM,ALL
// RUN: %clang_cc1 -x c++ -triple x86_64-pc-windows-msvc -emit-llvm -o - %s -fsanitize=nullability-arg | FileCheck %s -check-prefixes=MSVC,ALL

namespace method_ptr {

struct S0 {
void foo1();
};

void foo1(void (S0::*_Nonnull f)());

// ITANIUM-LABEL: @_ZN10method_ptr5test1Ev(){{.*}} {
// ITANIUM: br i1 icmp ne (i64 ptrtoint (void (%"struct.method_ptr::S0"*)* @_ZN10method_ptr2S04foo1Ev to i64), i64 0), label %[[CONT:.*]], label %[[FAIL:[^,]*]]
// ITANIUM-EMPTY:
// ITANIUM-NEXT: [[FAIL]]:
// ITANIUM-NEXT: call void @__ubsan_handle_nullability_arg

// MSVC-LABEL: @"?test1@method_ptr@@YAXXZ"(){{.*}} {
// MSVC: br i1 true, label %[[CONT:.*]], label %[[FAIL:[^,]*]]
// MSVC-EMPTY:
// MSVC-NEXT: [[FAIL]]:
// MSVC-NEXT: call void @__ubsan_handle_nullability_arg
void test1() {
foo1(&S0::foo1);
}

} // namespace method_ptr

namespace data_ptr {

struct S0 {
int field1;
};

using member_ptr = int S0::*;

void foo1(member_ptr _Nonnull);

// ITANIUM-LABEL: @_ZN8data_ptr5test1ENS_2S0E(
// MSVC-LABEL: @"?test1@data_ptr@@YAXUS0@1@@Z"(
// ALL: [[DATA_PTR_CHECK:%.*]] = icmp ne {{.*}}, -1, !nosanitize
// ALL-NEXT: br i1 [[DATA_PTR_CHECK]], label %[[CONT:.*]], label %[[FAIL:[^,]+]]
// ALL-EMPTY:
// ALL-NEXT: [[FAIL]]:
// ALL-NEXT: call void @__ubsan_handle_nullability_arg
void test1(S0 s) {
int S0::*member = &S0::field1;
foo1(member);
}

} // namespace data_ptr
1 change: 1 addition & 0 deletions clang/test/Misc/warning-wall.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CHECK-NEXT: -Wnonnull
CHECK-NEXT: -Wformat-security
CHECK-NEXT: -Wformat-y2k
CHECK-NEXT: -Wformat-invalid-specifier
CHECK-NEXT: -Wformat-insufficient-args
CHECK-NEXT: -Wfor-loop-analysis
CHECK-NEXT: -Wframe-address
CHECK-NEXT: -Wimplicit
Expand Down
8 changes: 6 additions & 2 deletions clang/test/Modules/incomplete-umbrella.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
#import <Foo/Baz.h>
@import Foo.Private;

// CHECK: warning: umbrella header for module 'Foo' does not include header 'Bar.h'
// CHECK: warning: umbrella header for module 'Foo.Private' does not include header 'Baz.h'
// CHECK: While building module 'Foo' imported from {{.*[/\]}}incomplete-umbrella.m:4:
// CHECK-NEXT: In file included from <module-includes>:1:
// CHECK-NEXT: {{.*Foo[.]framework[/\]Headers[/\]}}FooPublic.h:2:1: warning: umbrella header for module 'Foo' does not include header 'Bar.h'
// CHECK: While building module 'Foo' imported from {{.*[/\]}}incomplete-umbrella.m:4:
// CHECK-NEXT: In file included from <module-includes>:2:
// CHECK-NEXT: {{.*Foo[.]framework[/\]PrivateHeaders[/\]}}Foo.h:2:1: warning: umbrella header for module 'Foo.Private' does not include header 'Baz.h'
int foo() {
int a = BAR_PUBLIC;
int b = BAZ_PRIVATE;
Expand Down
11 changes: 11 additions & 0 deletions clang/test/Sema/warn-printf-insufficient-data-args.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// RUN: %clang_cc1 -fsyntax-only -verify=WARNING-ON %s
// RUN: %clang_cc1 -fsyntax-only -Wno-format-insufficient-args -verify=WARNING-OFF %s


int printf(const char * format, ...);

int main(void) {
int patatino = 42;
printf("%i %i", patatino); // WARNING-ON-warning {{more '%' conversions than data arguments}}
// WARNING-OFF-no-diagnostics
}
28 changes: 22 additions & 6 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typedef struct lprofFilename {
unsigned OwnsFilenamePat;
const char *ProfilePathPrefix;
char PidChars[MAX_PID_SIZE];
char *TmpDir;
char Hostname[COMPILER_RT_MAX_HOSTLEN];
unsigned NumPids;
unsigned NumHosts;
Expand All @@ -90,8 +91,8 @@ typedef struct lprofFilename {
ProfileNameSpecifier PNS;
} lprofFilename;

static lprofFilename lprofCurFilename = {0, 0, 0, {0}, {0}, 0,
0, 0, {0}, 0, PNS_unknown};
static lprofFilename lprofCurFilename = {0, 0, 0, {0}, NULL, {0},
0, 0, 0, {0}, 0, PNS_unknown};

static int ProfileMergeRequested = 0;
static int isProfileMergeRequested() { return ProfileMergeRequested; }
Expand Down Expand Up @@ -773,6 +774,14 @@ static int parseFilenamePattern(const char *FilenamePat,
FilenamePat);
return -1;
}
} else if (FilenamePat[I] == 't') {
lprofCurFilename.TmpDir = getenv("TMPDIR");
if (!lprofCurFilename.TmpDir) {
PROF_WARN("Unable to get the TMPDIR environment variable, referenced "
"in %s. Using the default path.",
FilenamePat);
return -1;
}
} else if (FilenamePat[I] == 'c') {
if (__llvm_profile_is_continuous_mode_enabled()) {
PROF_WARN("%%c specifier can only be specified once in %s.\n",
Expand Down Expand Up @@ -874,12 +883,14 @@ static int getCurFilenameLength() {
return 0;

if (!(lprofCurFilename.NumPids || lprofCurFilename.NumHosts ||
lprofCurFilename.MergePoolSize || lprofCurFilename.NumExitSignals))
lprofCurFilename.TmpDir || lprofCurFilename.MergePoolSize ||
lprofCurFilename.NumExitSignals))
return strlen(lprofCurFilename.FilenamePat);

Len = strlen(lprofCurFilename.FilenamePat) +
lprofCurFilename.NumPids * (strlen(lprofCurFilename.PidChars) - 2) +
lprofCurFilename.NumHosts * (strlen(lprofCurFilename.Hostname) - 2);
lprofCurFilename.NumHosts * (strlen(lprofCurFilename.Hostname) - 2) +
(lprofCurFilename.TmpDir ? (strlen(lprofCurFilename.TmpDir) - 1) : 0);
if (lprofCurFilename.MergePoolSize)
Len += SIGLEN;
for (I = 0; I < lprofCurFilename.NumExitSignals; ++I) {
Expand All @@ -896,14 +907,14 @@ static int getCurFilenameLength() {
* current filename pattern string is directly returned, unless ForceUseBuf
* is enabled. */
static const char *getCurFilename(char *FilenameBuf, int ForceUseBuf) {
int I, J, PidLength, HostNameLength, FilenamePatLength;
int I, J, PidLength, HostNameLength, TmpDirLength, FilenamePatLength;
const char *FilenamePat = lprofCurFilename.FilenamePat;

if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0])
return 0;

if (!(lprofCurFilename.NumPids || lprofCurFilename.NumHosts ||
lprofCurFilename.MergePoolSize ||
lprofCurFilename.TmpDir || lprofCurFilename.MergePoolSize ||
__llvm_profile_is_continuous_mode_enabled() ||
lprofCurFilename.NumExitSignals)) {
if (!ForceUseBuf)
Expand All @@ -917,6 +928,7 @@ static const char *getCurFilename(char *FilenameBuf, int ForceUseBuf) {

PidLength = strlen(lprofCurFilename.PidChars);
HostNameLength = strlen(lprofCurFilename.Hostname);
TmpDirLength = lprofCurFilename.TmpDir ? strlen(lprofCurFilename.TmpDir) : 0;
/* Construct the new filename. */
for (I = 0, J = 0; FilenamePat[I]; ++I)
if (FilenamePat[I] == '%') {
Expand All @@ -929,6 +941,10 @@ static const char *getCurFilename(char *FilenameBuf, int ForceUseBuf) {
} else if (containsExitOnSignalSpecifier(FilenamePat, I)) {
while (FilenamePat[I] != 'x')
++I;
} else if (FilenamePat[I] == 't') {
memcpy(FilenameBuf + J, lprofCurFilename.TmpDir, TmpDirLength);
FilenameBuf[J + TmpDirLength] = DIR_SEPARATOR;
J += TmpDirLength + 1;
} else {
if (!getMergePoolSize(FilenamePat, &I))
continue;
Expand Down
22 changes: 22 additions & 0 deletions compiler-rt/test/profile/instrprof-tmpdir.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: cd %t
// RUN: %clang_profgen -o %t/binary %s
//
// Check that a dir separator is appended after %t is subsituted.
// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run ./binary
// RUN: llvm-profdata show ./raw1.profraw | FileCheck %s -check-prefix TMPDIR
//
// Check that substitution works even if a redundant dir separator is added.
// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%t/raw2.profraw" %run ./binary
// RUN: llvm-profdata show ./raw2.profraw | FileCheck %s -check-prefix TMPDIR
//
// Check that we fall back to the default path if TMPDIR is missing.
// RUN: env -u TMPDIR LLVM_PROFILE_FILE="%%t/raw3.profraw" %run ./binary 2>&1 | FileCheck %s -check-prefix MISSING
// RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR

// TMPDIR: Maximum function count: 1

// MISSING: Unable to get the TMPDIR environment variable, referenced in {{.*}}raw3.profraw. Using the default path.

int main() { return 0; }
8 changes: 8 additions & 0 deletions lldb/bindings/interface/SBThreadPlan.i
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ public:
bool
IsPlanStale();

%feature("docstring", "Return whether this plan will ask to stop other threads when it runs.") GetStopOthers;
bool
GetStopOthers();

%feature("docstring", "Set whether this plan will ask to stop other threads when it runs.") GetStopOthers;
void
SetStopOthers(bool stop_others);

SBThreadPlan
QueueThreadPlanForStepOverRange (SBAddress &start_address,
lldb::addr_t range_size);
Expand Down
39 changes: 35 additions & 4 deletions lldb/bindings/interface/SBTypeEnumMember.i
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,18 @@ protected:
SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);
};

%feature(
"docstring",
"Represents a list of SBTypeEnumMembers."
) SBTypeEnumMemberList;
%feature("docstring",
"Represents a list of SBTypeEnumMembers.
SBTypeEnumMemberList supports SBTypeEnumMember iteration.
It also supports [] access either by index, or by enum
element name by doing:

myType = target.FindFirstType('MyEnumWithElementA')
members = myType.GetEnumMembers()
first_elem = members[0]
elem_A = members['A']

") SBTypeEnumMemberList;

class SBTypeEnumMemberList
{
Expand All @@ -99,6 +107,29 @@ public:
uint32_t
GetSize();

#ifdef SWIGPYTHON
%pythoncode %{
def __iter__(self):
'''Iterate over all members in a lldb.SBTypeEnumMemberList object.'''
return lldb_iter(self, 'GetSize', 'GetTypeEnumMemberAtIndex')

def __len__(self):
'''Return the number of members in a lldb.SBTypeEnumMemberList object.'''
return self.GetSize()

def __getitem__(self, key):
num_elements = self.GetSize()
if type(key) is int:
if key < num_elements:
return self.GetTypeEnumMemberAtIndex(key)
elif type(key) is str:
for idx in range(num_elements):
item = self.GetTypeEnumMemberAtIndex(idx)
if item.name == key:
return item
return None
%}
#endif

private:
std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;
Expand Down
4 changes: 4 additions & 0 deletions lldb/include/lldb/API/SBThreadPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class LLDB_API SBThreadPlan {

bool IsValid();

bool GetStopOthers();

void SetStopOthers(bool stop_others);

// This section allows an SBThreadPlan to push another of the common types of
// plans...
SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
Expand Down
3 changes: 3 additions & 0 deletions lldb/include/lldb/Interpreter/OptionValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class OptionValue {
eTypeChar,
eTypeDictionary,
eTypeEnum,
eTypeFileLineColumn,
eTypeFileSpec,
eTypeFileSpecList,
eTypeFormat,
Expand Down Expand Up @@ -135,6 +136,8 @@ class OptionValue {
return eTypeDictionary;
case 1u << eTypeEnum:
return eTypeEnum;
case 1u << eTypeFileLineColumn:
return eTypeFileLineColumn;
case 1u << eTypeFileSpec:
return eTypeFileSpec;
case 1u << eTypeFileSpecList:
Expand Down
Loading