]> granicus.if.org Git - clang/log
clang
14 years agoImplemented rewriting of invocation of a block ivar.
Fariborz Jahanian [Fri, 18 Dec 2009 01:15:21 +0000 (01:15 +0000)]
Implemented rewriting of invocation of a block ivar.
(radar 7482224).

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

14 years agoTemporarily XFAIL this test.
Eli Friedman [Fri, 18 Dec 2009 00:23:19 +0000 (00:23 +0000)]
Temporarily XFAIL this test.

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

14 years agoTestcase fixes to reflect instruction table changes in the LLVM backend
Sean Callanan [Fri, 18 Dec 2009 00:04:09 +0000 (00:04 +0000)]
Testcase fixes to reflect instruction table changes in the LLVM backend
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092780.html)
The instruction fixes were checked and approved by Chris Lattner, but
these testcase fixes are mine; please yell at me if there are any
problems with either.

* PR5050-constructor-conversion.cpp
* array-construction.cpp
* constructor-conversion.cpp
* cast-conversion.cpp
* constructor-default-arg.cpp
* derived-to-base-conv.cpp
* ptr-to-member-function.cpp
* call-arg-zero-temp.cpp
* default-destructor-synthesis.cpp
* global-array-destruction.cpp
* array-operator-delete-call.cpp
* decl-ref-init.cpp
* default-constructor-for-members.cpp
* convert-to-fptr.cpp
* constructor-for-array-members.cpp
* conversion-function.cpp
* objc-read-weak-byref.m
Fixed testcase to reflect call qualifier

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

14 years agoPatch over yet more problems with friend declarations which were provoking
John McCall [Thu, 17 Dec 2009 23:21:11 +0000 (23:21 +0000)]
Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax.  This proved remarkably easy to "fix" once
I settled on how I was going to approach it.

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

14 years agoreword the help text of fno_assume_sane_operator_new, following Chris suggestion
Nuno Lopes [Thu, 17 Dec 2009 22:37:33 +0000 (22:37 +0000)]
reword the help text of fno_assume_sane_operator_new, following Chris suggestion

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

14 years agoRevert r91073.
Mike Stump [Thu, 17 Dec 2009 22:14:41 +0000 (22:14 +0000)]
Revert r91073.

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

14 years agoAdd a couple more paths to the LLVM-Code-Syntax test
Douglas Gregor [Thu, 17 Dec 2009 21:51:02 +0000 (21:51 +0000)]
Add a couple more paths to the LLVM-Code-Syntax test

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

14 years agoTweak formatting and comments.
Ted Kremenek [Thu, 17 Dec 2009 20:10:17 +0000 (20:10 +0000)]
Tweak formatting and comments.

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

14 years agoConvert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evalu...
Ted Kremenek [Thu, 17 Dec 2009 20:06:29 +0000 (20:06 +0000)]
Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evaluate the arguments of a CallExpr.  This simplifies the logic and makes it easier to read.  (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)

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

14 years agoReduce nesting by using early exits. No functionality change.
Ted Kremenek [Thu, 17 Dec 2009 19:17:27 +0000 (19:17 +0000)]
Reduce nesting by using early exits.  No functionality change.

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

14 years agoimplement PR3962: diagnose more faulty cases of usage of the restrict qualifier....
Nuno Lopes [Thu, 17 Dec 2009 11:35:26 +0000 (11:35 +0000)]
implement PR3962: diagnose more faulty cases of usage of the restrict qualifier. this also removes a FIXME

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

14 years agorevert part of my last patch, and mark only the c++ global new operator as noalias...
Nuno Lopes [Thu, 17 Dec 2009 10:15:49 +0000 (10:15 +0000)]
revert part of my last patch, and mark only the c++ global new operator as noalias. the rest will be infered by llvm optz

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

14 years agodocument -fno-assume-sane-operator-new, per Chris request.
Nuno Lopes [Thu, 17 Dec 2009 10:00:52 +0000 (10:00 +0000)]
document -fno-assume-sane-operator-new, per Chris request.
please review for English grammar mistakes

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

