]> granicus.if.org Git - clang/log
clang
14 years agoA CXXExprWithTemporaries expression is an lvalue if its subexpression
Douglas Gregor [Sat, 19 Dec 2009 07:07:47 +0000 (07:07 +0000)]
A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.

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

14 years agoFix tyop.
Anders Carlsson [Sat, 19 Dec 2009 06:37:03 +0000 (06:37 +0000)]
Fix tyop.

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

14 years agoSome small Builtins.def improvements.
Eli Friedman [Sat, 19 Dec 2009 05:23:20 +0000 (05:23 +0000)]
Some small Builtins.def improvements.

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

14 years agoARM: Use front-end specific target features "soft-float" and "soft-float-abi" to...
Daniel Dunbar [Sat, 19 Dec 2009 04:15:38 +0000 (04:15 +0000)]
ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.

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

14 years agoTargets: Allow CreateTargetInfo to mutate the target features.
Daniel Dunbar [Sat, 19 Dec 2009 03:30:57 +0000 (03:30 +0000)]
Targets: Allow CreateTargetInfo to mutate the target features.
 - In particular, it can claim features for itself instead of always passing them on to LLVM.
 - This allows using the target features as a generic mechanism for passing target specific options to the TargetInfo instance, which may need them for initializing preprocessor defines, etc.

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

14 years agoUse the FunctionDecl's result type to know exactly if it returns a reference.
Zhongxing Xu [Sat, 19 Dec 2009 03:17:55 +0000 (03:17 +0000)]
Use the FunctionDecl's result type to know exactly if it returns a reference.

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

14 years agoSwitch more of Sema::CheckInitializerTypes over to
Douglas Gregor [Sat, 19 Dec 2009 03:01:41 +0000 (03:01 +0000)]
Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization).

Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.

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

14 years agoCorrectly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.
Anders Carlsson [Sat, 19 Dec 2009 02:13:41 +0000 (02:13 +0000)]
Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.

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

14 years agoUnresolved implicit member accesses are dependent if the object type is dependent.
John McCall [Sat, 19 Dec 2009 02:05:44 +0000 (02:05 +0000)]
Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution.  In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.

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

14 years agoAdd f80 entry for windows targets
Anton Korobeynikov [Sat, 19 Dec 2009 02:05:07 +0000 (02:05 +0000)]
Add f80 entry for windows targets

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

14 years agoUse proper alignment for i16/i32 on msp430. This fixes PR5815.
Anton Korobeynikov [Sat, 19 Dec 2009 01:32:37 +0000 (01:32 +0000)]
Use proper alignment for i16/i32 on msp430. This fixes PR5815.

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

14 years agoeliminate a call to NextToken() when parsing ::foo
Chris Lattner [Sat, 19 Dec 2009 01:11:05 +0000 (01:11 +0000)]
eliminate a call to NextToken() when parsing ::foo

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

14 years ago<string> already comes in from CharUnits.h
Chris Lattner [Sat, 19 Dec 2009 01:08:23 +0000 (01:08 +0000)]
<string> already comes in from CharUnits.h

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

14 years agoTeach TryAnnotateTypeOrScopeToken to deal with already-annotated
John McCall [Sat, 19 Dec 2009 00:35:18 +0000 (00:35 +0000)]
Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers.  Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.

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

14 years agoFix for PR5524: make reference binding in default argument work correctly.
Eli Friedman [Sat, 19 Dec 2009 00:20:10 +0000 (00:20 +0000)]
Fix for PR5524: make reference binding in default argument work correctly.

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

14 years agoWork in progress for setting the vtable pointers for all bases correctly in
Eli Friedman [Fri, 18 Dec 2009 23:47:41 +0000 (23:47 +0000)]
Work in progress for setting the vtable pointers for all bases correctly in
the constructor.  This doesn't handle cases requiring the VTT at the moment,
and generates unnecessary stores, but I think it's essentially correct.

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

14 years agoTest for r91724.
Eli Friedman [Fri, 18 Dec 2009 23:42:55 +0000 (23:42 +0000)]
Test for r91724.

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

14 years agoCleanup switch so it doesn't have a default case.
Eli Friedman [Fri, 18 Dec 2009 23:28:34 +0000 (23:28 +0000)]
Cleanup switch so it doesn't have a default case.

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

14 years agoFix for PR5830: fix the computation of the offset to a virtual base.
Eli Friedman [Fri, 18 Dec 2009 23:27:44 +0000 (23:27 +0000)]
Fix for PR5830: fix the computation of the offset to a virtual base.

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

14 years agoAdd and tidy doxygen comments and move implementation of toString() to newly
Ken Dyck [Fri, 18 Dec 2009 21:51:03 +0000 (21:51 +0000)]
Add and tidy doxygen comments and move implementation of toString() to newly
created CharUnits.cpp.

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

14 years agoC++Tests: Add target paths for LLVM-Code-Compile checks as well.
Daniel Dunbar [Fri, 18 Dec 2009 21:27:23 +0000 (21:27 +0000)]
C++Tests: Add target paths for LLVM-Code-Compile checks as well.

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

14 years agoFix a few MSVC warnings.
Daniel Dunbar [Fri, 18 Dec 2009 20:58:47 +0000 (20:58 +0000)]
Fix a few MSVC warnings.

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

14 years agoEnhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. Uncovered...
Ted Kremenek [Fri, 18 Dec 2009 20:13:39 +0000 (20:13 +0000)]
Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context.  Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.

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

14 years agoUse System/DataTypes.h, stdint.h isn't portable.
Daniel Dunbar [Fri, 18 Dec 2009 20:00:49 +0000 (20:00 +0000)]
Use System/DataTypes.h, stdint.h isn't portable.

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

14 years agoARM: Define __thumb2__ for V6T2 targets and only define
Daniel Dunbar [Fri, 18 Dec 2009 19:57:13 +0000 (19:57 +0000)]
ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

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

14 years agoExtend code-completion results with the type of each result
Douglas Gregor [Fri, 18 Dec 2009 18:53:37 +0000 (18:53 +0000)]
Extend code-completion results with the type of each result

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

14 years agoARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
Daniel Dunbar [Fri, 18 Dec 2009 18:42:37 +0000 (18:42 +0000)]
ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
 - This should be done leveraging the backend, but I'm a little refactored
   out. I'll fix it one day, I promise.

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

14 years agoWhen diagnosing that a decl ref expr is not a value, note the declaration
John McCall [Fri, 18 Dec 2009 18:35:10 +0000 (18:35 +0000)]
When diagnosing that a decl ref expr is not a value, note the declaration
with "declared at" rather than "previous declaration is here".

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

14 years agoDebian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.
Torok Edwin [Fri, 18 Dec 2009 17:43:54 +0000 (17:43 +0000)]
Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.

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

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