Dan Gohman
fb85820f9a
Minor code simplification.
...
llvm-svn: 104959
2010-05-28 16:50:23 +00:00
Dan Gohman
feaeb36edf
Fix a redundant-return warning.
...
llvm-svn: 104958
2010-05-28 16:50:01 +00:00
Dan Gohman
c36b1f35f0
Add basic error checking to MemoryBuffer::getSTDIN.
...
llvm-svn: 104855
2010-05-27 17:31:51 +00:00
Jakob Stoklund Olesen
d1d7ed63ff
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
c120ffe3f6
Fix __crashreport_info__ declaration.
...
llvm-svn: 104300
2010-05-20 23:50:19 +00:00
Dan Gohman
744c96dd48
Add a comment explaining why this code uses Append mode.
...
llvm-svn: 104095
2010-05-19 01:21:34 +00:00
Dan Gohman
dea5310433
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
9e01b615a4
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
dac182450b
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
401d4c9341
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
d351116be0
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
ef969f3539
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
d7f69cb7ef
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
ce84a2558c
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
561fa8490e
Fix typo. add a test case.
...
llvm-svn: 101812
2010-04-19 20:31:39 +00:00
Devang Patel
6188093cca
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
1049e1ce1f
reduce indentation
...
llvm-svn: 101692
2010-04-18 03:35:23 +00:00
Dan Gohman
b29cda9b3c
Fix a bunch of namespace polution.
...
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Benjamin Kramer
55cfaa37de
BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
...
llvm-svn: 101138
2010-04-13 16:38:06 +00:00
Benjamin Kramer
5b0650bf6e
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
33154c1fc6
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
c86cdc7d47
add minix support, patch by Kees van Reeuwijk! PR6797
...
llvm-svn: 100895
2010-04-09 20:45:04 +00:00
Chris Lattner
5c289f217b
clean this up, fix std::min ambiguity on some platforms.
...
llvm-svn: 100894
2010-04-09 20:43:54 +00:00
Benjamin Kramer
53dd088b58
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
59c5753174
rename llvm_install_error_handler -> install_fatal_error_handler
...
and friends.
llvm-svn: 100717
2010-04-07 23:12:29 +00:00
Chris Lattner
2104b8d36e
rename llvm::llvm_report_error -> llvm::report_fatal_error
...
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
97c4cb8947
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
654091391b
give the SourceMgr object a cookie.
...
llvm-svn: 100504
2010-04-06 00:33:43 +00:00
Chris Lattner
3c799811c1
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
0e45d24a4e
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
f93bdd1024
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
15630f8238
Remove accidental include and add a comment.
...
llvm-svn: 100107
2010-04-01 14:39:55 +00:00
Benjamin Kramer
10b0f3b314
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
04c713dd45
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
83fd0156a9
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
8061bb141e
Reapply r99881 with some fixes: only call destructor in releaseMemory!
...
llvm-svn: 99883
2010-03-30 11:17:48 +00:00
Torok Edwin
a2d1dc42e1
Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.
...
llvm-svn: 99882
2010-03-30 10:25:08 +00:00
Torok Edwin
ba6d13c0ea
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
39e56a05f7
stringref'ize Timer apis
...
llvm-svn: 99877
2010-03-30 05:34:02 +00:00
Chris Lattner
90fe73dc92
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
4cd6571fef
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
6cbd8d118e
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
dcd68b7a65
if a timergroup is destroyed before its timers, print times.
...
llvm-svn: 99873
2010-03-30 04:58:26 +00:00
Chris Lattner
9a608d248e
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
707431cf26
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
ec8ef9b643
revert r99862 which is causing FNT failures.
...
llvm-svn: 99870
2010-03-30 03:57:00 +00:00
Chris Lattner
57a0542397
fairly major rewrite of various timing related stuff.
...
llvm-svn: 99862
2010-03-30 02:38:19 +00:00
Chris Lattner
dcd7f927bd
move a function into a more logical place in the file
...
llvm-svn: 99842
2010-03-29 21:34:06 +00:00
Chris Lattner
09a4074869
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
b355db7877
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