14 years agoInclude <time.h> in order to use 'time_t'.
Chandler Carruth [Thu, 17 Dec 2009 09:27:29 +0000 (09:27 +0000)]
Include <time.h> in order to use 'time_t'.

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

14 years agoTest for errors during fread() inside c-index-test and handle them
Chandler Carruth [Thu, 17 Dec 2009 09:18:43 +0000 (09:18 +0000)]
Test for errors during fread() inside c-index-test and handle them
appropriately. This also silences some pedantic GCC warnings.

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

14 years agoSort switch statement. No functionality change.
Ted Kremenek [Thu, 17 Dec 2009 07:38:34 +0000 (07:38 +0000)]
Sort switch statement.  No functionality change.

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

14 years agoRename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a...
Anders Carlsson [Thu, 17 Dec 2009 07:09:17 +0000 (07:09 +0000)]
Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway.

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

14 years agoEnsure we run cleanups for CXXTemporaries on the exceptional edge. WIP.
Mike Stump [Thu, 17 Dec 2009 06:08:47 +0000 (06:08 +0000)]
Ensure we run cleanups for CXXTemporaries on the exceptional edge.  WIP.

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

14 years agoreimplement r90860, fixing a couple of problems:
Chris Lattner [Thu, 17 Dec 2009 05:29:40 +0000 (05:29 +0000)]
reimplement r90860, fixing a couple of problems:
1. Don't make a copy of LangOptions every time a lexer is created.
2. Don't make CharInfo global mutable state.
3. Fix the implementation to properly treat ^Z as EOF instead of as
   horizontal whitespace, which matches the semantic implemented by VC++.

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

14 years agoSimplify RTTIBuilder::finish.
Anders Carlsson [Thu, 17 Dec 2009 05:10:59 +0000 (05:10 +0000)]
Simplify RTTIBuilder::finish.

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

14 years agoMove the Info vector into the RTTIBuilder struct. No functionality change.
Anders Carlsson [Thu, 17 Dec 2009 05:06:03 +0000 (05:06 +0000)]
Move the Info vector into the RTTIBuilder struct. No functionality change.

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

14 years agoAttempt to fix rtti-layout.cpp on Linux.
Anders Carlsson [Thu, 17 Dec 2009 04:57:25 +0000 (04:57 +0000)]
Attempt to fix rtti-layout.cpp on Linux.

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

14 years agoAdd a (currently failing) RTTI layout test.
Anders Carlsson [Thu, 17 Dec 2009 04:41:05 +0000 (04:41 +0000)]
Add a (currently failing) RTTI layout test.

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

14 years agoAdd failing test case for C++ static analysis.
Ted Kremenek [Thu, 17 Dec 2009 01:44:13 +0000 (01:44 +0000)]
Add failing test case for C++ static analysis.

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

14 years agoFix check in GRExprEngine for the 'main' function to handle NULL IdentifierInfo*'s.
Ted Kremenek [Thu, 17 Dec 2009 01:20:43 +0000 (01:20 +0000)]
Fix check in GRExprEngine for the 'main' function to handle NULL IdentifierInfo*'s.

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

14 years agoDiagnose duplicate declaration of a property. Fixes
Fariborz Jahanian [Thu, 17 Dec 2009 00:49:09 +0000 (00:49 +0000)]
Diagnose duplicate declaration of a property. Fixes
PR5809

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

14 years agoFix for PR5801: codegen memcpy, memmove, memset directly to LLVM intrinsics.
Eli Friedman [Thu, 17 Dec 2009 00:14:28 +0000 (00:14 +0000)]
Fix for PR5801: codegen memcpy, memmove, memset directly to LLVM intrinsics.

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

14 years agoCompletely remove ObjCObjectRegion (tests pass this time).
Ted Kremenek [Wed, 16 Dec 2009 23:53:37 +0000 (23:53 +0000)]
Completely remove ObjCObjectRegion (tests pass this time).

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

