Skip to content

Commit 6efe94b

Browse files
committed
Address comments
1 parent 37dd0d1 commit 6efe94b

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

llvm/docs/LangRef.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6983,10 +6983,13 @@ present in. The ``line:`` and ``column:`` field are the source line and column
69836983
within the file where the label is declared.
69846984

69856985
Furthermore, a label can be marked as artificial, i.e. compiler-generated,
6986-
using ``isArtificial:``. Such artitificial labels are generated, e.g., by
6986+
using ``isArtificial:``. Such artificial labels are generated, e.g., by
69876987
the ``CoroSplit`` pass. In addition, the ``CoroSplit`` pass also uses the
69886988
``coroSuspendIdx:`` field to identify the coroutine suspend points.
69896989

6990+
``scope:``, ``name:``, ``file:`` and ``line:`` are mandatory. The remaining
6991+
fields are optional.
6992+
69906993
.. code-block:: text
69916994

69926995
!2 = !DILabel(scope: !0, name: "foo", file: !1, line: 7, column: 4)

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,6 @@ Error MetadataLoader::MetadataLoaderImpl::parseMetadata(bool ModuleLevel) {
11331133
++NumMDRecordLoaded;
11341134
if (Expected<unsigned> MaybeCode =
11351135
Stream.readRecord(Entry.ID, Record, &Blob)) {
1136-
// Crashes called from here!
11371136
if (Error Err = parseOneMetadata(Record, MaybeCode.get(), Placeholders,
11381137
Blob, NextMetadataNo))
11391138
return Err;
@@ -1320,7 +1319,6 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
13201319
unsigned Size = Record.size();
13211320
NamedMDNode *NMD = TheModule.getOrInsertNamedMetadata(Name);
13221321
for (unsigned i = 0; i != Size; ++i) {
1323-
// Crashes here!
13241322
MDNode *MD = MetadataList.getMDNodeFwdRefOrNull(Record[i]);
13251323
if (!MD)
13261324
return error("Invalid named metadata: expect fwd ref to MDNode");
@@ -2251,8 +2249,8 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
22512249
bool IsArtificial = Record[0] & 2;
22522250
std::optional<unsigned> CoroSuspendIdx;
22532251
if (Record.size() > 6) {
2254-
unsigned RawSuspendIdx = Record[6];
2255-
if (RawSuspendIdx != std::numeric_limits<unsigned>::max()) {
2252+
uint64_t RawSuspendIdx = Record[6];
2253+
if (RawSuspendIdx != std::numeric_limits<uint64_t>::max()) {
22562254
if (RawSuspendIdx > (uint64_t)std::numeric_limits<unsigned>::max())
22572255
return error("CoroSuspendIdx value is too large");
22582256
CoroSuspendIdx = RawSuspendIdx;

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ static void printExtendedName(raw_ostream &OS, const DINode *Node,
715715
Res = V->getName();
716716
Line = V->getLine();
717717
} else if (const auto *L = dyn_cast<const DILabel>(Node)) {
718-
// XXX what are we doing here? Adjust it?
719718
Res = L->getName();
720719
Line = L->getLine();
721720
}

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ static void buildFrameDebugInfo(Function &F, coro::Shape &Shape,
689689
FrameDataInfo &FrameData) {
690690
DISubprogram *DIS = F.getSubprogram();
691691
// If there is no DISubprogram for F, it implies the function is compiled
692-
// without debug info. So we also don't generate debug info for the frame,
693-
// either.
692+
// without debug info. So we also don't generate debug info for the frame.
694693
if (!DIS || !DIS->getUnit() ||
695694
!dwarf::isCPlusPlus(
696695
(dwarf::SourceLanguage)DIS->getUnit()->getSourceLanguage()) ||

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ struct SwitchCoroutineSplitter {
14831483
DISubprogram *DIS = F.getSubprogram();
14841484
// If there is no DISubprogram for F, it implies the function is compiled
14851485
// without debug info. So we also don't generate debug info for the
1486-
// suspension points, either.
1486+
// suspension points.
14871487
bool AddDebugLabels =
14881488
(DIS && DIS->getUnit() &&
14891489
(DIS->getUnit()->getEmissionKind() ==
@@ -1552,7 +1552,7 @@ struct SwitchCoroutineSplitter {
15521552
// br label %resume.0.landing
15531553
//
15541554
// resume.0: ; <--- jump from the switch in the resume.entry
1555-
// XXX: label
1555+
// #dbg_label(...) ; <--- artificial label for debuggers
15561556
// %0 = tail call i8 @llvm.coro.suspend(token none, i1 false)
15571557
// br label %resume.0.landing
15581558
//

0 commit comments

Comments
 (0)