]> granicus.if.org Git - clang/log
clang
14 years agoAdd StmtIterator support for iterating over both the condition
Ted Kremenek [Wed, 23 Dec 2009 23:38:34 +0000 (23:38 +0000)]
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

14 years agoTidy up FindSubExprAssignments to not deference the child_iterator multiple times.
Ted Kremenek [Wed, 23 Dec 2009 23:37:10 +0000 (23:37 +0000)]
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

14 years agoWhen we see a CXXDefaultArgExpr during template instantiation, rebuild
Douglas Gregor [Wed, 23 Dec 2009 23:03:06 +0000 (23:03 +0000)]
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

14 years agoFix regression found by g++.dg/eh/alias1.C.
Mike Stump [Wed, 23 Dec 2009 22:48:20 +0000 (22:48 +0000)]
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

14 years agoIncrease StmtIterator size by one pointer (separating out the Stmt** from the union...
Ted Kremenek [Wed, 23 Dec 2009 22:31:49 +0000 (22:31 +0000)]
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

14 years agoMangle block pointer types. Fixes PR5858.
Anders Carlsson [Wed, 23 Dec 2009 22:31:44 +0000 (22:31 +0000)]
Mangle block pointer types. Fixes PR5858.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92069 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix typo
Chris Lattner [Wed, 23 Dec 2009 22:06:12 +0000 (22:06 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92065 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThere is no such thing as typeinfo for a cv-qualified type. Assert
Douglas Gregor [Wed, 23 Dec 2009 22:04:40 +0000 (22:04 +0000)]
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

14 years agoMore cleanup/refactoring of the rewrite.
Fariborz Jahanian [Wed, 23 Dec 2009 21:52:32 +0000 (21:52 +0000)]
More cleanup/refactoring of the rewrite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92062 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify my previous patch.
Chris Lattner [Wed, 23 Dec 2009 21:33:41 +0000 (21:33 +0000)]
simplify my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92057 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix opencl extvector element extraction on rvalues. We previously
Chris Lattner [Wed, 23 Dec 2009 21:31:11 +0000 (21:31 +0000)]
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

14 years agocomment tweak
Chris Lattner [Wed, 23 Dec 2009 21:29:53 +0000 (21:29 +0000)]
comment tweak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92055 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSome cleanup and refactoring of rewriter.
Fariborz Jahanian [Wed, 23 Dec 2009 21:18:41 +0000 (21:18 +0000)]
Some cleanup and refactoring of rewriter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92049 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTidy up ~ASTContext a bit by turning orphan compound statements into
Ted Kremenek [Wed, 23 Dec 2009 21:13:52 +0000 (21:13 +0000)]
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

14 years agoDiagnose the use of incomplete types in C++ typeid expressions
Douglas Gregor [Wed, 23 Dec 2009 21:06:06 +0000 (21:06 +0000)]
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

14 years agoRename test file.
Ted Kremenek [Wed, 23 Dec 2009 20:59:39 +0000 (20:59 +0000)]
Rename test file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92044 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange test case to use 'clang -cc1' (without --disable-free) instead of c-index...
Ted Kremenek [Wed, 23 Dec 2009 20:58:27 +0000 (20:58 +0000)]
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

14 years agoRemove cv-qualifiers from the argument to typeid
Douglas Gregor [Wed, 23 Dec 2009 20:51:04 +0000 (20:51 +0000)]
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

14 years agoThis patch concludes rewriteing of __block variables to allow
Fariborz Jahanian [Wed, 23 Dec 2009 20:32:38 +0000 (20:32 +0000)]
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

14 years agoMangle template template parameters. Fixes PR5861.
Anders Carlsson [Wed, 23 Dec 2009 19:30:55 +0000 (19:30 +0000)]
Mangle template template parameters. Fixes PR5861.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92030 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemoved a FIXME comment.
Fariborz Jahanian [Wed, 23 Dec 2009 19:26:34 +0000 (19:26 +0000)]
Removed a FIXME comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92028 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore rewriting of __block variables.
Fariborz Jahanian [Wed, 23 Dec 2009 19:22:33 +0000 (19:22 +0000)]
More rewriting of __block variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92027 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix the microsoft "charify" extension to return the charified token
Chris Lattner [Wed, 23 Dec 2009 19:15:27 +0000 (19:15 +0000)]
fix the microsoft "charify" extension to return the charified token
as a character literal, not a string literal.  This might fix
rdar://7486575

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92025 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdate comments
Chris Lattner [Wed, 23 Dec 2009 19:08:19 +0000 (19:08 +0000)]
update comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92022 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch -Werror/-Wfatal-errors error conditions to use diagnostics instead
Chris Lattner [Wed, 23 Dec 2009 18:53:37 +0000 (18:53 +0000)]
switch -Werror/-Wfatal-errors error conditions to use diagnostics instead
of printf, patch by Christian Adaker!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92019 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the overflow calculation in Sema::CheckTemplateArgument to be a bit more
Eli Friedman [Wed, 23 Dec 2009 18:44:58 +0000 (18:44 +0000)]
Fix the overflow calculation in Sema::CheckTemplateArgument to be a bit more
accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92018 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen using a default function argument for a function template (or
Douglas Gregor [Wed, 23 Dec 2009 18:19:08 +0000 (18:19 +0000)]
When using a default function argument for a function template (or
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
  (1) We get different CXXTemporary objects for each instantiation, and
  (2) Any other instantiations or definitions triggered by the
  instantiation of the default argument expression are guaranteed to
  happen; previously, they might have been suppressed, e.g., because
  they happened in an unevaluated context.

This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove RewriteBlocks. It has been superseded by RewriteObjC
Kovarththanan Rajaratnam [Wed, 23 Dec 2009 18:03:34 +0000 (18:03 +0000)]
Remove RewriteBlocks. It has been superseded by RewriteObjC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92014 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove a few more symbols to .rodata/.data.rel.ro
Nuno Lopes [Wed, 23 Dec 2009 17:49:57 +0000 (17:49 +0000)]
move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't commit my silly little local changes
Douglas Gregor [Wed, 23 Dec 2009 17:43:32 +0000 (17:43 +0000)]
Don't commit my silly little local changes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92010 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't disable smart pointers, silly
Douglas Gregor [Wed, 23 Dec 2009 17:42:06 +0000 (17:42 +0000)]
Don't disable smart pointers, silly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92009 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix DISABLE_SMART_POINTERS build
Douglas Gregor [Wed, 23 Dec 2009 17:40:29 +0000 (17:40 +0000)]
Fix DISABLE_SMART_POINTERS build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for handling initializers in RewriteObjC::RewriteByRefVar().
Steve Naroff [Wed, 23 Dec 2009 17:24:33 +0000 (17:24 +0000)]
Add support for handling initializers in RewriteObjC::RewriteByRefVar().

As the FIXME indicates, RewriteByRefVar() won't work for multiple declarators (in general). I've discussed this with Fariborz and he is aware of the limitation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRegister call inliner as the last checker.
Zhongxing Xu [Wed, 23 Dec 2009 09:15:19 +0000 (09:15 +0000)]
Register call inliner as the last checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91992 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMigrate the call inliner to the Checker interface.
Zhongxing Xu [Wed, 23 Dec 2009 08:56:18 +0000 (08:56 +0000)]
Migrate the call inliner to the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91991 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child expressions...
Ted Kremenek [Wed, 23 Dec 2009 08:56:00 +0000 (08:56 +0000)]
Add 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child expressions (via StmtIterator), as those expressions are owned by the Decls and Types (which are destroyed elsewhere).  This fixes a crasher reported in <rdar://problem/7487294>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91990 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor inter-procedural analysis, predecessor node may be in another function.
Zhongxing Xu [Wed, 23 Dec 2009 08:54:57 +0000 (08:54 +0000)]
For inter-procedural analysis, predecessor node may be in another function.
So we should use the current program point.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91989 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CFG support for the condition variable that can appear in IfStmts in C++ mode.
Ted Kremenek [Wed, 23 Dec 2009 04:49:01 +0000 (04:49 +0000)]
Add CFG support for the condition variable that can appear in IfStmts in C++ mode.
Add transfer function support in GRExprEngine for IfStmts with initialized condition variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91987 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSuppress dead store warnings involving objects initialized with CXXExprTemporaries.
Ted Kremenek [Wed, 23 Dec 2009 04:11:44 +0000 (04:11 +0000)]
Suppress dead store warnings involving objects initialized with CXXExprTemporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91986 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd stack trace pretty printing in GRExprEngine::VisitLValue().
Ted Kremenek [Wed, 23 Dec 2009 04:09:43 +0000 (04:09 +0000)]
Add stack trace pretty printing in GRExprEngine::VisitLValue().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91985 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix CXXConstructExpr::getSourceRange() to not include the source ranges of CXXDefault...
Ted Kremenek [Wed, 23 Dec 2009 04:00:48 +0000 (04:00 +0000)]
Fix CXXConstructExpr::getSourceRange() to not include the source ranges of CXXDefaultArgExprs when computing its range (since these expressions have no source range, and using them will make the encompassing range invalid).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91984 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate for the intrinsic changes in llvm: the object size intrinsic
Eric Christopher [Wed, 23 Dec 2009 03:49:37 +0000 (03:49 +0000)]
Update for the intrinsic changes in llvm: the object size intrinsic
only takes a boolean second argument now. Update tests accordingly.
Currently the builtin still accepts the full range for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91983 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).
Ted Kremenek [Wed, 23 Dec 2009 03:14:23 +0000 (03:14 +0000)]
Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91982 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR 5857. When casting from a symbolic region to an integer back to a pointer...
Ted Kremenek [Wed, 23 Dec 2009 02:52:14 +0000 (02:52 +0000)]
Fix PR 5857.  When casting from a symbolic region to an integer back to a pointer value, we were not correctly layering the correct ElementRegion on the original SymbolicRegion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91981 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove CharUnits::toString() to eliminate dependence on <string>.
Ken Dyck [Wed, 23 Dec 2009 02:44:11 +0000 (02:44 +0000)]
Remove CharUnits::toString() to eliminate dependence on <string>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91978 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPatch to do more rewrite of __block variables.
Fariborz Jahanian [Wed, 23 Dec 2009 02:07:37 +0000 (02:07 +0000)]
Patch to do more rewrite of __block variables.
Still WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91977 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate a completely unnecessary buffer copy when parsing float literals.
John McCall [Wed, 23 Dec 2009 01:37:10 +0000 (01:37 +0000)]
Eliminate a completely unnecessary buffer copy when parsing float literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91974 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.
Ted Kremenek [Wed, 23 Dec 2009 01:25:13 +0000 (01:25 +0000)]
Teach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91970 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlso treat the type of the subexpression as a pointer in GRExprEngine::VisitCast...
Ted Kremenek [Wed, 23 Dec 2009 01:19:20 +0000 (01:19 +0000)]
Also treat the type of the subexpression as a pointer in GRExprEngine::VisitCast when the expression is handled as an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91969 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd assertion to check for valid source ranges.
Ted Kremenek [Wed, 23 Dec 2009 01:09:59 +0000 (01:09 +0000)]
Add assertion to check for valid source ranges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91966 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case for PR5134.
John McCall [Wed, 23 Dec 2009 01:09:14 +0000 (01:09 +0000)]
Test case for PR5134.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91965 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Fix '... -O4 -O0 ...', which was generating bitcode.
Daniel Dunbar [Wed, 23 Dec 2009 00:47:42 +0000 (00:47 +0000)]
Driver: Fix '... -O4 -O0 ...', which was generating bitcode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91962 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Drop ToolChain::getHost()
Daniel Dunbar [Wed, 23 Dec 2009 00:46:38 +0000 (00:46 +0000)]
Driver: Drop ToolChain::getHost()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91960 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case from PR5476.
John McCall [Wed, 23 Dec 2009 00:44:38 +0000 (00:44 +0000)]
Test case from PR5476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91957 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSet a member's access specifier even if it doesn't match the previous specifier.
John McCall [Wed, 23 Dec 2009 00:37:40 +0000 (00:37 +0000)]
Set a member's access specifier even if it doesn't match the previous specifier.
Prevents an assert on successive redeclarations.

Fixed PR5573.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91956 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd basic support for analyzing CastExprs as lvalues.
Ted Kremenek [Wed, 23 Dec 2009 00:26:16 +0000 (00:26 +0000)]
Add basic support for analyzing CastExprs as lvalues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91952 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoObjective-C methods can be variadic, too. Who knew.
Douglas Gregor [Wed, 23 Dec 2009 00:21:46 +0000 (00:21 +0000)]
Objective-C methods can be variadic, too. Who knew.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91951 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch Sema::CreateOverloadedUnaryOp over to InitializationSequence.
Douglas Gregor [Wed, 23 Dec 2009 00:02:00 +0000 (00:02 +0000)]
Switch Sema::CreateOverloadedUnaryOp over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91948 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoset svn:ignore
Nuno Lopes [Wed, 23 Dec 2009 00:01:08 +0000 (00:01 +0000)]
set svn:ignore

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91947 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agowarn when attribute warn_unused_result is applied to void functions.
Nuno Lopes [Tue, 22 Dec 2009 23:59:52 +0000 (23:59 +0000)]
warn when attribute warn_unused_result is applied to void functions.
while at it, remove an outdated FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91946 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllow the first parameter of operator new to be a cv-qualified
Douglas Gregor [Tue, 22 Dec 2009 23:42:49 +0000 (23:42 +0000)]
Allow the first parameter of operator new to be a cv-qualified
size_t. Also, fix an issue with initialization of parameters in calls,
where we weren't removing the cv-qualifiers on the parameter type
itself. Fixes PR5823.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91941 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: When linking, don't warn about unused arguments which are obviously only
Daniel Dunbar [Tue, 22 Dec 2009 23:19:32 +0000 (23:19 +0000)]
Driver: When linking, don't warn about unused arguments which are obviously only
used during compilation.
 - There is no easy way to define this group properly, unfortunately, and maybe
   this is a losing strategy. For now this is unambiguous more friendly, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91940 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement -W[no-]fatal-errors, patch by Christian Adåker!
Chris Lattner [Tue, 22 Dec 2009 23:12:53 +0000 (23:12 +0000)]
implement -W[no-]fatal-errors, patch by Christian Adåker!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd c++-analyzer symlink (which is used by scan-build)
Ted Kremenek [Tue, 22 Dec 2009 23:00:32 +0000 (23:00 +0000)]
Add c++-analyzer symlink (which is used by scan-build)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91937 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure that reinterpret_cast gets a CastKind on all successful
Douglas Gregor [Tue, 22 Dec 2009 22:47:22 +0000 (22:47 +0000)]
Make sure that reinterpret_cast gets a CastKind on all successful
paths. Fixes "cannot compile this unexpected cast lvalue yet" error in
llvm/lib/Analysis/IPA/GlobalsModRef.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91932 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert accidental commit
Douglas Gregor [Tue, 22 Dec 2009 22:30:51 +0000 (22:30 +0000)]
Revert accidental commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91930 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoaccept -Wcomments as an alias for -Wcomment, PR5855
Chris Lattner [Tue, 22 Dec 2009 22:29:12 +0000 (22:29 +0000)]
accept -Wcomments as an alias for -Wcomment, PR5855

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91929 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd using shadow decls to the "instantiated locals" map, fixing PR5847.
John McCall [Tue, 22 Dec 2009 22:26:37 +0000 (22:26 +0000)]
Add using shadow decls to the "instantiated locals" map, fixing PR5847.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91928 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence
Douglas Gregor [Tue, 22 Dec 2009 22:17:25 +0000 (22:17 +0000)]
Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91927 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd transfer functions support for visiting an Objective-C message expression as...
Ted Kremenek [Tue, 22 Dec 2009 22:13:46 +0000 (22:13 +0000)]
Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91926 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM: Remove a FIXME, it's not actually more complicated than that.
Daniel Dunbar [Tue, 22 Dec 2009 21:59:17 +0000 (21:59 +0000)]
ARM: Remove a FIXME, it's not actually more complicated than that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91924 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch parameter passing for overloaded binary operators to
Douglas Gregor [Tue, 22 Dec 2009 21:44:34 +0000 (21:44 +0000)]
Switch parameter passing for overloaded binary operators to
InitializationSequence. Fixes the -fsyntax-only failure in
llvm/lib/Transforms/Scalar/InstructionCombining.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91921 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSerialize the NoReturn bit on FunctionTypes for precompiled headers
Douglas Gregor [Tue, 22 Dec 2009 18:11:50 +0000 (18:11 +0000)]
Serialize the NoReturn bit on FunctionTypes for precompiled headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91911 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnter the scope of an initializer for direct-initialization as well as
Douglas Gregor [Tue, 22 Dec 2009 17:47:17 +0000 (17:47 +0000)]
Enter the scope of an initializer for direct-initialization as well as
for copy-initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91909 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen transforming a C++ "new" expression that was not explicitly given
Douglas Gregor [Tue, 22 Dec 2009 17:13:37 +0000 (17:13 +0000)]
When transforming a C++ "new" expression that was not explicitly given
a size, check whether the transformed type is itself an array type. If
so, take the major array bound as the size to allocate. Fixes PR5833.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91907 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch parameter-passing for calls via function pointers (where we
Douglas Gregor [Tue, 22 Dec 2009 16:09:06 +0000 (16:09 +0000)]
Switch parameter-passing for calls via function pointers (where we
don't have a FunctionDecl) over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91906 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch InitializedEntity from TypeLoc down to just QualTypes, since we don't use...
Douglas Gregor [Tue, 22 Dec 2009 15:35:07 +0000 (15:35 +0000)]
Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91905 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
Ken Dyck [Tue, 22 Dec 2009 14:23:30 +0000 (14:23 +0000)]
Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
avoid #including CharUnits.h in ASTContext.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91903 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch initialization of parameters in a call over to
Douglas Gregor [Tue, 22 Dec 2009 07:24:36 +0000 (07:24 +0000)]
Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

  - Make sure to use the adjusted parameter type for initialization of
  function parameters.
  - Implement transparent union calling semantics in C

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91902 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure that we mangle overloaded operators that are member functions correctly...
Anders Carlsson [Tue, 22 Dec 2009 06:36:32 +0000 (06:36 +0000)]
Make sure that we mangle overloaded operators that are member functions correctly, giving them the correct arity.

With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91893 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWork around PR5514.
Anders Carlsson [Tue, 22 Dec 2009 06:13:42 +0000 (06:13 +0000)]
Work around PR5514.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
Chris Lattner [Tue, 22 Dec 2009 06:00:13 +0000 (06:00 +0000)]
fix a bug handling the gnu ?: extension.  Patch by Storlek on IRC,
who prefers to be stealthy and mysterious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91888 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen we simply return a retained member expression when instantiating, we must also...
Anders Carlsson [Tue, 22 Dec 2009 05:24:09 +0000 (05:24 +0000)]
When we simply return a retained member expression when instantiating, we must also mark the member decl as referenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91887 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoZap CheckInitializerTypes.
Eli Friedman [Tue, 22 Dec 2009 02:50:30 +0000 (02:50 +0000)]
Zap CheckInitializerTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91884 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch default arguments over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:46:13 +0000 (02:46 +0000)]
Switch default arguments over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91883 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch compound literals over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:35:53 +0000 (02:35 +0000)]
Switch compound literals over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91882 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch file-scope assignment initialization over to InitializationSequence.
Eli Friedman [Tue, 22 Dec 2009 02:10:53 +0000 (02:10 +0000)]
Switch file-scope assignment initialization over to InitializationSequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agox86_64: Structures with no fields but which have padding should be classified as
Daniel Dunbar [Tue, 22 Dec 2009 01:19:25 +0000 (01:19 +0000)]
x86_64: Structures with no fields but which have padding should be classified as
integer.
 - This is consistent, but may not be correct. I will revisit x86_64 ABI handling for C++ as a whole at some point.
 - PR5831.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91874 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCentralize the emission/suppression/delay of diagnostics describing runtime before...
Douglas Gregor [Tue, 22 Dec 2009 01:01:55 +0000 (01:01 +0000)]
Centralize the emission/suppression/delay of diagnostics describing runtime before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91870 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStop diagnosing the use of inner classes as friends. ddunbar asked whether
John McCall [Tue, 22 Dec 2009 00:59:39 +0000 (00:59 +0000)]
Stop diagnosing the use of inner classes as friends.  ddunbar asked whether
this was useful, and on review Doug and I decided it was probably on the level
of a bug in the standard and therefore not worth a warning even in -pedantic.
If someone disagrees and urgently wants clang++ to warn about this in strict
c++98 mode, we can talk about it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91868 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTemplate code for rewrite of __block variables - wip.
Fariborz Jahanian [Tue, 22 Dec 2009 00:48:54 +0000 (00:48 +0000)]
Template code for rewrite of __block variables - wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since...
Douglas Gregor [Tue, 22 Dec 2009 00:34:07 +0000 (00:34 +0000)]
Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen converting from a type to itself or one of its base classes via a
Douglas Gregor [Tue, 22 Dec 2009 00:21:20 +0000 (00:21 +0000)]
When converting from a type to itself or one of its base classes via a
constructor call, the conversion is only a standard conversion
sequence if that constructor is a copy constructor. This fixes PR5834
in a semi-lame way, because the "real" fix will be to move over to
InitializationSequence. That will happen "soonish", but not now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91861 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen filling in value initializations within an initializer list, be
Douglas Gregor [Tue, 22 Dec 2009 00:05:34 +0000 (00:05 +0000)]
When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProviding support for rewriting of block copy/dispose of
Fariborz Jahanian [Mon, 21 Dec 2009 23:31:42 +0000 (23:31 +0000)]
Providing support for rewriting of block copy/dispose of
imported block variables. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91856 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
Daniel Dunbar [Mon, 21 Dec 2009 23:28:17 +0000 (23:28 +0000)]
ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
 - Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove updating of test/Makefile for out-of-dir builds.
Daniel Dunbar [Mon, 21 Dec 2009 23:28:06 +0000 (23:28 +0000)]
Improve updating of test/Makefile for out-of-dir builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91854 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen a template-id refers to a single function template, and the
Douglas Gregor [Mon, 21 Dec 2009 23:17:24 +0000 (23:17 +0000)]
When a template-id refers to a single function template, and the
explicitly-specified template arguments are enough to determine the
instantiation, and either template argument deduction fails or is not
performed in that context, we can resolve the template-id down to a
function template specialization (so sayeth C++0x
[temp.arg.explicit]p3). Fixes PR5811.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce an assertion to ensure that template argument deduction does
Douglas Gregor [Mon, 21 Dec 2009 21:27:38 +0000 (21:27 +0000)]
Introduce an assertion to ensure that template argument deduction does
not deduce an "overload" type. Such a deduction indicates a failure in
semantic analysis  (e.g., PR5811) that currently isn't caught until
code-generation time. This assertions makes it clearer that this
particular issue is a semantic-analysis problem, not a code-gen problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91844 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove on my previous fix for debug information. Rather than
Douglas Gregor [Mon, 21 Dec 2009 20:18:30 +0000 (20:18 +0000)]
Improve on my previous fix for debug information. Rather than
recursing in CGDebugInfo::CreateTypeNode, teach
CanonicalizeTypeForDebugInfo---now called UnwrapTypeForDebugInfo---to
keep unwrapping the type until we hit something that can be
represented by debug information. Thanks to Anders for pointing this out!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91840 91177308-0d34-0410-b5e6-96231b3b80d8