Dan Gohman
6e97d8955f
Minor code simplification.
...
llvm-svn: 104959
2010-05-28 16:50:23 +00:00
Dan Gohman
1c7843bad9
Fix a redundant-return warning.
...
llvm-svn: 104958
2010-05-28 16:50:01 +00:00
Dan Gohman
9789093ab7
Add basic error checking to MemoryBuffer::getSTDIN.
...
llvm-svn: 104855
2010-05-27 17:31:51 +00:00
Jakob Stoklund Olesen
1c0aa5f14a
Add StringRef::compare_numeric and use it to sort TableGen register records.
...
This means that our Registers are now ordered R7, R8, R9, R10, R12, ...
Not R1, R10, R11, R12, R2, R3, ...
llvm-svn: 104745
2010-05-26 21:47:28 +00:00
Daniel Dunbar
38460e2596
Fix __crashreport_info__ declaration.
...
llvm-svn: 104300
2010-05-20 23:50:19 +00:00
Dan Gohman
434b54846d
Add a comment explaining why this code uses Append mode.
...
llvm-svn: 104095
2010-05-19 01:21:34 +00:00
Dan Gohman
393fa6e0a2
Usage of O_NONBLOCK in bjam is now confirmed as a bug and fixed upstream.
...
Update the comment.
llvm-svn: 104021
2010-05-18 15:25:14 +00:00
Chris Lattner
a1f4042939
improve portability to systems that don't have round, patch by
...
Evzen Muller!
llvm-svn: 103877
2010-05-15 17:11:55 +00:00
Daniel Dunbar
00f50519b6
Add new configure option, --disable-timestamps, intended to turn off anything which would mess up binary/object comparisons. Currently:
...
- Disables 'Built on ...' in 'foo --version'.
- Disables timestamps from being embedded into .dir files.
llvm-svn: 103423
2010-05-10 20:11:56 +00:00
Daniel Dunbar
ddfbf5658d
Run interrupt routines as part of report_fatal_error, since we are failing
...
ungracefully.
llvm-svn: 103334
2010-05-08 02:10:36 +00:00
Dan Gohman
783a114a69
Handle the case where open(2) or close(2) is interrupted by a signal when
...
automatic syscall restarting is disabled.
Also, fix the build on systems which don't define EWOULDBLOCK.
llvm-svn: 103158
2010-05-06 02:06:20 +00:00
Dan Gohman
3a3eadef40
Handle EWOULDBLOCK as EAGAIN. And add a comment explaining why
...
EAGAIN and EWOULDBLOCK are used here.
Also, handle the case where a write call is interrupted after
some data has already been written.
llvm-svn: 103153
2010-05-06 01:27:36 +00:00
Chris Lattner
b9f858943a
Implement rdar://7415680 - Twine integer support lacks greatness
...
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
2010-05-05 18:40:33 +00:00
Benjamin Kramer
8712466dd6
Try again if write(2) reports an recoverable error.
...
This should fix mysteriously crashing boost regression tests when stderr is
managed by bjam (PR7043).
llvm-svn: 103085
2010-05-05 15:17:47 +00:00
Devang Patel
2a21d92744
Fix typo. add a test case.
...
llvm-svn: 101812
2010-04-19 20:31:39 +00:00
Devang Patel
06123c1012
Add DW_AT_APPLE_omit_frame_ptr to encode -fomit-frame-pointer flag.
...
llvm-svn: 101805
2010-04-19 19:14:02 +00:00
Chris Lattner
f543d5e029
reduce indentation
...
llvm-svn: 101692
2010-04-18 03:35:23 +00:00
Dan Gohman
d48633d340
Fix a bunch of namespace polution.
...
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Benjamin Kramer
a4c5712b41
BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
...
llvm-svn: 101138
2010-04-13 16:38:06 +00:00
Benjamin Kramer
4ca6d372d5
Let BumpPtrAllocator lazily allocate the first slab.
...
We have some code in llvm and clang where a BumpPtrAllocator is declared in a
class but never used in the common case. Stop wasting memory there.
llvm-svn: 101130
2010-04-13 14:41:51 +00:00
Chris Lattner
72bc852ebe
Fix PR6826: GraphWriter delete the generated file before "dotty" load it,
...
patch by 'ether'.
llvm-svn: 101116
2010-04-13 04:35:39 +00:00
Chris Lattner
9d77e5ba47
add minix support, patch by Kees van Reeuwijk! PR6797
...
llvm-svn: 100895
2010-04-09 20:45:04 +00:00
Chris Lattner
cd7b368e65
clean this up, fix std::min ambiguity on some platforms.
...
llvm-svn: 100894
2010-04-09 20:43:54 +00:00
Benjamin Kramer
3b7602b1fb
Various MSVC warning fixes about truncated 64 bit shifts and const pointers passed to free.
...
llvm-svn: 100767
2010-04-08 15:25:57 +00:00
Chris Lattner
ea8b374616
rename llvm_install_error_handler -> install_fatal_error_handler
...
and friends.
llvm-svn: 100717
2010-04-07 23:12:29 +00:00
Chris Lattner
80b41881bc
rename llvm::llvm_report_error -> llvm::report_fatal_error
...
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
c83a42075b
enhance SMDiagnostic to also maintain a pointer to the SourceMgr.
...
Add a simplified constructor for clients that don't have locations
like "file not found" errors.
llvm-svn: 100538
2010-04-06 18:06:18 +00:00
Chris Lattner
48d30a3011
give the SourceMgr object a cookie.
...
llvm-svn: 100504
2010-04-06 00:33:43 +00:00
Chris Lattner
117d05ca0e
Give llvm::SourceMgr the ability to have a client-specified
...
diagnostic handler.
llvm-svn: 100503
2010-04-06 00:26:48 +00:00
Chris Lattner
269737461d
stringref-ize the MemoryBuffer::get apis. This requires
...
a co-committed clang patch.
llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Owen Anderson
3694d62450
Push const through the regex engine. Fixes some of the warnings in PR6616.
...
llvm-svn: 100438
2010-04-05 17:50:20 +00:00
Benjamin Kramer
1ef6689d58
Remove accidental include and add a comment.
...
llvm-svn: 100107
2010-04-01 14:39:55 +00:00
Benjamin Kramer
71eaf27165
Various improvements to MemoryBuffer::getFile:
...
- Use a RAII object to close the FD.
- Use sys::StrError instead of thread-unsafe strerror calls.
- Recover gracefully if read returns zero. This works around an issue on
DragonFlyBSD where /dev/null has an st_size of 136 but we can't read 136 bytes
from it.
llvm-svn: 100106
2010-04-01 14:35:22 +00:00
Benjamin Kramer
4b94ce229d
Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
...
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.
llvm-svn: 99919
2010-03-30 20:16:45 +00:00
Douglas Gregor
63f8158cff
Introduce namespace-scope functions to enable LLVM statistics without
...
passing the command-line parameter "-stats" and to print the resulting
statistics without calling llvm_shutdown().
llvm-svn: 99893
2010-03-30 17:32:08 +00:00
Torok Edwin
df7c52143e
Reapply r99881 with some fixes: only call destructor in releaseMemory!
...
llvm-svn: 99883
2010-03-30 11:17:48 +00:00
Torok Edwin
0994bb75ce
Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.
...
llvm-svn: 99882
2010-03-30 10:25:08 +00:00
Torok Edwin
24db267b1e
Introduce another Reset() method in BumpPtrAllocator that calls a destructor
...
on all objects it has allocated, if they are all of the same size and alignment.
Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653).
valnos is not reliable for this purpose, as seen in r99400
(which still leaked, and sometimes caused double frees).
llvm-svn: 99881
2010-03-30 10:08:26 +00:00
Chris Lattner
fda28ada89
stringref'ize Timer apis
...
llvm-svn: 99877
2010-03-30 05:34:02 +00:00
Chris Lattner
966ab1ec5e
finally, maintain a global list of timer groups, allowing us to
...
implement TimerGroup::printAll, which prints and resets all active
timers.
llvm-svn: 99876
2010-03-30 05:27:58 +00:00
Chris Lattner
ea827a1632
add a new TimerGroup::print method, and refactor away the bogus
...
TimerGroup copy ctor and assignment operator.
llvm-svn: 99875
2010-03-30 05:20:02 +00:00
Chris Lattner
76a4736a55
rename GetLibSupportInfoOutputFile -> CreateInfoOutputFile and
...
have it always return a new stream to simplify clients.
llvm-svn: 99874
2010-03-30 05:01:08 +00:00
Chris Lattner
3e11ba35b0
if a timergroup is destroyed before its timers, print times.
...
llvm-svn: 99873
2010-03-30 04:58:26 +00:00
Chris Lattner
2a254fd348
change TimerGroup to keep a linked list of active timers
...
instead of just a count of them, and refactor the guts of
report printing out of removeTimer into its own method.
Refactor addTimerToPrint away.
llvm-svn: 99872
2010-03-30 04:40:01 +00:00
Chris Lattner
4424043996
reapply my timer rewrite with a change for PassManager to store
...
timers by pointer instead of by-value.
llvm-svn: 99871
2010-03-30 04:03:22 +00:00
Chris Lattner
bbb637bacc
revert r99862 which is causing FNT failures.
...
llvm-svn: 99870
2010-03-30 03:57:00 +00:00
Chris Lattner
65efe21d42
fairly major rewrite of various timing related stuff.
...
llvm-svn: 99862
2010-03-30 02:38:19 +00:00
Chris Lattner
92303f03c1
move a function into a more logical place in the file
...
llvm-svn: 99842
2010-03-29 21:34:06 +00:00
Chris Lattner
7e3957a646
remove support for per-time peak memory tracking, this
...
isn't used by anyone and is better exposed as a non-per-timer
thing. Also, stop including System/Mutex.h in Timer.h
llvm-svn: 99841
2010-03-29 21:28:41 +00:00
Chris Lattner
0c8d8cd921
various timer fixes: move operator= out of line,
...
eliminate the per-timer lock (timers should be
externally locked if needed), the info-output-stream
can never be dbgs(), so drop the check. Make some
stuff private.
llvm-svn: 99839
2010-03-29 21:24:52 +00:00