]> granicus.if.org Git - clang/log
clang
15 years agoCheck the interactions between explicit instantiations and template
Douglas Gregor [Thu, 15 Oct 2009 15:54:05 +0000 (15:54 +0000)]
Check the interactions between explicit instantiations and template
specializations. Work in progress; there's more cleanup required to
actually use the new CheckSpecializationInstantiationRedecl checker
uniformly.

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

15 years agoSorry! Accidentally checked in experimental change.
John Thompson [Thu, 15 Oct 2009 14:34:41 +0000 (14:34 +0000)]
Sorry!  Accidentally checked in experimental change.

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

15 years agoDiagnose explicit instantiations of function templates and member
Douglas Gregor [Thu, 15 Oct 2009 14:05:49 +0000 (14:05 +0000)]
Diagnose explicit instantiations of function templates and member
functions/static data members of class template specializations that
do not have definitions. This is the latter part of [temp.explicit]p4;
the former part still needs more testing.

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

15 years agoMore explicit template instantiation. Now we're checking for more
Douglas Gregor [Thu, 15 Oct 2009 12:53:22 +0000 (12:53 +0000)]
More explicit template instantiation. Now we're checking for more
cases where an explicit instantiation requires a definition; the
remainder of these checks will come with the implementation of
paragraph 4 of [temp.explicit].

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

15 years agoRefine non-virtual part of the this adjustment for thunks. Refine
Mike Stump [Thu, 15 Oct 2009 09:30:16 +0000 (09:30 +0000)]
Refine non-virtual part of the this adjustment for thunks.  Refine
non-virtual part of the return result adjustments for covariant
thunks.  WIP.

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

15 years agoAuroraUX toolchain fixes.
Edward O'Callaghan [Thu, 15 Oct 2009 07:44:07 +0000 (07:44 +0000)]
AuroraUX toolchain fixes.

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

15 years agoComplete some unfinished comments.
John McCall [Thu, 15 Oct 2009 04:01:40 +0000 (04:01 +0000)]
Complete some unfinished comments.

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

15 years agoBetter living through metaprogramming. Create a base class which abstracts
John McCall [Thu, 15 Oct 2009 03:50:32 +0000 (03:50 +0000)]
Better living through metaprogramming.  Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc.  Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers.  Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.

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

15 years agoMake this at least compile.
Mike Stump [Thu, 15 Oct 2009 02:10:57 +0000 (02:10 +0000)]
Make this at least compile.

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

15 years agoTrack the offset to the current virtual base in CurrentVBaseOffset.
Mike Stump [Thu, 15 Oct 2009 02:04:03 +0000 (02:04 +0000)]
Track the offset to the current virtual base in CurrentVBaseOffset.
Track path information completely to ensure we get all the overrides.  WIP.

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

15 years agoPer an astute observation from Zhongxing Xu, remove a "special case" logic in
Ted Kremenek [Thu, 15 Oct 2009 01:40:34 +0000 (01:40 +0000)]
Per an astute observation from Zhongxing Xu, remove a "special case" logic in
RegionStoreManager::Retrieve() that was intended to handle conflated uses of pointers as integers.
It turns out this isn't needed, and resulted in inconsistent behavior when creating symbolic values on the following test case in 'tests/Analysis/misc-ps.m':

  typedef struct _BStruct { void *grue; } BStruct;
  void testB_aux(void *ptr);
  void testB(BStruct *b) {
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      testB_aux(__gruep__);
    }
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      if (~0 != __gruev__) {}
    }
  }

When the code was analyzed with '-arch x86_64', the value assigned to '__gruev__' be would be a
symbolic integer, but for '-arch i386' the value assigned to '__gruev__' would be a symbolic region
(a blob of memory). With this change the value created is always a symbolic integer.

Since the code being removed was added to support analysis of code calling
OSAtomicCompareAndSwapXXX(), I also modified 'test/Analysis/NSString.m' to analyze the code in both
'-arch i386' and '-arch x86_64', and also added some complementary test cases to test the presence
of leaks when using OSAtomicCompareAndSwap32Barrier()/OSAtomicCompareAndSwap64Barrier() instead of
just their absence. This code change reveals that previously both RegionStore and BasicStore were
handling these cases wrong, and would never cause the analyzer to emit a leak in these cases (false
negatives). Now RegionStore gets it right, but BasicStore still gets it wrong (and hence it has been
disabled temporarily for this test case).

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