14 years agoAllow pointer convesion of an objective-c pointer to
Fariborz Jahanian [Wed, 16 Dec 2009 23:13:33 +0000 (23:13 +0000)]
Allow pointer convesion of an objective-c pointer to
'void *' to mimic gcc's behavior. (fixes radar 7477351).

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

14 years agoFix test.
Eli Friedman [Wed, 16 Dec 2009 20:47:15 +0000 (20:47 +0000)]
Fix test.

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

14 years agoMake sure C-specific enum warning doesn't trigger in C++.
Eli Friedman [Wed, 16 Dec 2009 20:30:08 +0000 (20:30 +0000)]
Make sure C-specific enum warning doesn't trigger in C++.

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

14 years agoFix -fdollars-in-identifiers Clang translation.
Daniel Dunbar [Wed, 16 Dec 2009 20:10:18 +0000 (20:10 +0000)]
Fix -fdollars-in-identifiers Clang translation.

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

14 years agoCorrectly calcluate abstract-ness in the case where an implicitly declared
Eli Friedman [Wed, 16 Dec 2009 20:00:27 +0000 (20:00 +0000)]
Correctly calcluate abstract-ness in the case where an implicitly declared
method overrides a pure virtual method.

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

14 years agoTemporarily revert 91553.
Ted Kremenek [Wed, 16 Dec 2009 19:46:44 +0000 (19:46 +0000)]
Temporarily revert 91553.

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

14 years agoRemove use of ObjCObjectRegion from BasicStoreManager.
Ted Kremenek [Wed, 16 Dec 2009 19:42:23 +0000 (19:42 +0000)]
Remove use of ObjCObjectRegion from BasicStoreManager.

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

14 years agoFix test case to unbreak testing
Douglas Gregor [Wed, 16 Dec 2009 19:18:40 +0000 (19:18 +0000)]
Fix test case to unbreak testing

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

14 years agoWhen value-initializing a class with no user-defined constructors but
Douglas Gregor [Wed, 16 Dec 2009 18:50:27 +0000 (18:50 +0000)]
When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.

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

14 years agoCompute the right extension for preprocessed Objective-C++ files.
Ted Kremenek [Wed, 16 Dec 2009 18:32:41 +0000 (18:32 +0000)]
Compute the right extension for preprocessed Objective-C++ files.

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

14 years agoDiagnose property of reference type as unsupported
Fariborz Jahanian [Wed, 16 Dec 2009 18:03:30 +0000 (18:03 +0000)]
Diagnose property of reference type as unsupported
instead of crashing for now.

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

14 years agoBaby steps towards fixing PR5589. If a class needs a vtable pointer, add one.
Anders Carlsson [Wed, 16 Dec 2009 17:27:20 +0000 (17:27 +0000)]
Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one.

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

14 years agoadd some svn:ignore
Nuno Lopes [Wed, 16 Dec 2009 17:07:58 +0000 (17:07 +0000)]
add some svn:ignore

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

14 years agoimplement PR5654: add -fassume-sane-operator-new, which is enabled by default, and...
Nuno Lopes [Wed, 16 Dec 2009 16:59:22 +0000 (16:59 +0000)]
implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.

feel free to chage the name to this lengthy argument

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

14 years agoIn Sema::CheckInitializerTypes, replace a use of CheckReferenceInit with an Initializ...
Douglas Gregor [Wed, 16 Dec 2009 16:54:16 +0000 (16:54 +0000)]
In Sema::CheckInitializerTypes, replace a use of CheckReferenceInit with an InitializationSequence

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

14 years agoUpdate C++ status page to reflect reality
Douglas Gregor [Wed, 16 Dec 2009 16:23:48 +0000 (16:23 +0000)]
Update C++ status page to reflect reality

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

14 years agofix PR5689: add support for 'o' and 'V' asm input operands
Nuno Lopes [Wed, 16 Dec 2009 14:28:21 +0000 (14:28 +0000)]
fix PR5689: add support for 'o' and 'V' asm input operands

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

