Commit Graph

16566 Commits

Author SHA1 Message Date
Fariborz Jahanian 31481d8b22 Handle ambiguity of reference initialization.
Removes a FIXME.

llvm-svn: 84068
2009-10-14 00:52:43 +00:00
Ted Kremenek b4ec3fc42d 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>.

llvm-svn: 84064
2009-10-14 00:27:24 +00:00
Douglas Gregor 3362bde8ec Remove some non-ASCII characters
llvm-svn: 84058
2009-10-13 23:52:38 +00:00
Douglas Gregor a14b43bba8 Member function templates (and instantiations/specializations thereof)
are never copy constructors or copy assignment operators.

llvm-svn: 84057
2009-10-13 23:45:19 +00:00
Douglas Gregor 15e5602e59 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.

llvm-svn: 84053
2009-10-13 23:27:22 +00:00
Edward O'Callaghan f258caa718 Fix for PR 5181.
llvm-svn: 84051
2009-10-13 23:05:14 +00:00
Devang Patel 3b3f0f6b65 Check void type before using replaceAllUsesWith().
llvm-svn: 84050
2009-10-13 22:59:11 +00:00
Anders Carlsson fbd2d49398 The operator loc points to the operator, not the function decl.
llvm-svn: 84048
2009-10-13 22:55:59 +00:00
Ted Kremenek 80816acf9b 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>)

llvm-svn: 84047
2009-10-13 22:55:33 +00:00
Mike Stump 284312176a Refine handling for non-virtual bases in return value adjustments for
covariant thunks.  WIP.

llvm-svn: 84046
2009-10-13 22:54:56 +00:00
Anders Carlsson e4f4b5e919 Check the return type of binary operators and the arrow operator.
llvm-svn: 84043
2009-10-13 22:43:21 +00:00
Anders Carlsson 834facc2b0 Check the return type of operator[]() and fix a thinko that lead to a crash in SemaCXX/overloaded-operator.cpp.
llvm-svn: 84041
2009-10-13 22:22:09 +00:00
Chris Lattner a2f9bd5339 fix test/CodeGen/statements.c on 32-bit hosts.
llvm-svn: 84039
2009-10-13 22:12:09 +00:00
Anders Carlsson 3d5829cd4f More return type checking.
llvm-svn: 84034
2009-10-13 21:49:31 +00:00
Mike Stump 7373095ebf Ensure we sign extend.
llvm-svn: 84031
2009-10-13 21:31:09 +00:00
Anders Carlsson f64a3dae04 Diagnose invalid return types for unary operators.
llvm-svn: 84030
2009-10-13 21:19:37 +00:00
Douglas Gregor e40876a50c 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.

llvm-svn: 84028
2009-10-13 21:16:44 +00:00
Anders Carlsson 8523d20af3 Pass the right SourceLocation to Actions.ActOnOverloadedOperatorReferenceExpr and Actions.ActOnConversionOperatorReferenceExpr. Update incomplete-call.cpp test.
llvm-svn: 84026
2009-10-13 21:02:07 +00:00
Douglas Gregor 054060c4ec Give ourselves an A- on ASTs for explicit specializations, since they
aren't rich enough to reproduce the source accurately.

llvm-svn: 84012
2009-10-13 19:41:44 +00:00
John Thompson 4334ce6bda Fixes pth.c on Windows.
llvm-svn: 84007
2009-10-13 18:51:32 +00:00
John Thompson 271f1f07bc Converted to use FileCheck.
llvm-svn: 84005
2009-10-13 18:51:26 +00:00
John McCall 04f531238d Turn -Wparentheses on by default.
llvm-svn: 83993
2009-10-13 17:57:23 +00:00
Anders Carlsson 6bfee8f3e3 Don't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr. Fixes PR5177.
llvm-svn: 83986
2009-10-13 17:41:28 +00:00
Mike Stump ad47e7ea81 Remove FIXME. We construct VBIndex very early, before any calls to OverrideMethod.
llvm-svn: 83981
2009-10-13 17:23:44 +00:00
Douglas Gregor 62e10f0bdc Diagnose attempts to add default function arguments to a
specialization. This completes C++ [temp.expl.spec]!