15 years agoHandle
Anders Carlsson [Thu, 15 Oct 2009 00:51:46 +0000 (00:51 +0000)]
Handle

struct A { };
struct B : A { };

void f() {
  const A& a = B();
}

correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).

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

15 years agoCheck the return type when calling pointer to member functions.
Anders Carlsson [Thu, 15 Oct 2009 00:41:48 +0000 (00:41 +0000)]
Check the return type when calling pointer to member functions.

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

15 years agoRemoved math.h include, as Windows math.h has a compile error.
John Thompson [Thu, 15 Oct 2009 00:39:58 +0000 (00:39 +0000)]
Removed math.h include, as Windows math.h has a compile error.

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

15 years agoRemove stale comment.
Ted Kremenek [Wed, 14 Oct 2009 23:58:34 +0000 (23:58 +0000)]
Remove stale comment.

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

15 years agoCheckTemplateSpecializationScope isn't going to be used for explicit
Douglas Gregor [Wed, 14 Oct 2009 23:50:59 +0000 (23:50 +0000)]
CheckTemplateSpecializationScope isn't going to be used for explicit
instantiations, since the requirements are too different from those
for template specializations. Simplify it slightly.

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

15 years agoAdditional semantic checking for explicit template instantiations,
Douglas Gregor [Wed, 14 Oct 2009 23:41:34 +0000 (23:41 +0000)]
Additional semantic checking for explicit template instantiations,
focusing on the scope- and qualifier-related semantic requirements in
C++ [temp.explicit]p2.

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

15 years agoOur C++ support is far enough along now that we shouldn't be recommending the use...
Douglas Gregor [Wed, 14 Oct 2009 21:54:48 +0000 (21:54 +0000)]
Our C++ support is far enough along now that we shouldn't be recommending the use of Elsa

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

15 years agoReuse some code for checking the scope of an explicit instantiation
Douglas Gregor [Wed, 14 Oct 2009 21:46:58 +0000 (21:46 +0000)]
Reuse some code for checking the scope of an explicit instantiation

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

15 years agoFix a thinko that John pointed out
Douglas Gregor [Wed, 14 Oct 2009 21:36:34 +0000 (21:36 +0000)]
Fix a thinko that John pointed out

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

15 years agoCheck the implicit instantiation of a static data member of a class
Douglas Gregor [Wed, 14 Oct 2009 21:33:19 +0000 (21:33 +0000)]
Check the implicit instantiation of a static data member of a class
template that has no out-of-line definition.

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

15 years agoGive explicit and implicit instantiations of static data members of
Douglas Gregor [Wed, 14 Oct 2009 21:29:40 +0000 (21:29 +0000)]
Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.

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

15 years agoTesting and some minor fixes for explicit template instantiation.
Douglas Gregor [Wed, 14 Oct 2009 20:14:33 +0000 (20:14 +0000)]
Testing and some minor fixes for explicit template instantiation.

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

15 years agoTestcase for recent checkin. WIP.
Mike Stump [Wed, 14 Oct 2009 18:38:01 +0000 (18:38 +0000)]
Testcase for recent checkin.  WIP.

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

15 years agoShift the vcall slots for non-virtual bases of a virtual base, up into
Mike Stump [Wed, 14 Oct 2009 18:14:51 +0000 (18:14 +0000)]
Shift the vcall slots for non-virtual bases of a virtual base, up into
the virtual base so they can be reused properly.  Don't reuse vcall
slots across a virtual boundary.  WIP.  I have a testcase, but there
are still things that need to be fixed before the testcase can go in.

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

15 years agoWhen mapping from an injected-class-name to its corresponding
Douglas Gregor [Wed, 14 Oct 2009 17:30:58 +0000 (17:30 +0000)]
When mapping from an injected-class-name to its corresponding
template, make sure to get the template that corresponds to *this*
declaration of the class template or specialization, rather than the
canonical specialization. Fixes PR5187.

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

