Skip to content

Commit 60cc425

Browse files
authored
merge main into amd-staging (llvm#1409)
2 parents f55cbc5 + 7a64acb commit 60cc425

File tree

62 files changed

+719
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+719
-216
lines changed

bolt/include/bolt/Passes/DominatorAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DominatorAnalysis
5454
HasNonDominatedPred = true;
5555
});
5656
if (HasDominatedPred && HasNonDominatedPred)
57-
Result.insert(Candidates.begin(), Candidates.end());
57+
Result.insert_range(Candidates);
5858
if ((*this->getStateAt(ProgramPoint::getLastPointAt(BB)))[DomIdx] &&
5959
BB.succ_begin() == BB.succ_end())
6060
Result.insert(ProgramPoint::getLastPointAt(BB));

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ void BinaryFunction::postProcessJumpTables() {
19971997
bool BinaryFunction::validateExternallyReferencedOffsets() {
19981998
SmallPtrSet<MCSymbol *, 4> JTTargets;
19991999
for (const JumpTable *JT : llvm::make_second_range(JumpTables))
2000-
JTTargets.insert(JT->Entries.begin(), JT->Entries.end());
2000+
JTTargets.insert_range(JT->Entries);
20012001

20022002
bool HasUnclaimedReference = false;
20032003
for (uint64_t Destination : ExternallyReferencedOffsets) {

clang/docs/analyzer/checkers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ pure virtual – but may be still surprising for the programmer.)
610610
void releaseResources() {
611611
// warn: This can call the pure virtual method A::getKind() when this is
612612
// called from the destructor.
613-
callSomeFunction(getKind())
613+
callSomeFunction(getKind());
614614
}
615615
};
616616
@@ -936,7 +936,7 @@ checker does not report them**.
936936
void releaseResources() {
937937
// warn: This can be called within ~A() and calls A::getKind() even if
938938
// we are destructing a class that is derived from A.
939-
callSomeFunction(getKind())
939+
callSomeFunction(getKind());
940940
}
941941
};
942942