llvm-svn: 83980
2009-10-13 17:02:54 +00:00
Devang Patel 9f73552852 Remove extra white space line.
llvm-svn: 83979
2009-10-13 17:02:38 +00:00
Devang Patel 7468489deb Do not check use_empty() before invoking replaceAllUsesWith().
Let replaceAllUsesWith() adjust VHs even though there are no uses.

llvm-svn: 83978
2009-10-13 17:02:04 +00:00
Edward O'Callaghan fc460554f6 -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.
llvm-svn: 83976
2009-10-13 16:41:34 +00:00
Douglas Gregor cf91555cb8 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.

llvm-svn: 83974
2009-10-13 16:30:37 +00:00
Douglas Gregor 3a88c1d784 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.

llvm-svn: 83970
2009-10-13 14:39:41 +00:00
Mike Stump 87876a0053 Refine handling for return value conversions with respect to virtual
offsets for covariant thunks.

llvm-svn: 83965
2009-10-13 10:55:21 +00:00
Benjamin Kramer abd5b90e4c Simplify pointer creation with the new Type::getInt*Ptr methods.
llvm-svn: 83964
2009-10-13 10:07:13 +00:00
Chris Lattner 3eb172a02b 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.

llvm-svn: 83957
2009-10-13 07:14:16 +00:00
Chris Lattner 2bb5cb490c 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).

llvm-svn: 83952
2009-10-13 06:55:33 +00:00
Chris Lattner 9842a4dcb1 merge an indirect goto test into statements, add another
hairier (but nonsensical) example.

llvm-svn: 83951
2009-10-13 06:52:43 +00:00
Zhongxing Xu e02b89566a Return the original state by default.
llvm-svn: 83949
2009-10-13 06:07:58 +00:00
Chris Lattner 92ae16b0ae 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.

llvm-svn: 83948
2009-10-13 06:04:29 +00:00
Chris Lattner dd7eaad7d4 Use the new Type::getInt8PtrTy method. This should probably be used in a lot
more places in clang codegen now.

llvm-svn: 83947
2009-10-13 06:02:42 +00:00
John Thompson 9f2a365fe2 test commit
llvm-svn: 83945
2009-10-13 05:45:19 +00:00
Chris Lattner a611b45806 add rdar # I accidentally lost.
llvm-svn: 83942
2009-10-13 04:57:27 +00:00
Chris Lattner af066d818c merge two tests.
llvm-svn: 83941
2009-10-13 04:56:49 +00:00
Chris Lattner 1a6babf1f4 make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.

llvm-svn: 83940
2009-10-13 04:53:48 +00:00
Chris Lattner f315471e24 fix PR4938 by recognizing % as a modifier on outputs,
previously we only recognized it on inputs.

llvm-svn: 83939
2009-10-13 04:32:07 +00:00
Zhongxing Xu 88dd1ff0d7 Now we can call into another function with the CallInliner transfer function.
llvm-svn: 83936
2009-10-13 02:36:42 +00:00
Zhongxing Xu 2d88c0b989 Add two utility methods.
llvm-svn: 83935
2009-10-13 02:29:58 +00:00
Zhongxing Xu daa4176926 Add an initial implementation of EnterStackFrame() to the StoreManager.
llvm-svn: 83934
2009-10-13 02:24:55 +00:00
Devang Patel 232f278fc1 Disable tests that check debug info intrinsic. This does not work if debug info intrinsics are not used to encode debug info.
llvm-svn: 83929
2009-10-12 23:46:58 +00:00
Devang Patel 5b294f4330 Enable "debug info attached to an instruction" mode.
llvm-svn: 83928
2009-10-12 23:31:25 +00:00
Douglas Gregor e3afaeb7e4 Minor CSS fix
llvm-svn: 83924
2009-10-12 23:15:14 +00:00
Douglas Gregor ef06ccf8d0 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.

llvm-svn: 83923
2009-10-12 23:11:44 +00:00