15 years agoAdd support for having different c++ search dirs with -m32 and -m64. So far
Rafael Espindola [Wed, 14 Oct 2009 17:09:44 +0000 (17:09 +0000)]
Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.

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

15 years agoCopy metadata associated with CI
Devang Patel [Wed, 14 Oct 2009 17:03:29 +0000 (17:03 +0000)]
Copy metadata associated with CI

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

15 years agoImplement support for overloaded operator uses that result to a call
Douglas Gregor [Wed, 14 Oct 2009 16:50:13 +0000 (16:50 +0000)]
Implement support for overloaded operator uses that result to a call
to a member operator template. We missed updating this call site when
adding support for function templates; bug exposed by a test for
PR5072.

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

15 years agoThere is now only one version of eh.selector and eh.typeid.for.
Duncan Sands [Wed, 14 Oct 2009 16:13:30 +0000 (16:13 +0000)]
There is now only one version of eh.selector and eh.typeid.for.
Fix the clang build.

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

15 years agoHave the exception specification checkers take partial diagnostics. Use this to merge...
Sebastian Redl [Wed, 14 Oct 2009 16:09:29 +0000 (16:09 +0000)]
Have the exception specification checkers take partial diagnostics. Use this to merge two diagnostics.

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

15 years agoFew targets like PIC16 mangle the names of global variables, so retrieve the name
Sanjiv Gupta [Wed, 14 Oct 2009 15:08:34 +0000 (15:08 +0000)]
Few targets like PIC16 mangle the names of global variables, so retrieve the name
from Var itself rather than the decl for DebugInfo metadata.

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

15 years agoUse CanQualType in the exception specification verification type sets.
Sebastian Redl [Wed, 14 Oct 2009 15:06:25 +0000 (15:06 +0000)]
Use CanQualType in the exception specification verification type sets.

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

15 years agoTeach Lexer::MeasureTokenLength to be able to measure the
Chris Lattner [Wed, 14 Oct 2009 15:04:18 +0000 (15:04 +0000)]
Teach Lexer::MeasureTokenLength to be able to measure the
length of comment tokens.  Patch by Abramo Bagnara!

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

15 years agoUse partial diagnostics properly in call to RequireCompleteType. Among other things...
Sebastian Redl [Wed, 14 Oct 2009 14:59:48 +0000 (14:59 +0000)]
Use partial diagnostics properly in call to RequireCompleteType. Among other things, this means we get a note on the declaration of the incomplete type when it is used in an exception specification.

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

15 years agoDo exception spec compatibility tests for member pointers, too.
Sebastian Redl [Wed, 14 Oct 2009 14:38:54 +0000 (14:38 +0000)]
Do exception spec compatibility tests for member pointers, too.

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

15 years agoNow StoreManager::CastRegion() takes a MemRegion, returns a MemRegion.
Zhongxing Xu [Wed, 14 Oct 2009 06:55:01 +0000 (06:55 +0000)]
Now StoreManager::CastRegion() takes a MemRegion, returns a MemRegion.

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

15 years agoAdd comments to test.
Zhongxing Xu [Wed, 14 Oct 2009 06:05:09 +0000 (06:05 +0000)]
Add comments to test.

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

15 years agofix some cfstring related issues:
Chris Lattner [Wed, 14 Oct 2009 05:55:45 +0000 (05:55 +0000)]
fix some cfstring related issues:
1) -fwritable-string does affect the non-utf16 version of cfstrings
   just not the utf16 ones.
2) utf16 strings should always be marked constant, as the __TEXT segment
   is readonly.
3) The name of the global doesn't matter, remove it from TargetInfo.
4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now.

This fixes rdar://7115750

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

15 years agounbreak test/CodeGen/builtins.c, reverting Devang's change.
Chris Lattner [Wed, 14 Oct 2009 05:49:21 +0000 (05:49 +0000)]
unbreak test/CodeGen/builtins.c, reverting Devang's change.

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

15 years agoRemove dead code.
Zhongxing Xu [Wed, 14 Oct 2009 05:07:51 +0000 (05:07 +0000)]
Remove dead code.

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

