[PATCH] D89567: [AsmWriter] Construct SlotTracker with the function
Kazu Hirata via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 15:02:18 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG96f372c1e740: [AsmWriter] Construct SlotTracker with the function (authored by kazu).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89567/new/
https://reviews.llvm.org/D89567
Files:
llvm/lib/IR/AsmWriter.cpp
llvm/test/Other/bb-badref.ll
Index: llvm/test/Other/bb-badref.ll
===================================================================
--- /dev/null
+++ llvm/test/Other/bb-badref.ll
@@ -0,0 +1,14 @@
+; RUN: opt -passes=loop-instsimplify -print-after-all -disable-output -S < %s 2>&1 | FileCheck %s
+
+; loop-instsimplify dumps individual basic blocks as part of a loop,
+; not a function. Verify that the non-entry basic block is labeled as
+; "1", not "<badref>".
+
+; CHECK-NOT: <badref>
+
+define void @foo() {
+ br label %1
+
+1:
+ br label %1
+}
Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -4417,7 +4417,7 @@
void BasicBlock::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
bool ShouldPreserveUseListOrder,
bool IsForDebug) const {
- SlotTracker SlotTable(this->getModule());
+ SlotTracker SlotTable(this->getParent());
formatted_raw_ostream OS(ROS);
AssemblyWriter W(OS, SlotTable, this->getModule(), AAW,
IsForDebug,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89567.299485.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/afbad6f0/attachment.bin>
More information about the llvm-commits
mailing list