[LLVMdev] Correct use of StringRef and Twine

David Blaikie
Tue, 19 Jul 2011 17:44:45 -0000

> Problem is, there are REALLY bad std::string implementations out there in
> widely used c++ runtimes.

No doubt - though widely used to build llvm/clang? Perhaps, I suppose,
I'm not sure just how portable llvm code is.

> StringRef/Twine is efficient everywhere.

Yep - I'm just pedantic about having a tidy codebase, and duplicate
code to workaround bad implementations when clang/llvm itself is a
good one & can selfhost seems a bit of a pity.

(which raises another side question on a comment I saw Chris make a
few weeks ago: that llvm/clang (or perhaps the comment was limited to
llvm only?) wouldn't be migrating to C++0x in the near/foreseeable
future. Given the ability to selfhost, I was wondering why that would
be? (My best guess is that clang/llvm can't bootstrap itself yet, so
it still needs to remain compilable with something that can be
bootstrapped))