15 years ago* Remove unused GRState* parameter
Zhongxing Xu [Wed, 14 Oct 2009 03:33:08 +0000 (03:33 +0000)]
* Remove unused GRState* parameter
* Make all Base value the last argument.

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

15 years agoAdd test case for <rdar://problem/7257223>, and XFAIL this test until it passes.
Ted Kremenek [Wed, 14 Oct 2009 01:54:16 +0000 (01:54 +0000)]
Add test case for <rdar://problem/7257223>, and XFAIL this test until it passes.

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

15 years agoHandle ambiguity of reference initialization.
Fariborz Jahanian [Wed, 14 Oct 2009 00:52:43 +0000 (00:52 +0000)]
Handle ambiguity of reference initialization.
Removes a FIXME.

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

15 years agoretain/release checker: Recognize that calls to
Ted Kremenek [Wed, 14 Oct 2009 00:27:24 +0000 (00:27 +0000)]
retain/release checker: Recognize that calls to
'CVPixelBufferCreateWithPlanarBytes()' and
'CVPixelBufferCreateWithBytes' (Core Video API) can indirectly release
a pixel buffer object via a callback.

This fixes <rdar://problem/7283567>.

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

15 years agoRemove some non-ASCII characters
Douglas Gregor [Tue, 13 Oct 2009 23:52:38 +0000 (23:52 +0000)]
Remove some non-ASCII characters

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

15 years agoMember function templates (and instantiations/specializations thereof)
Douglas Gregor [Tue, 13 Oct 2009 23:45:19 +0000 (23:45 +0000)]
Member function templates (and instantiations/specializations thereof)
are never copy constructors or copy assignment operators.

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

15 years agoImprove diagnostics when the parser encounters a declarator with an
Douglas Gregor [Tue, 13 Oct 2009 23:27:22 +0000 (23:27 +0000)]
Improve diagnostics when the parser encounters a declarator with an
unknown type name, e.g.,

  foo::bar x;

when "bar" does not refer to a type in "foo".

With this change, the parser now calls into the action to perform
diagnostics and can try to recover by substituting in an appropriate
type. For example, this allows us to easily diagnose some missing
"typename" specifiers, which we now do:

  test/SemaCXX/unknown-type-name.cpp:29:1: error: missing 'typename'
        prior to dependent type name 'A<T>::type'
  A<T>::type A<T>::f() { return type(); }
  ^~~~~~~~~~
  typename

Fixes PR3990.

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

15 years agoFix for PR 5181.
Edward O'Callaghan [Tue, 13 Oct 2009 23:05:14 +0000 (23:05 +0000)]
Fix for PR 5181.

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

15 years agoCheck void type before using replaceAllUsesWith().
Devang Patel [Tue, 13 Oct 2009 22:59:11 +0000 (22:59 +0000)]
Check void type before using replaceAllUsesWith().

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

15 years agoThe operator loc points to the operator, not the function decl.
Anders Carlsson [Tue, 13 Oct 2009 22:55:59 +0000 (22:55 +0000)]
The operator loc points to the operator, not the function decl.

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