14 years agofix build
Nuno Lopes [Wed, 16 Dec 2009 14:20:08 +0000 (14:20 +0000)]
fix build

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

14 years agoShift things around so that it's easier to recover from a missing
John McCall [Wed, 16 Dec 2009 12:17:52 +0000 (12:17 +0000)]
Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.

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

14 years agoFix pretty stack traces.
Daniel Dunbar [Wed, 16 Dec 2009 11:47:38 +0000 (11:47 +0000)]
Fix pretty stack traces.

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

14 years agoAdd a new kind of region: CXXObjectRegion. Currently it has only one
Zhongxing Xu [Wed, 16 Dec 2009 11:27:52 +0000 (11:27 +0000)]
Add a new kind of region: CXXObjectRegion. Currently it has only one
attribute: the object type.
Add initial support for visiting CXXThisExpr.
Fix a bunch of 80-col violations.

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

14 years agoIntroduce a centralized routine in Sema for diagnosing failed lookups (when
John McCall [Wed, 16 Dec 2009 08:11:27 +0000 (08:11 +0000)]
Introduce a centralized routine in Sema for diagnosing failed lookups (when
used as expressions).  In dependent contexts, try to recover by doing a lookup
in previously-dependent base classes.  We get better diagnostics out, but
unfortunately the recovery fails:  we need to turn it into a method call
expression, not a bare call expression.  Thus this is still a WIP.

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

14 years agoUse GetAddrOfRTTI everywhere and remove GenerateRTTI and GenerateRTTIRef. With this...
Anders Carlsson [Wed, 16 Dec 2009 07:05:41 +0000 (07:05 +0000)]
Use GetAddrOfRTTI everywhere and remove GenerateRTTI and GenerateRTTIRef. With this change, we can now compile and link TableGen.

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

14 years agoHandle ImplicitValueInitExpr in AggExprEmitter.
Anders Carlsson [Wed, 16 Dec 2009 06:57:54 +0000 (06:57 +0000)]
Handle ImplicitValueInitExpr in AggExprEmitter.

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

14 years agoremove dead code.
Zhongxing Xu [Wed, 16 Dec 2009 06:39:03 +0000 (06:39 +0000)]
remove dead code.

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

14 years agoEliminate Sema::CheckValueInitialization; its callers now use
Douglas Gregor [Wed, 16 Dec 2009 06:35:08 +0000 (06:35 +0000)]
Eliminate Sema::CheckValueInitialization; its callers now use
InitializationSequence to perform the actual initialization.

Also, introduced the notion of a tree of initialized entities, so that
we can know where an initialization began when dealing with nested
initializations (as occur when performing list initialization). This
will, eventually, be useful for producing better diagnostics when list
initialization fails, because we can show the path from the top-level
object being initialized down to the actual subobject where
initialization failed.

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

14 years agoAdd abort() as a builtin. This has two effects: one, we warn for incorrect
Eli Friedman [Wed, 16 Dec 2009 06:28:21 +0000 (06:28 +0000)]
Add abort() as a builtin.  This has two effects: one, we warn for incorrect
declarations of abort(), and two, we mark it noreturn.  Missing the latter
shows up in one of the "embarassing" tests (from the thread on llvmdev
"detailed comparison of generated code size for LLVM and other compilers").

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

14 years agoMore FullExpr work.
Anders Carlsson [Wed, 16 Dec 2009 06:21:35 +0000 (06:21 +0000)]
More FullExpr work.

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

14 years agoMore work on the FullExpr class.
Anders Carlsson [Wed, 16 Dec 2009 06:10:22 +0000 (06:10 +0000)]
More work on the FullExpr class.

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

14 years agoTeach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier...
Ted Kremenek [Wed, 16 Dec 2009 06:06:43 +0000 (06:06 +0000)]
Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*.

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

14 years agoTeach OSAtomicChecker that a FunctionDecl's name isn't always a simple IdentifierInfo*.
Ted Kremenek [Wed, 16 Dec 2009 06:03:24 +0000 (06:03 +0000)]
Teach OSAtomicChecker that a FunctionDecl's name isn't always a simple IdentifierInfo*.

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

14 years agoTeach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed...
Ted Kremenek [Wed, 16 Dec 2009 05:58:28 +0000 (05:58 +0000)]
Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed to return a non-null IdentifierInfo*.

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

14 years agoTeach CheckerVisitor about CXXOperatorCallExpr.
Ted Kremenek [Wed, 16 Dec 2009 05:52:19 +0000 (05:52 +0000)]
Teach CheckerVisitor about CXXOperatorCallExpr.

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

14 years agoTeach CFRecStmtDeclVisitor about CXXMethodDecl.
Ted Kremenek [Wed, 16 Dec 2009 05:50:26 +0000 (05:50 +0000)]
Teach CFRecStmtDeclVisitor about CXXMethodDecl.

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

14 years agoMangle CXXOperatorCallExprs, fixes PR5796.
Anders Carlsson [Wed, 16 Dec 2009 05:48:46 +0000 (05:48 +0000)]
Mangle CXXOperatorCallExprs, fixes PR5796.

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

14 years agoExpose C++ methods to GRExprEngine.
Zhongxing Xu [Wed, 16 Dec 2009 05:29:59 +0000 (05:29 +0000)]
Expose C++ methods to GRExprEngine.

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

14 years agoAdd logic for computing preprocessor file extensions for C++ files.
Ted Kremenek [Wed, 16 Dec 2009 05:02:47 +0000 (05:02 +0000)]
Add logic for computing preprocessor file extensions for C++ files.

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

14 years agoMake GRSubEngine.h standalone
Douglas Gregor [Wed, 16 Dec 2009 03:49:50 +0000 (03:49 +0000)]
Make GRSubEngine.h standalone

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

14 years agoFix semantic diagnostics that embed English works, from Nicola Gigante!
Douglas Gregor [Wed, 16 Dec 2009 03:45:30 +0000 (03:45 +0000)]
Fix semantic diagnostics that embed English works, from Nicola Gigante!

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

14 years agoRefine a little. WIP.
Mike Stump [Wed, 16 Dec 2009 03:25:12 +0000 (03:25 +0000)]
Refine a little.  WIP.

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

14 years agoAdd (initial?) static analyzer support for handling C++ references.
Ted Kremenek [Wed, 16 Dec 2009 03:18:58 +0000 (03:18 +0000)]
Add (initial?) static analyzer support for handling C++ references.
This change was a lot bigger than I originally anticipated; among
other things it requires us storing more information in the CFG to
record what block-level expressions need to be evaluated as lvalues.

The big change is that CFGBlocks no longer contain Stmt*'s by
CFGElements.  Currently CFGElements just wrap Stmt*, but they also
store a bit indicating whether the block-level expression should be
evalauted as an lvalue.  DeclStmts involving the initialization of a
reference require us treating the initialization expression as an
lvalue, even though that information isn't recorded in the AST.
Conceptually this change isn't that complicated, but it required
bubbling up the data through the CFGBuilder, to GRCoreEngine, and
eventually to GRExprEngine.

The addition of CFGElement is also useful for when we want to handle
more control-flow constructs or other data we want to keep in the CFG
that isn't represented well with just a block of statements.

In GRExprEngine, this patch introduces logic for evaluating the
lvalues of references, which currently retrieves the internal "pointer
value" that the reference represents.  EvalLoad does a two stage load
to catch null dereferences involving an invalid reference (although
this could possibly be caught earlier during the initialization of a
reference).

Symbols are currently symbolicated using the reference type, instead
of a pointer type, and special handling is required creating
ElementRegions that layer on SymbolicRegions (see the changes to
RegionStoreManager).

Along the way, the DeadStoresChecker also silences warnings involving
dead stores to references.  This was the original change I introduced
(which I wrote test cases for) that I realized caused GRExprEngine to
crash.

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

14 years agoAdd some documentation for recent checkins. WIP.
Mike Stump [Wed, 16 Dec 2009 03:18:14 +0000 (03:18 +0000)]
Add some documentation for recent checkins.  WIP.

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

14 years agoAdd an addition check for undefined behavior for when we hit a
Mike Stump [Wed, 16 Dec 2009 03:07:12 +0000 (03:07 +0000)]
Add an addition check for undefined behavior for when we hit a
__builtin_unreachable.  WIP.

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

14 years agoImplement additional undefined checks for additional loads and stores. WIP.
Mike Stump [Wed, 16 Dec 2009 02:57:00 +0000 (02:57 +0000)]
Implement additional undefined checks for additional loads and stores.  WIP.

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

14 years agoCheck in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action...
Anders Carlsson [Wed, 16 Dec 2009 02:09:40 +0000 (02:09 +0000)]
Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.

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

14 years agoSuccessive anonymous namespaces name the same scope. I misinterpreted the
John McCall [Wed, 16 Dec 2009 02:06:49 +0000 (02:06 +0000)]
Successive anonymous namespaces name the same scope.  I misinterpreted the
standard the last time.  Fixes PR5766.

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

14 years agoSwitch the C++ new expression over to InitializationSequence, rather
Douglas Gregor [Wed, 16 Dec 2009 01:38:02 +0000 (01:38 +0000)]
Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.

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

14 years agoDiagnose attempting to assign to a sub-structure of an ivar
Fariborz Jahanian [Tue, 15 Dec 2009 23:59:41 +0000 (23:59 +0000)]
Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)

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