clang/include/clang/Basic/TargetInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,8 +1175,7 @@ class TargetInfo : public TransferrableTargetInfo,
11751175
}
11761176
void setRequiresImmediate(llvm::ArrayRef<int> Exacts) {
11771177
Flags |= CI_ImmediateConstant;
1178-
for (int Exact : Exacts)
1179-
ImmSet.insert(Exact);
1178+
ImmSet.insert_range(Exacts);
11801179
}
11811180
void setRequiresImmediate(int Exact) {
11821181
Flags |= CI_ImmediateConstant;

libcxx/include/__config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,8 @@ typedef __char32_t char32_t;
11571157
# define _LIBCPP_USING_IF_EXISTS
11581158
# endif
11591159

1160-
# if __has_attribute(__no_destroy__)
1161-
# define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__))
1160+
# if __has_cpp_attribute(_Clang::__no_destroy__)
1161+
# define _LIBCPP_NO_DESTROY [[_Clang::__no_destroy__]]
11621162
# else
11631163
# define _LIBCPP_NO_DESTROY
11641164
# endif
@@ -1188,14 +1188,14 @@ typedef __char32_t char32_t;
11881188
# define _LIBCPP_NO_SPECIALIZATIONS
11891189
# endif
11901190

1191-
# if __has_attribute(__standalone_debug__)
1192-
# define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__))
1191+
# if __has_cpp_attribute(_Clang::__standalone_debug__)
1192+
# define _LIBCPP_STANDALONE_DEBUG [[_Clang::__standalone_debug__]]
11931193
# else
11941194
# define _LIBCPP_STANDALONE_DEBUG
11951195
# endif
11961196

1197-
# if __has_attribute(__preferred_name__)
1198-
# define _LIBCPP_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
1197+
# if __has_cpp_attribute(_Clang::__preferred_name__)
1198+
# define _LIBCPP_PREFERRED_NAME(x) [[_Clang::__preferred_name__(x)]]
11991199
# else
12001200
# define _LIBCPP_PREFERRED_NAME(x)
12011201
# endif

lldb/bindings/interface/SBProgressDocstrings.i

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,19 @@ rely on the garbage collection when using lldb.SBProgress.
4646
4747
Non-deterministic progresses behave the same, but omit the total in the constructor. ::
4848
49-
non_deterministic_progress = lldb.SBProgress('Non deterministic progress, 'Detail', lldb.SBDebugger)
49+
non_deterministic_progress = lldb.SBProgress('Non deterministic progress', 'Detail', lldb.SBDebugger)
5050
for i in range(10):
5151
non_deterministic_progress.Increment(1)
5252
# Explicitly send a progressEnd, otherwise this will be sent
5353
# when the python runtime cleans up this object.
5454
non_deterministic_progress.Finalize()
55+
56+
Additionally for Python, progress is supported in a with statement. ::
57+
with lldb.SBProgress('Non deterministic progress', 'Detail', lldb.SBDebugger) as progress:
58+
for i in range(10):
59+
progress.Increment(1)
60+
# The progress object is automatically finalized when the with statement
61+
5562
") lldb::SBProgress;
5663

5764
%feature("docstring",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
%extend lldb::SBProgress {
2+
#ifdef SWIGPYTHON
3+
%pythoncode %{
4+
def __enter__(self):
5+
'''No-op for with statement'''
6+
pass
7+
8+
def __exit__(self, exc_type, exc_value, traceback):
9+
'''Finalize the progress object'''
10+
self.Finalize()
11+
%}
12+
#endif
13+
}

lldb/bindings/interfaces.swig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
%include "./interface/SBModuleSpecExtensions.i"
201201
%include "./interface/SBModuleSpecListExtensions.i"
202202
%include "./interface/SBProcessExtensions.i"
203+
%include "./interface/SBProgressExtensions.i"
203204
%include "./interface/SBProcessInfoListExtensions.i"
204205
%include "./interface/SBQueueItemExtensions.i"
205206
%include "./interface/SBScriptObjectExtensions.i"

lldb/test/API/tools/lldb-dap/progress/Progress_emitter.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,18 @@ def __call__(self, debugger, command, exe_ctx, result):
8888
progress = lldb.SBProgress(
8989
"Progress tester", "Initial Detail", total, debugger
9090
)
91-
9291
# Check to see if total is set to None to indicate an indeterminate progress
9392
# then default to 10 steps.
94-
if total is None:
95-
total = 10
96-
97-
for i in range(1, total):
98-
if cmd_options.no_details:
99-
progress.Increment(1)
100-
else:
101-
progress.Increment(1, f"Step {i}")
102-
time.sleep(cmd_options.seconds)
103-
104-
# Not required for deterministic progress, but required for indeterminate progress.
105-
progress.Finalize()
93+
with progress:
94+
if total is None:
95+
total = 10
96+
97+
for i in range(1, total):
98+
if cmd_options.no_details:
99+
progress.Increment(1)
100+
else:
101+
progress.Increment(1, f"Step {i}")
102+
time.sleep(cmd_options.seconds)
106103

107104

108105
def __lldb_init_module(debugger, dict):

llvm/lib/Analysis/IRSimilarityIdentifier.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ void IRInstructionData::initializeInstruction() {
7878
// We capture the incoming BasicBlocks as values as well as the incoming
7979
// Values in order to check for structural similarity.
8080
if (PHINode *PN = dyn_cast<PHINode>(Inst))
81-
for (BasicBlock *BB : PN->blocks())
82-
OperVals.push_back(BB);
81+
llvm::append_range(OperVals, PN->blocks());
8382
}
8483

8584
IRInstructionData::IRInstructionData(IRInstructionDataList &IDList)

0 commit comments

Comments
 (0)