summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Twine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary llvm:: qualification.Eric Christopher2014-02-261-2/+2
| | | | llvm-svn: 202316
* Add Twine support for characters, and switch twine to use a union internallyChris Lattner2011-07-241-27/+33
| | | | | | to eliminate some casting. llvm-svn: 135888
* In Twine::str(), if the Twine stores only a std::string, just return a ↵Frits van Bommel2011-07-151-3/+8
| | | | | | direct copy of that instead of first copying to a SmallString and converting that to a std::string. Also fix some indentation. llvm-svn: 135267
* Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.Michael J. Spencer2010-12-031-4/+12
| | | | llvm-svn: 120791
* Support/ADT/Twine: Add toNullTerminatedStringRef.Michael J. Spencer2010-12-011-0/+12
| | | | llvm-svn: 120600
* Fix Whitespace.Michael J. Spencer2010-11-261-7/+7
| | | | llvm-svn: 120166
* Implement rdar://7415680 - Twine integer support lacks greatnessChris Lattner2010-05-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Microoptimize Twine's with unsigned and int to not pin their value to the stack. This saves stack space in common cases and allows mem2reg in the caller. A simple example is: void foo(const Twine &); void bar(int x) { foo("xyz: " + Twine(x)); } Before: __Z3bari: subq $40, %rsp movl %edi, 36(%rsp) leaq L_.str3(%rip), %rax leaq 36(%rsp), %rcx leaq 8(%rsp), %rdi movq %rax, 8(%rsp) movq %rcx, 16(%rsp) movb $3, 24(%rsp) movb $7, 25(%rsp) callq __Z3fooRKN4llvm5TwineE addq $40, %rsp ret After: __Z3bari: subq $24, %rsp leaq L_.str3(%rip), %rax movq %rax, (%rsp) movslq %edi, %rax movq %rax, 8(%rsp) movb $3, 16(%rsp) movb $7, 17(%rsp) leaq (%rsp), %rdi callq __Z3fooRKN4llvm5TwineE addq $24, %rsp ret It saves 16 bytes of stack and one instruction in this case. llvm-svn: 103107
* Introduce Twine::toStringRef, a variant of toVector which avoids the copy if theBenjamin Kramer2010-01-131-2/+8
| | | | | | | twine can be represented as a single StringRef. Use the new methode to simplify some twine users. llvm-svn: 93317
* Change errs() to dbgs().David Greene2010-01-051-2/+3
| | | | llvm-svn: 92640
* Switch Twine::str() to use toVector(), which is now efficient.Daniel Dunbar2009-08-191-14/+4
| | | | llvm-svn: 79437
* Add missing flush().Daniel Dunbar2009-08-021-0/+3
| | | | llvm-svn: 77859
* Twine: Directly support int, long, and long long types.Daniel Dunbar2009-07-301-17/+29
| | | | | | - This should resolve Cygwin gcc ambiguities. llvm-svn: 77624
* Twine: Use raw_ostream::write_hex, remove unused itohexstr method.Daniel Dunbar2009-07-301-2/+1
| | | | llvm-svn: 77617
* Twine: Provide [u]int{32,64} conversions via implicit constructors instead ofDaniel Dunbar2009-07-301-6/+18
| | | | | | explicitly. llvm-svn: 77576
* Twines: Support numeric conversion directly (uitostr, etc).Daniel Dunbar2009-07-291-11/+37
| | | | | | | | | | | | | | | - Provides static constructors for doing number to string conversions without using temporaries. - There are several ways to do this, I think given the Twine constraints this is the simplest one. - One FIXME for fast number -> hex conversion. - Added another comment on one last major bit of perf work Twines need, which is to make raw_svector_ostream more efficient. llvm-svn: 77445
* Add Twine ADT.Daniel Dunbar2009-07-241-0/+91
- Not currently used. llvm-svn: 76956
OpenPOWER on IntegriCloud