#
379ed394 |
| 13-Apr-2015 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Revert r234615, "Have one raw_fd_ostream constructor forward to the other."
It broke MSVCRT hosts:
LLVM :: Object/check_binary_output.ll LLVM :: Object/extract.ll
llvm-svn: 234721
|
#
74d2f617 |
| 10-Apr-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remember if lseek works in this FD.
It will be used in clang in a sec.
llvm-svn: 234619
|
#
a4800720 |
| 10-Apr-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Have one raw_fd_ostream constructor forward to the other.
This fixes some odd behavior differences between the two. In particular, the version that takes a FD no longer unconditionally sets stdout t
Have one raw_fd_ostream constructor forward to the other.
This fixes some odd behavior differences between the two. In particular, the version that takes a FD no longer unconditionally sets stdout to binary.
llvm-svn: 234615
show more ...
|
#
62e6ec06 |
| 09-Apr-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Misc cleanup. NFC.
These were lost when I reverted the raw_ostream changes.
llvm-svn: 234504
|
#
ee0dd4d2 |
| 09-Apr-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
This reverts commit r234460 and r234461.
Revert "Add classof implementations to the raw_ostream classes." Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream."
The underlyi
This reverts commit r234460 and r234461.
Revert "Add classof implementations to the raw_ostream classes." Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream."
The underlying issue can be fixed without classof.
llvm-svn: 234495
show more ...
|
#
0a261a3d |
| 09-Apr-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Add classof implementations to the raw_ostream classes.
More uses to follow in a another patch.
llvm-svn: 234460
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4 |
|
#
af09f22c |
| 15-Feb-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
Format: Modernize using variadic templates.
Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can
Format: Modernize using variadic templates.
Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed.
Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack.
llvm-svn: 229337
show more ...
|
Revision tags: llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2 |
|
#
39571b37 |
| 26-Jan-2015 |
Zachary Turner <zturner@google.com> |
Teach raw_ostream to support hex formatting without a prefix '0x'.
Previously using format_hex() would always print a 0x prior to the hex characters. This allows this to be optional, so that one ca
Teach raw_ostream to support hex formatting without a prefix '0x'.
Previously using format_hex() would always print a 0x prior to the hex characters. This allows this to be optional, so that one can choose to print (e.g.) 255 as either 0xFF or just FF.
Differential Revision: http://reviews.llvm.org/D7151
llvm-svn: 227108
show more ...
|
Revision tags: llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2 |
|
#
5be22a12 |
| 12-Dec-2014 |
Michael Ilseman <milseman@apple.com> |
Clean up static analyzer warnings.
Clang's static analyzer found several potential cases of undefined behavior, use of un-initialized values, and potentially null pointer dereferences in tablegen, S
Clean up static analyzer warnings.
Clang's static analyzer found several potential cases of undefined behavior, use of un-initialized values, and potentially null pointer dereferences in tablegen, Support, MC, and ADT. This cleans them up with specific assertions on the assumptions of the code.
llvm-svn: 224154
show more ...
|
Revision tags: llvmorg-3.5.1-rc1 |
|
#
51c2afc4 |
| 07-Oct-2014 |
David Majnemer <david.majnemer@gmail.com> |
Support: Don't call close again if we get EINTR
Most Unix-like operating systems guarantee that the file descriptor is closed after a call to close(2), even if close comes back with EINTR. For these
Support: Don't call close again if we get EINTR
Most Unix-like operating systems guarantee that the file descriptor is closed after a call to close(2), even if close comes back with EINTR. For these systems, calling close _again_ will either do nothing or close some other file descriptor open(2)'d by another thread. (Linux)
However, some operating systems do not have this behavior. They require at least another call to close(2) before guaranteeing that the descriptor is closed. (HP-UX)
And some operating systems have an unpredictable blend of the two behaviors! (xnu)
Avoid this disaster by blocking all signals before we call close(2). This ensures that a signal will not be delivered to the thread and close(2) will not give us back EINTR. We restore the signal mask once the operation is done.
N.B. This isn't a problem on Windows, it doesn't have a notion of EINTR because signals always get delivered to dedicated signal handling threads.
llvm-svn: 219189
show more ...
|
#
4b3c90f2 |
| 26-Sep-2014 |
David Majnemer <david.majnemer@gmail.com> |
Support: Remove undefined behavior from &raw_ostream::operator<<
Don't negate signed integer types in &raw_ostream::operator<<(const FormattedNumber &FN).
llvm-svn: 218496
|
#
e6480374 |
| 25-Sep-2014 |
Nick Kledzik <kledzik@apple.com> |
[Support] Add type-safe alternative to llvm::format()
llvm::format() is somewhat unsafe. The compiler does not check that integer parameter size matches the %x or %d size and it does not complain wh
[Support] Add type-safe alternative to llvm::format()
llvm::format() is somewhat unsafe. The compiler does not check that integer parameter size matches the %x or %d size and it does not complain when a StringRef is passed for a %s. And correctly using a StringRef with format() is ugly because you have to convert it to a std::string then call c_str(). The cases where llvm::format() is useful is controlling how numbers and strings are printed, especially when you want fixed width output. This patch adds some new formatting functions to raw_streams to format numbers and StringRefs in a type safe manner. Some examples:
OS << format_hex(255, 6) => "0x00ff" OS << format_hex(255, 4) => "0xff" OS << format_decimal(0, 5) => " 0" OS << format_decimal(255, 5) => " 255" OS << right_justify(Str, 5) => " foo" OS << left_justify(Str, 5) => "foo "
llvm-svn: 218463
show more ...
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4 |
|
#
3fd1e993 |
| 25-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error.
A create static method would be even b
Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error.
A create static method would be even better, but this patch is already a bit too big.
llvm-svn: 216393
show more ...
|
Revision tags: llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1 |
|
#
0fc52d4e |
| 17-Jul-2014 |
Hans Wennborg <hans@hanshq.net> |
Typo: exists -> exits
llvm-svn: 213290
|
#
48bbd061 |
| 11-Jul-2014 |
Alp Toker <alp@nuanti.com> |
Simplify the raw_svector_ostream tweak from r212816
The memcpy() and overlap helps didn't help much with timings, so clean up the change.
The difference at this point is that we now leave growth of
Simplify the raw_svector_ostream tweak from r212816
The memcpy() and overlap helps didn't help much with timings, so clean up the change.
The difference at this point is that we now leave growth of the storage buffer up to SmallVector's implementation:
- OS.reserve(OS.capacity() * 2); + OS.reserve(OS.size() + 64);
llvm-svn: 212837
show more ...
|
#
bc4d1a36 |
| 11-Jul-2014 |
Alp Toker <alp@nuanti.com> |
raw_svector_ostream: grow and reserve atomically
Including the scratch buffer size in the initial reservation eliminates the subsequent malloc+move operation and offers a healthier constant growth w
raw_svector_ostream: grow and reserve atomically
Including the scratch buffer size in the initial reservation eliminates the subsequent malloc+move operation and offers a healthier constant growth with less memory wastage.
When doing this, take care to avoid invalidating the source buffer.
llvm-svn: 212816
show more ...
|
#
e69170a1 |
| 26-Jun-2014 |
Alp Toker <alp@nuanti.com> |
Revert "Introduce a string_ostream string builder facilty"
Temporarily back out commits r211749, r211752 and r211754.
llvm-svn: 211814
|
#
61471738 |
| 26-Jun-2014 |
Alp Toker <alp@nuanti.com> |
Introduce a string_ostream string builder facilty
string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface.
small_string_ostream<by
Introduce a string_ostream string builder facilty
string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface.
small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap.
This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation.
The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface.
llvm-svn: 211749
show more ...
|
#
3acea398 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't use 'using std::error_code' in include/llvm.
This should make sure that most new uses use the std prefix.
llvm-svn: 210835
|
#
a6e9c3e4 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove system_error.h.
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch.
llvm-svn: 210803
|
Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2 |
|
#
2617dcce |
| 15-Apr-2014 |
Craig Topper <craig.topper@gmail.com> |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206252
|
Revision tags: llvmorg-3.4.1-rc1 |
|
#
27a58bf7 |
| 27-Feb-2014 |
Ben Langmuir <blangmuir@apple.com> |
Revert "Use StringRef in raw_fd_ostream constructor"
This reverts commit r202225, which may cause a performance regression.
llvm-svn: 202338
|
#
6a2a14da |
| 26-Feb-2014 |
Ben Langmuir <blangmuir@apple.com> |
Use StringRef in raw_fd_ostream constructor
llvm-svn: 202225
|
#
90c7f1cc |
| 24-Feb-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. For
Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-)
llvm-svn: 202052
show more ...
|
#
4961f7a8 |
| 12-Jan-2014 |
NAKAMURA Takumi <geek4civic@gmail.com> |
raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would barf wide chars after llvm::errs().
llvm-svn: 199057
|