14 years agoRemove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra veneer...
Ted Kremenek [Tue, 15 Dec 2009 23:23:27 +0000 (23:23 +0000)]
Remove ValueManager::getRegionValueSymbolValOrUnknown().  It was just extra veneer on top of getRegionValueSymbolVal().

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

14 years agoLink up member-class redeclarations during template instantiation.
John McCall [Tue, 15 Dec 2009 22:29:06 +0000 (22:29 +0000)]
Link up member-class redeclarations during template instantiation.
This test courtesy of LLVM.

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

14 years agoUpdate tests to use %clang instead of 'clang', and forcibly disable use of '
Daniel Dunbar [Tue, 15 Dec 2009 22:01:24 +0000 (22:01 +0000)]
Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

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

14 years agoFixes a code gen bug related to accessing a now
Fariborz Jahanian [Tue, 15 Dec 2009 21:34:52 +0000 (21:34 +0000)]
Fixes a code gen bug related to accessing a now
non-existing 'isa' field of a non-existing struct type
all related to legacy type definition for 'id' which we have
dropped in clang in favor of a built-in type.
(fixes radar 7470820).

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

14 years agoShouldDestroyTemporaries? I don't think so.
Anders Carlsson [Tue, 15 Dec 2009 20:51:39 +0000 (20:51 +0000)]
ShouldDestroyTemporaries? I don't think so.

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

