[PATCH] D86892: Improve error handling for SmallVector programming errors.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 15:24:02 PDT 2020


mehdi_amini added inline comments.


================
Comment at: llvm/lib/Support/SmallVector.cpp:53
+    report_fatal_error("SmallVector unable to grow. Requested capacity (" +
+                       std::to_string(MinCapacity) +
+                       ") is larger than maximum capacity for size type (" +
----------------
GMNGeoffrey wrote:
> mehdi_amini wrote:
> > This use to be banned from LLVM because some stdlib we supported were buggy with this (Android maybe?)
> > 
> > In general I use instead Twine.
> I just noticed that the normal SmallVector::grow has the same problem as this, so going to update that as well. That lives in SmallVector.h though, and trying to include Twine there gets us into all sorts of weird trouble. Is to_string still banned? Do you have another suggestion?
I grepped in LLVM and it seems like std::to_string is widely used now, so I guess Android (or whoever had this bug) upgraded their stdlibc++


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86892



More information about the llvm-commits mailing list