Eli Friedman
2e06e8bbcc
Some small improvements to dead code elimination; helps a bit on
...
LLVM-Code-Symbols test.
llvm-svn: 92152
2009-12-25 05:29:40 +00:00
Eli Friedman
fddc26cc64
Make copy constructor elimination work in more cases; the case in question
...
here affects clang-on-clang.
llvm-svn: 92151
2009-12-24 23:33:34 +00:00
John McCall
dd5044ac55
Implement support for converting to string at "natural precision", and fix some
...
major bugs in long-precision conversion.
llvm-svn: 92150
2009-12-24 23:18:09 +00:00
Sam Weinig
07d211ea40
Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.
...
llvm-svn: 92149
2009-12-24 23:15:03 +00:00
Anders Carlsson
fb404888af
Move a bunch of class related functions to CGClass.cpp, no functionality change.
...
llvm-svn: 92148
2009-12-24 22:46:43 +00:00
Daniel Dunbar
c19b219280
Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
...
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.
llvm-svn: 92147
2009-12-24 21:27:38 +00:00
Douglas Gregor
4ee2cf658c
Move the two definitions of operator<< into namespace llvm, so they
...
will be found by argument-dependent lookup. As with the previous
commit, GCC is allowing ill-formed code.
llvm-svn: 92146
2009-12-24 21:15:37 +00:00
Anders Carlsson
bfb3671b25
Pass the return value slot to all call exprs.
...
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Douglas Gregor
1f21000902
Define the new operator<< for sets into namespace std, so that
...
argument-dependent lookup can find it. This is another case where an
LLVM bug (not making operator<< visible) was masked by a GCC bug
(looking in the global namespace when it shouldn't).
llvm-svn: 92144
2009-12-24 21:11:45 +00:00
Douglas Gregor
33636e66c7
Egregious, disgusting workaround for PR5866. We need to rework how we
...
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.
llvm-svn: 92143
2009-12-24 20:56:24 +00:00
Anders Carlsson
1749083e2e
Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
...
llvm-svn: 92142
2009-12-24 20:40:36 +00:00
Douglas Gregor
4b65441598
Add test case for PR5868, and improve location information slightly for implicit "this" expressions
...
llvm-svn: 92141
2009-12-24 20:23:34 +00:00
Anders Carlsson
b2d47e0eaa
Add a test for x86-64 struct returns under gc.
...
llvm-svn: 92140
2009-12-24 20:21:41 +00:00
Douglas Gregor
8e8eaa14f7
When rebuilding a MemberExpr that refers to an anonymous union, be
...
sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.
llvm-svn: 92139
2009-12-24 20:02:50 +00:00
Anders Carlsson
61a401caec
Pass ReturnValueSlot to EmitCall. No functionality change yet.
...
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Daniel Dunbar
2db411f5a7
Fix -Asserts warning.
...
llvm-svn: 92137
2009-12-24 19:19:26 +00:00
Anders Carlsson
0435ed5875
Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
...
llvm-svn: 92136
2009-12-24 19:08:58 +00:00
Douglas Gregor
363b151ff7
When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
...
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...
llvm-svn: 92135
2009-12-24 18:51:59 +00:00
Douglas Gregor
5c13090bd4
Fix double-destruction assertion to account for temporaries in conditionals
...
llvm-svn: 92134
2009-12-24 18:16:21 +00:00
Daniel Dunbar
54ed390727
Don't emit trailing semicolon.
...
llvm-svn: 92133
2009-12-24 17:49:28 +00:00
Douglas Gregor
4cd5d53ebf
Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again
...
llvm-svn: 92132
2009-12-24 17:48:05 +00:00
Douglas Gregor
f82bead3fd
InitializationSequence handles binding to temporaries, so that
...
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.
llvm-svn: 92131
2009-12-24 17:16:46 +00:00
John McCall
e6212ace38
Substantially optimize APFloat::toString() by doing a single large divide to
...
cut the significand down to the desired precision *before* entering the
core divmod loop. Makes the overall algorithm logarithmic in the exponent.
There's still a lot of room for improvement here, but this gets the
performance back down to acceptable-for-diagnostics levels, even for
long doubles.
negligible, even on long doubles.
llvm-svn: 92130
2009-12-24 12:16:56 +00:00
John McCall
122c8313ff
Fix the clang-on-clang build: APFloat reports underflow whenever we get a
...
denormal, but we only want to diagnose if we underflowed to zero. This
allows people to write constants in the denormal range.
llvm-svn: 92129
2009-12-24 11:09:08 +00:00
John McCall
0e21fccfae
Tweak the text of several main() diagnostics and punch a hole specifically for
...
Darwin's sekrit fourth argument. This should probably be factored to
let targets make target-specific decisions about what main() should look like.
Fixes rdar://problem/7414990
or if different platforms have radically different ideas of what they want in
llvm-svn: 92128
2009-12-24 09:58:38 +00:00
John McCall
53b93a091e
Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
...
llvm-svn: 92127
2009-12-24 09:08:04 +00:00
John McCall
29b5c284ae
Add accessors for the largest-magnitude, smallest-magnitude, and
...
smallest-normalized-magnitude values in a given FP semantics.
Provide an APFloat-to-string conversion which I am quite ready to admit could
be much more efficient.
llvm-svn: 92126
2009-12-24 08:56:26 +00:00
John McCall
bd8d1e35a6
Set Remainder before Quotient in case Quotient and LHS alias. The new
...
order should be immune to such problems.
llvm-svn: 92124
2009-12-24 08:52:06 +00:00
Mike Stump
d538a6d364
Remove some dead code.
...
llvm-svn: 92123
2009-12-24 07:29:41 +00:00
Mike Stump
4a779b93e4
Cleanup some dead code.
...
llvm-svn: 92122
2009-12-24 06:52:05 +00:00
Zhongxing Xu
51f1ca852f
As Ted suggested, record the callsite information with the StackFrameContext.
...
llvm-svn: 92121
2009-12-24 03:34:38 +00:00
Ted Kremenek
fd97ce6573
Add analyzer test case for 'ForStmt' with condition variable.
...
llvm-svn: 92120
2009-12-24 02:41:19 +00:00
Ted Kremenek
9c951ab4f1
Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.
...
llvm-svn: 92119
2009-12-24 02:40:30 +00:00
Mike Stump
bb2f57dd39
Don't set hidden for a non-external symbol as that would make it extenal.
...
Refine codegen for visibility and hidden. WIP.
llvm-svn: 92118
2009-12-24 02:33:48 +00:00
David Chisnall
3a509cd8cc
Fix for bug 5691.
...
This fixes throwing exceptions inside @catch blocks nested inside outer @try blocks and also fixes jumping from an inner @finally to an outer @finally (via any relevant @catch blocks).
The code exhibiting this bug was based on code from CGObjCMac. I believe that this bug may still be present on the Mac runtimes, although the test case in the bug contains a few GNUisms and won't compile without some minor tweaks with Apple's libobjc.
llvm-svn: 92117
2009-12-24 02:26:34 +00:00
Zhongxing Xu
1704c4331b
Inter-procedural analysis: now we can return from the callee.
...
llvm-svn: 92116
2009-12-24 02:25:21 +00:00
Ted Kremenek
17113255a8
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.
...
llvm-svn: 92115
2009-12-24 01:59:46 +00:00
Ted Kremenek
b135a13564
Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.
...
llvm-svn: 92114
2009-12-24 01:49:25 +00:00
Ted Kremenek
ec92f9492b
Add CFG support for the initializer of the condition variable of a ForStmt.
...
llvm-svn: 92113
2009-12-24 01:49:06 +00:00
Ted Kremenek
1c3ab07968
Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.
...
llvm-svn: 92112
2009-12-24 01:48:39 +00:00
Ted Kremenek
1ce53c4320
CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.
...
llvm-svn: 92111
2009-12-24 01:34:10 +00:00
Dale Johannesen
14ee5ead2d
Testcase for llvm-gcc checkin 92108.
...
llvm-svn: 92110
2009-12-24 01:10:43 +00:00
Mike Stump
a8a2a33af9
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
...
llvm-svn: 92109
2009-12-24 01:10:27 +00:00
Chris Lattner
f5e3ed64d5
handle equality memcmp of 8 bytes on x86-64 with two unaligned loads and a
...
compare. On other targets we end up with a call to memcmp because we don't
want 16 individual byte loads. We should be able to use movups as well, but
we're failing to select the generated icmp.
llvm-svn: 92107
2009-12-24 01:07:17 +00:00
Ted Kremenek
09bc3b7df6
Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.
...
llvm-svn: 92106
2009-12-24 00:54:56 +00:00
Ted Kremenek
1f07b4c439
Add CFG support for the initializer of the condition variable of a WhileStmt.
...
llvm-svn: 92105
2009-12-24 00:54:37 +00:00
Ted Kremenek
b04c5cb0ba
Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.
...
llvm-svn: 92104
2009-12-24 00:54:19 +00:00
Ted Kremenek
284d764418
Add test case for PR 4358.
...
llvm-svn: 92103
2009-12-24 00:48:11 +00:00
Ted Kremenek
589493227b
Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.
...
llvm-svn: 92102
2009-12-24 00:40:03 +00:00
Ted Kremenek
8b5dc12e52
Add CFG support for the initializer of the condition variable of a SwitchStmt.
...
llvm-svn: 92101
2009-12-24 00:39:26 +00:00