15 years agoretain/release checker: retained objects passed to pthread_create (as
Ted Kremenek [Tue, 13 Oct 2009 22:55:33 +0000 (22:55 +0000)]
retain/release checker: retained objects passed to pthread_create (as
the data argument) should not be tracked further until we support full IPA.

(fixes <rdar://problem/7299394>)

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

15 years agoRefine handling for non-virtual bases in return value adjustments for
Mike Stump [Tue, 13 Oct 2009 22:54:56 +0000 (22:54 +0000)]
Refine handling for non-virtual bases in return value adjustments for
covariant thunks.  WIP.

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

15 years agoCheck the return type of binary operators and the arrow operator.
Anders Carlsson [Tue, 13 Oct 2009 22:43:21 +0000 (22:43 +0000)]
Check the return type of binary operators and the arrow operator.

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

15 years agoCheck the return type of operator[]() and fix a thinko that lead to a crash in SemaCX...
Anders Carlsson [Tue, 13 Oct 2009 22:22:09 +0000 (22:22 +0000)]
Check the return type of operator[]() and fix a thinko that lead to a crash in SemaCXX/overloaded-operator.cpp.

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

15 years agofix test/CodeGen/statements.c on 32-bit hosts.
Chris Lattner [Tue, 13 Oct 2009 22:12:09 +0000 (22:12 +0000)]
fix test/CodeGen/statements.c on 32-bit hosts.

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

15 years agoMore return type checking.
Anders Carlsson [Tue, 13 Oct 2009 21:49:31 +0000 (21:49 +0000)]
More return type checking.

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

15 years agoEnsure we sign extend.
Mike Stump [Tue, 13 Oct 2009 21:31:09 +0000 (21:31 +0000)]
Ensure we sign extend.

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

15 years agoDiagnose invalid return types for unary operators.
Anders Carlsson [Tue, 13 Oct 2009 21:19:37 +0000 (21:19 +0000)]
Diagnose invalid return types for unary operators.

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

15 years agoUnify our diagnostic printing for errors of the form, "we didn't like
Douglas Gregor [Tue, 13 Oct 2009 21:16:44 +0000 (21:16 +0000)]
Unify our diagnostic printing for errors of the form, "we didn't like
what we found when we looked into <blah>", where <blah> is a
DeclContext*. We can now format DeclContext*'s in nice ways, e.g.,
"namespace N", "the global namespace", "'class Foo'".

This is part of PR3990, but we're not quite there yet.

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

15 years agoPass the right SourceLocation to Actions.ActOnOverloadedOperatorReferenceExpr and...
Anders Carlsson [Tue, 13 Oct 2009 21:02:07 +0000 (21:02 +0000)]
Pass the right SourceLocation to Actions.ActOnOverloadedOperatorReferenceExpr and Actions.ActOnConversionOperatorReferenceExpr. Update incomplete-call.cpp test.

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

15 years agoGive ourselves an A- on ASTs for explicit specializations, since they
Douglas Gregor [Tue, 13 Oct 2009 19:41:44 +0000 (19:41 +0000)]
Give ourselves an A- on ASTs for explicit specializations, since they
aren't rich enough to reproduce the source accurately.

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

15 years agoFixes pth.c on Windows.
John Thompson [Tue, 13 Oct 2009 18:51:32 +0000 (18:51 +0000)]
Fixes pth.c on Windows.

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

15 years agoConverted to use FileCheck.
John Thompson [Tue, 13 Oct 2009 18:51:26 +0000 (18:51 +0000)]
Converted to use FileCheck.

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

15 years agoTurn -Wparentheses on by default.
John McCall [Tue, 13 Oct 2009 17:57:23 +0000 (17:57 +0000)]
Turn -Wparentheses on by default.

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

15 years agoDon't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr...
Anders Carlsson [Tue, 13 Oct 2009 17:41:28 +0000 (17:41 +0000)]
Don't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr. Fixes PR5177.

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

15 years agoRemove FIXME. We construct VBIndex very early, before any calls to OverrideMethod.
Mike Stump [Tue, 13 Oct 2009 17:23:44 +0000 (17:23 +0000)]
Remove FIXME.  We construct VBIndex very early, before any calls to OverrideMethod.

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

15 years agoDiagnose attempts to add default function arguments to a
Douglas Gregor [Tue, 13 Oct 2009 17:02:54 +0000 (17:02 +0000)]
Diagnose attempts to add default function arguments to a
specialization. This completes C++ [temp.expl.spec]!

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

15 years agoRemove extra white space line.
Devang Patel [Tue, 13 Oct 2009 17:02:38 +0000 (17:02 +0000)]
Remove extra white space line.

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

15 years agoDo not check use_empty() before invoking replaceAllUsesWith().
Devang Patel [Tue, 13 Oct 2009 17:02:04 +0000 (17:02 +0000)]
Do not check use_empty() before invoking replaceAllUsesWith().
Let replaceAllUsesWith() adjust VHs even though there are no uses.

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

15 years ago-funit-at-a-time is the default however some current makefiles pass -fno-unit-at...
Edward O'Callaghan [Tue, 13 Oct 2009 16:41:34 +0000 (16:41 +0000)]
-funit-at-a-time is the default however some current makefiles pass -fno-unit-at-a-time which is ignored by GCC, we should warn about this not error out.

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

15 years agoWhen explicitly specializing a member that is a template, mark the
Douglas Gregor [Tue, 13 Oct 2009 16:30:37 +0000 (16:30 +0000)]
When explicitly specializing a member that is a template, mark the
template as a specialization. For example, this occurs with:

  template<typename T>
  struct X {
    template<typename U> struct Inner { /* ... */ };
  };

  template<> template<typename T>
  struct X<int>::Inner {
    T member;
  };

We need to treat templates that are member specializations as special
in two contexts:

  - When looking for a definition of a member template, we look
    through the instantiation chain until we hit the primary template
    *or a member specialization*. This allows us to distinguish
    between the primary "Inner" definition and the X<int>::Inner
    definition, above.
  - When computing all of the levels of template arguments needed to
    instantiate a member template, don't add template arguments
    from contexts outside of the instantiation of a member
    specialization, since the user has already manually substituted
    those arguments.

Fix up the existing test for p18, which was actually wrong (but we
didn't diagnose it because of our poor handling of member
specializations of templates), and add a new test for member
specializations of templates.

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

15 years agoImprove the internal representation and semantic analysis of friend
Douglas Gregor [Tue, 13 Oct 2009 14:39:41 +0000 (14:39 +0000)]
Improve the internal representation and semantic analysis of friend
function templates.

This commit ensures that friend function templates are constructed as
FunctionTemplateDecls rather than partial FunctionDecls (as they
previously were). It then implements template instantiation for friend
function templates, injecting the friend function template only when
no previous declaration exists at the time of instantiation.

Oh, and make sure that explicit specialization declarations are not
friends.

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

15 years agoRefine handling for return value conversions with respect to virtual
Mike Stump [Tue, 13 Oct 2009 10:55:21 +0000 (10:55 +0000)]
Refine handling for return value conversions with respect to virtual
offsets for covariant thunks.

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

15 years agoSimplify pointer creation with the new Type::getInt*Ptr methods.
Benjamin Kramer [Tue, 13 Oct 2009 10:07:13 +0000 (10:07 +0000)]
Simplify pointer creation with the new Type::getInt*Ptr methods.

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

15 years agoTeach sema and codegen about the difference between address of labels,
Chris Lattner [Tue, 13 Oct 2009 07:14:16 +0000 (07:14 +0000)]
Teach sema and codegen about the difference between address of labels,
which is a common idiom to improve PIC'ness of code using the addr of
label extension.  This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice.  This implements PR5131.

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

15 years agoreimplement codegen for indirect goto with the following advantages:
Chris Lattner [Tue, 13 Oct 2009 06:55:33 +0000 (06:55 +0000)]
reimplement codegen for indirect goto with the following advantages:

1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
   'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
   of one for each indirect goto.  This fixes an M*N = N^2 IR size issue
   when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
   size of the jump table needed (by one).

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

15 years agomerge an indirect goto test into statements, add another
Chris Lattner [Tue, 13 Oct 2009 06:52:43 +0000 (06:52 +0000)]
merge an indirect goto test into statements, add another
hairier (but nonsensical) example.

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

15 years agoReturn the original state by default.
Zhongxing Xu [Tue, 13 Oct 2009 06:07:58 +0000 (06:07 +0000)]
Return the original state by default.

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

15 years agonumber address-taken labels from 1. This allows 0 to be used as a sentinel
Chris Lattner [Tue, 13 Oct 2009 06:04:29 +0000 (06:04 +0000)]
number address-taken labels from 1.  This allows 0 to be used as a sentinel
for a null pointer.  In other words, "&&foo != NULL" will always work out to
true.

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

15 years agoUse the new Type::getInt8PtrTy method. This should probably be used in a lot
Chris Lattner [Tue, 13 Oct 2009 06:02:42 +0000 (06:02 +0000)]
Use the new Type::getInt8PtrTy method.  This should probably be used in a lot
more places in clang codegen now.

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

15 years agotest commit
John Thompson [Tue, 13 Oct 2009 05:45:19 +0000 (05:45 +0000)]
test commit

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

15 years agoadd rdar # I accidentally lost.
Chris Lattner [Tue, 13 Oct 2009 04:57:27 +0000 (04:57 +0000)]
add rdar # I accidentally lost.

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

15 years agomerge two tests.
Chris Lattner [Tue, 13 Oct 2009 04:56:49 +0000 (04:56 +0000)]
merge two tests.

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

15 years agomake the diagnostic in the 'unused result' warning more precise
Chris Lattner [Tue, 13 Oct 2009 04:53:48 +0000 (04:53 +0000)]
make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.

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

15 years agofix PR4938 by recognizing % as a modifier on outputs,
Chris Lattner [Tue, 13 Oct 2009 04:32:07 +0000 (04:32 +0000)]
fix PR4938 by recognizing % as a modifier on outputs,
previously we only recognized it on inputs.

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

15 years agoNow we can call into another function with the CallInliner transfer function.
Zhongxing Xu [Tue, 13 Oct 2009 02:36:42 +0000 (02:36 +0000)]
Now we can call into another function with the CallInliner transfer function.

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

15 years agoAdd two utility methods.
Zhongxing Xu [Tue, 13 Oct 2009 02:29:58 +0000 (02:29 +0000)]
Add two utility methods.

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

15 years agoAdd an initial implementation of EnterStackFrame() to the StoreManager.
Zhongxing Xu [Tue, 13 Oct 2009 02:24:55 +0000 (02:24 +0000)]
Add an initial implementation of EnterStackFrame() to the StoreManager.

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

15 years agoDisable tests that check debug info intrinsic. This does not work if debug info intri...
Devang Patel [Mon, 12 Oct 2009 23:46:58 +0000 (23:46 +0000)]
Disable tests that check debug info intrinsic. This does not work if debug info intrinsics are not used to encode debug info.

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

15 years agoEnable "debug info attached to an instruction" mode.
Devang Patel [Mon, 12 Oct 2009 23:31:25 +0000 (23:31 +0000)]
Enable "debug info attached to an instruction" mode.

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

15 years agoMinor CSS fix
Douglas Gregor [Mon, 12 Oct 2009 23:15:14 +0000 (23:15 +0000)]
Minor CSS fix

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

15 years agoWhen declaring a class template whose name is qualified, make sure
Douglas Gregor [Mon, 12 Oct 2009 23:11:44 +0000 (23:11 +0000)]
When declaring a class template whose name is qualified, make sure
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.

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

15 years agoMinor margin fix
Douglas Gregor [Mon, 12 Oct 2009 22:52:00 +0000 (22:52 +0000)]
Minor margin fix

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

15 years agoTest explicit specialization involving multiple template<> headers
Douglas Gregor [Mon, 12 Oct 2009 22:33:31 +0000 (22:33 +0000)]
Test explicit specialization involving multiple template<> headers

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

15 years agoThere is no need to attach debug location info with alloca instruction.
Devang Patel [Mon, 12 Oct 2009 22:29:02 +0000 (22:29 +0000)]
There is no need to attach debug location info with alloca instruction.

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

15 years agoEncode long double.
Devang Patel [Mon, 12 Oct 2009 22:28:31 +0000 (22:28 +0000)]
Encode long double.

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

15 years agoPermit explicit specialization of member functions of class templates
Douglas Gregor [Mon, 12 Oct 2009 22:27:17 +0000 (22:27 +0000)]
Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.

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

15 years agoMore appropriate API usage.
John McCall [Mon, 12 Oct 2009 22:25:59 +0000 (22:25 +0000)]
More appropriate API usage.

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

15 years agoImplement -Wparentheses: warn about using assignments in contexts that require
John McCall [Mon, 12 Oct 2009 21:59:07 +0000 (21:59 +0000)]
Implement -Wparentheses:  warn about using assignments in contexts that require
conditions.  Add a fixit to insert the parentheses.  Also fix a very minor
possible memory leak in 'for' conditions.

Fixes PR 4876 and rdar://problem/7289172

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