]> granicus.if.org Git - clang/log
clang
14 years agoTry to de-bork DISABLE_SMART_POINTERS build
Douglas Gregor [Fri, 18 Dec 2009 17:31:58 +0000 (17:31 +0000)]
Try to de-bork DISABLE_SMART_POINTERS build

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

14 years agoCK_UserDefinedConversion is a valid kind when doing copy ctor elision.
Anders Carlsson [Fri, 18 Dec 2009 17:29:21 +0000 (17:29 +0000)]
CK_UserDefinedConversion is a valid kind when doing copy ctor elision.

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

14 years agoMove the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
Torok Edwin [Fri, 18 Dec 2009 17:29:14 +0000 (17:29 +0000)]
Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.

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

14 years agoChange clang_codeComplete API to return the results in a structure on
Douglas Gregor [Fri, 18 Dec 2009 16:20:58 +0000 (16:20 +0000)]
Change clang_codeComplete API to return the results in a structure on
the heap, so that clients are not forced to copy the results during
the initial iteration. A separate clang_disposeCodeCompleteResults
function frees the returned results.

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

14 years agoChange the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
Ken Dyck [Fri, 18 Dec 2009 15:55:54 +0000 (15:55 +0000)]
Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing
quantities that are in bit and character units.

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

14 years agoRename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
Ken Dyck [Fri, 18 Dec 2009 15:24:05 +0000 (15:24 +0000)]
Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.

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

14 years agoFix regression I introduced when dynamic_cast-ing to a reference type.
Anders Carlsson [Fri, 18 Dec 2009 14:55:04 +0000 (14:55 +0000)]
Fix regression I introduced when dynamic_cast-ing to a reference type.

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

14 years agoIt's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.
Anders Carlsson [Fri, 18 Dec 2009 14:42:03 +0000 (14:42 +0000)]
It's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.

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

14 years agoTweaks for PS3 target.
John Thompson [Fri, 18 Dec 2009 14:21:08 +0000 (14:21 +0000)]
Tweaks for PS3 target.

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

14 years agoRemoving trailing directory separator, to make stat work
John Thompson [Fri, 18 Dec 2009 14:18:21 +0000 (14:18 +0000)]
Removing trailing directory separator, to make stat work

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

14 years agoInitial implementation of CharUnits, an opaque value class for representing
Ken Dyck [Fri, 18 Dec 2009 13:39:46 +0000 (13:39 +0000)]
Initial implementation of CharUnits, an opaque value class for representing
sizes, offsets, and alignments in character units.

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

14 years agoSet up the semantic context correctly when declaring a friend class template.
John McCall [Fri, 18 Dec 2009 11:25:59 +0000 (11:25 +0000)]
Set up the semantic context correctly when declaring a friend class template.

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

14 years agoLook through using decls when checking whether a name is an acceptable
John McCall [Fri, 18 Dec 2009 10:48:10 +0000 (10:48 +0000)]
Look through using decls when checking whether a name is an acceptable
nested-name specifier name.

I accidentally checked in the test case for this in the last commit ---
fortunately, that refactor was inspired by having debugged this problem already,
so I can fix the bug quick (though probably not fast enough for the buildbots).

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

14 years agoPull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
John McCall [Fri, 18 Dec 2009 10:40:03 +0000 (10:40 +0000)]
Pull Sema::isAcceptableLookupResult into SemaLookup.  Extract the criteria into
different functions and pick the function at lookup initialization time.
In theory we could actually divide the criteria functions into N different
functions for the N cases, but it's so not worth it.

Among other things, lets us invoke LookupQualifiedName without recomputing
IDNS info every time.

Do some refactoring in SemaDecl to avoid an awkward special case in LQN
that was only necessary for redeclaration testing for anonymous structs/unions ---
which could be done more efficiently with a scoped lookup anyway.

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

14 years agoclang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias...
Daniel Dunbar [Fri, 18 Dec 2009 06:30:12 +0000 (06:30 +0000)]
clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.

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

14 years agoAddress some of Anders comments
Douglas Gregor [Fri, 18 Dec 2009 05:19:44 +0000 (05:19 +0000)]
Address some of Anders comments

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

14 years agoSwitch the initialization required by return statements over to the
Douglas Gregor [Fri, 18 Dec 2009 05:02:21 +0000 (05:02 +0000)]
Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

  - InitializationSequence now has a "C conversion sequence" category
    and step kind, which falls back to
  - Changed the diagnostics for returns to always have the result type
    of the function first and the type of the expression second.
    CheckSingleAssignmentConstraints to peform checking in C.
  - Improved ASTs for initialization of return values. The ASTs now
    capture all of the temporaries we need to create, but
    intentionally do not bind the tempoary that is actually returned,
    so that it won't get destroyed twice.
  - Make sure to perform an (elidable!) copy of the class object that
    is returned from a class.
  - Fix copy elision in CodeGen to properly see through the
    subexpressions that occur with elidable copies.
  - Give "new" its own entity kind; as with return values and thrown
    objects, we don't bind the expression so we don't call a
    destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.

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

14 years agoAdd -dwarf-debug-flags, which provides a way to embed the cc1 level options used
Daniel Dunbar [Fri, 18 Dec 2009 02:43:17 +0000 (02:43 +0000)]
Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
 - Used by parts of Darwin build process to check compiler flags, etc.
 - <rdar://problem/7256886> clang does not emit AT_APPLE_flags

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

14 years agoHandle case when DestPtr is 0.
Mike Stump [Fri, 18 Dec 2009 02:14:27 +0000 (02:14 +0000)]
Handle case when DestPtr is 0.

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

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