14 years agoenable reuse of MacroArgs objects. This is a small (2.5%) win
Chris Lattner [Tue, 15 Dec 2009 20:48:12 +0000 (20:48 +0000)]
enable reuse of MacroArgs objects.  This is a small (2.5%) win
on PR5610 (2.185 -> 2.130s).  The big issue is that this is making
insanely huge macro argument lists with over a million tokens in it.
The reason that mallco and free are so expensive is that we are
actually going to the kernel to get it, and switching to a bump
pointer allocator won't change this in an interesting way.

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

14 years agoUpdate tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
Daniel Dunbar [Tue, 15 Dec 2009 20:14:24 +0000 (20:14 +0000)]
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
 - This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

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

14 years agoIf a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlyin...
Anders Carlsson [Tue, 15 Dec 2009 19:16:31 +0000 (19:16 +0000)]
If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.

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

14 years agoSupport OpenCL 1.1 odd-length vector component accessors.
Nate Begeman [Tue, 15 Dec 2009 18:13:04 +0000 (18:13 +0000)]
Support OpenCL 1.1 odd-length vector component accessors.

For hi/odd of an odd-length vector, the last component is undefined.  Since
we shuffle with an undef vector, no CodeGen needs to change to support this.

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

14 years agoAdd testcase for recent checkin.
Mike Stump [Tue, 15 Dec 2009 18:02:45 +0000 (18:02 +0000)]
Add testcase for recent checkin.

