[PATCH] D65189: [MC] Support returning a structured rich disassembly output

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 04:39:54 PDT 2019


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/include/llvm/MC/MCInstPrinter.h:113-114
+  /// A stack of pointers which points to &MS set by setMarkupSpans or
+  /// InnerSpans of unclosed MarkupSpans. Here we use std::vector as a stack
+  /// instead of std::stack because we need "clear" method.
+  std::vector<std::vector<MarkupSpan> *> MarkupSpans;
----------------
seiya wrote:
> jhenderson wrote:
> > You could just use `while(!MarupSpans.empty()) MarkupSpans.pop();` instead of `clear`, if you want to use a `std::stack`.
> Fixed. First I thought iterating all elements (`O(n)`) is not good but it won't be issue because `n` is small  (typically n < 3) here...
I think vector::clear is likely O(n) time as well - it has to destroy all its elements.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65189/new/

https://reviews.llvm.org/D65189





More information about the llvm-commits mailing list