Douglas Gregor
0c94c02933
Fix double-destruction assertion to account for temporaries in conditionals
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 18:16:21 +00:00
Douglas Gregor
400fd3d809
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
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 17:48:05 +00:00
Douglas Gregor
65552c4247
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 17:16:46 +00:00
John McCall
9f2df88757
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 11:09:08 +00:00
John McCall
6675586c70
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 09:58:38 +00:00
John McCall
94c939dc1d
Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 09:08:04 +00:00
Mike Stump
8cc4f10366
Remove some dead code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 07:29:41 +00:00
Mike Stump
63df2ae96b
Cleanup some dead code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 06:52:05 +00:00
Zhongxing Xu
62d399e188
As Ted suggested, record the callsite information with the StackFrameContext.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 03:34:38 +00:00
Ted Kremenek
dd8b441012
Add analyzer test case for 'ForStmt' with condition variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 02:41:19 +00:00
Ted Kremenek
bfbcefb7e9
Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 02:40:30 +00:00
Mike Stump
4e6f8ee45d
Don't set hidden for a non-external symbol as that would make it extenal.
...
Refine codegen for visibility and hidden. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 02:33:48 +00:00
David Chisnall
0faa516325
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 02:26:34 +00:00
Zhongxing Xu
598278bee8
Inter-procedural analysis: now we can return from the callee.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 02:25:21 +00:00
Ted Kremenek
6281213d87
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:59:46 +00:00
Ted Kremenek
919f0665c3
Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:49:25 +00:00
Ted Kremenek
58b87feeae
Add CFG support for the initializer of the condition variable of a ForStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:49:06 +00:00
Ted Kremenek
f0d975f25b
Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:48:39 +00:00
Ted Kremenek
4ec010a6cc
CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:34:10 +00:00
Mike Stump
c8f76f557c
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 01:10:27 +00:00
Ted Kremenek
4c508a12ce
Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:54:56 +00:00
Ted Kremenek
76525467cf
Add CFG support for the initializer of the condition variable of a WhileStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:54:37 +00:00
Ted Kremenek
7d02b8c3be
Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:54:19 +00:00
Ted Kremenek
cafefbe180
Add test case for PR 4358.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:48:11 +00:00
Ted Kremenek
fcfb503c28
Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:40:03 +00:00
Ted Kremenek
6b501ebaf1
Add CFG support for the initializer of the condition variable of a SwitchStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:39:26 +00:00
Ted Kremenek
a3be0eaa5c
Modify SwitchStmt::child_begin()/child_end() to include the initializer for the condition variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:39:05 +00:00
Nuno Lopes
cb1c77f90d
support the warn_unused_result in C++ class methods
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 00:28:18 +00:00
Nuno Lopes
f75b8309e3
allow the noreturn attribute to be used in class methods
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:40:33 +00:00
Ted Kremenek
35628d1f17
Add StmtIterator support for iterating over both the condition
...
variable initializer and the other expressions in an IfStmt.
This change required adding a 'DoDestroy()' method for IfStmt that did
not include destroying the initializer (since that is owned by the
VarDecl).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:38:34 +00:00
Ted Kremenek
8a69366a1c
Tidy up FindSubExprAssignments to not deference the child_iterator multiple times.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:37:10 +00:00
Douglas Gregor
036aed1866
When we see a CXXDefaultArgExpr during template instantiation, rebuild
...
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:03:06 +00:00
Mike Stump
8d9fb9b213
Fix regression found by g++.dg/eh/alias1.C.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:48:20 +00:00
Ted Kremenek
b03f630a5d
Increase StmtIterator size by one pointer (separating out the Stmt** from the union including Decl* and Decl**).
...
This change is setup for adding StmtIterator support for condition variables in IfStmt, WhileStmt, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:31:49 +00:00
Anders Carlsson
f28c687866
Mangle block pointer types. Fixes PR5858.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:31:44 +00:00
Chris Lattner
7c8f9b77e1
fix typo
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:06:12 +00:00
Douglas Gregor
154fe9812f
There is no such thing as typeinfo for a cv-qualified type. Assert
...
that this is true when mangling, then fix up the various places in
Sema and/or CodeGen that need to remove qualifiers. Addresses a
linking issue when building LLVM with Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:04:40 +00:00
Fariborz Jahanian
ff1278809e
More cleanup/refactoring of the rewrite.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:52:32 +00:00
Chris Lattner
0ad57fb93a
simplify my previous patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:33:41 +00:00
Chris Lattner
998eab1867
fix opencl extvector element extraction on rvalues. We previously
...
error_unsupported on test10 and crashed on test11.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:31:11 +00:00
Chris Lattner
917f143874
comment tweak
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:29:53 +00:00
Fariborz Jahanian
73e437bbe7
Some cleanup and refactoring of rewriter.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:18:41 +00:00
Ted Kremenek
bbfd68dd52
Tidy up ~ASTContext a bit by turning orphan compound statements into
...
for loops. Also do not manually free the Type objects when the
'FreeMemory' flag is set, as they will be deallocated when the
BumpPtrAllocator is destroyed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:13:52 +00:00
Douglas Gregor
765ccba920
Diagnose the use of incomplete types in C++ typeid expressions
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 21:06:06 +00:00
Ted Kremenek
520ad5f7bc
Rename test file.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 20:59:39 +00:00
Ted Kremenek
29b6f3869e
Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 20:58:27 +00:00
Douglas Gregor
f57f207a0f
Remove cv-qualifiers from the argument to typeid
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 20:51:04 +00:00
Fariborz Jahanian
d25d1b53f0
This patch concludes rewriteing of __block variables to allow
...
a small test case using Block_copy(...) API to pass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 20:32:38 +00:00
Anders Carlsson
9e85c743a4
Mangle template template parameters. Fixes PR5861.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 19:30:55 +00:00
Fariborz Jahanian
bbf37e232b
Removed a FIXME comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 19:26:34 +00:00