Patch by Chip Davis.

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

14 years agoImplement conditional block invocation rewrite
Fariborz Jahanian [Tue, 15 Dec 2009 17:30:20 +0000 (17:30 +0000)]
Implement conditional block invocation rewrite
and some clean up and a block rewriter test.

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

14 years agoFix some diagnostic-related FIXMEs, from Nicola Gigante
Douglas Gregor [Tue, 15 Dec 2009 16:44:32 +0000 (16:44 +0000)]
Fix some diagnostic-related FIXMEs, from Nicola Gigante

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

14 years agoElaborated types are specifier types, based on a patch from Cornelius
Douglas Gregor [Tue, 15 Dec 2009 16:28:32 +0000 (16:28 +0000)]
Elaborated types are specifier types, based on a patch from Cornelius

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

14 years agoAdd comments.
Zhongxing Xu [Tue, 15 Dec 2009 09:32:42 +0000 (09:32 +0000)]
Add comments.

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

14 years agoRemove displayProgress parameter.
Zhongxing Xu [Tue, 15 Dec 2009 09:09:49 +0000 (09:09 +0000)]
Remove displayProgress parameter.

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

14 years agomove isPodLike<clang::QualType> out to Type.h. We don't
Chris Lattner [Tue, 15 Dec 2009 07:30:12 +0000 (07:30 +0000)]
move isPodLike<clang::QualType> out to Type.h.  We don't
want some clients of QualType to think it's a pod and some to
not know it is.

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

14 years agoupdate to match LLVM API change:
Chris Lattner [Tue, 15 Dec 2009 07:26:51 +0000 (07:26 +0000)]
update to match LLVM API change:

Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

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

14 years agoAdd -W[no-]variadic-macros support.
Daniel Dunbar [Tue, 15 Dec 2009 05:29:09 +0000 (05:29 +0000)]
Add -W[no-]variadic-macros support.

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

14 years agoForward -isysroot to clang -cc1.
Daniel Dunbar [Tue, 15 Dec 2009 04:55:58 +0000 (04:55 +0000)]
Forward -isysroot to clang -cc1.

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

14 years agoFix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),
Daniel Dunbar [Tue, 15 Dec 2009 04:24:24 +0000 (04:24 +0000)]
Fix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),
note_previous_decl was used where note_previous_declaration was intended. Better
names or PR5785 might be nice.

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

14 years agoUntil we can make the dead stores checker smarter, dont' emit dead store warnings...
Ted Kremenek [Tue, 15 Dec 2009 04:12:12 +0000 (04:12 +0000)]
Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).

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

14 years agoFix a small bug in ComputeMethodVtableIndices.
Eli Friedman [Tue, 15 Dec 2009 03:31:17 +0000 (03:31 +0000)]
Fix a small bug in ComputeMethodVtableIndices.

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

14 years agoReally fix this test.
Eli Friedman [Tue, 15 Dec 2009 03:22:41 +0000 (03:22 +0000)]
Really fix this test.

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

14 years agoThis patch should fix PR2461. It allows clang to apply the noreturn
Mike Stump [Tue, 15 Dec 2009 03:11:10 +0000 (03:11 +0000)]
This patch should fix PR2461. It allows clang to apply the noreturn
attribute to function pointers. It also fixes Sema to check function
pointers for the noreturn attribute when checking for fallthrough.

Patch by Chip Davis, with a slight fix to pass the testsuite.

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