Commit Graph

8825 Commits

Author SHA1 Message Date
Fariborz Jahanian 55106310ae Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.

llvm-svn: 115842
2010-10-06 21:18:44 +00:00
John McCall 569eafce63 Re-enable EH cleanups to destroy __block variables, now that we have a moment to
deal with the consequences.  Fixes rdar://problem/8224178.

llvm-svn: 115816
2010-10-06 18:56:43 +00:00
Fariborz Jahanian 4801cc6315 Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.

llvm-svn: 115800
2010-10-06 17:00:02 +00:00
Douglas Gregor 3999e15d93 Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.

llvm-svn: 115790
2010-10-06 16:00:31 +00:00
Francois Pichet f804a97d4f _inline is an alias for inline in MSVC.
llvm-svn: 115785
2010-10-06 13:02:48 +00:00
Chandler Carruth a64aedb34b Remove hard CRLF end-of-line markers from two files. These should be added
automatically when syncing due to the auto-props selecting svn:eol-style of
'native'.

llvm-svn: 115758
2010-10-06 06:50:05 +00:00
Nico Weber 9762e0a234 Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.
llvm-svn: 115743
2010-10-06 04:57:26 +00:00
Bill Wendling 964f521e85 Erm...this isn't the same as PR6658.
llvm-svn: 115737
2010-10-06 03:33:37 +00:00
Bill Wendling 6153d2c7bd MMX conversion work is done. We can remove the FIXMEs.
llvm-svn: 115736
2010-10-06 03:31:26 +00:00
Bill Wendling 8700d39139 Add same hack to mmx-builtins.c as in Headers/c89.c to get it to pass on Win32. PR6658.
llvm-svn: 115735
2010-10-06 03:31:09 +00:00
Anders Carlsson 0f7e94fd7b When checking for uninitialized fields in member initializers, special case static variables and enums. Fixes PR8075.
llvm-svn: 115732
2010-10-06 02:43:25 +00:00
John McCall 2551c1bbcd Provide a slightly specialized diagnostic for tautological comparisons
of an enum value.

llvm-svn: 115725
2010-10-06 00:25:24 +00:00
Fariborz Jahanian 121f5148fd Issue deprecated warning when typeof uses an
expression of deprecated type.

llvm-svn: 115713
2010-10-05 23:24:00 +00:00
John McCall 09d1369964 When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments.  This is
important if the default arguments refer to a declaration or create a
temporary.

llvm-svn: 115700
2010-10-05 22:36:42 +00:00
Fariborz Jahanian c080a333ce Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061

llvm-svn: 115683
2010-10-05 21:02:11 +00:00
John McCall 46b4dc32df ...without leaving a temporary file behind.
llvm-svn: 115671
2010-10-05 20:53:58 +00:00
John McCall 0ec01b0ca4 Er, this test should actually run IR generation.
llvm-svn: 115670
2010-10-05 20:53:00 +00:00
John McCall e5dd32da11 Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through.  That this happens
for this test case is actually a separate bug.

llvm-svn: 115668
2010-10-05 20:48:15 +00:00
Douglas Gregor 44e5c1f16c Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.
llvm-svn: 115667
2010-10-05 20:41:58 +00:00
Douglas Gregor 9b3932c0bc Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
  - AST writing schedules writing a type X* that it had never seen
  before
  - AST writing starts writing another declaration, ends up
  deserializing X* from a prior AST file. Now we have two type IDs for
  the same type!
  - AST writer tries to write X*. It only has the lower-numbered ID
  from the the prior AST file, so references to the higher-numbered ID
  that was scheduled for writing go off into lalaland.

To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.

Fixes <rdar://problem/8511624>, I think.

llvm-svn: 115647
2010-10-05 18:37:06 +00:00
Fariborz Jahanian fc8315f56a Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992

llvm-svn: 115644
2010-10-05 18:05:06 +00:00
Douglas Gregor aca68323f3 Remove a rogue typo
llvm-svn: 115618
2010-10-05 14:58:05 +00:00
Douglas Gregor 93269380e7 Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.

llvm-svn: 115617
2010-10-05 14:55:45 +00:00
Marcin Swiderski 20b88739ed Added support for base and member destructors in destructor.
llvm-svn: 115592
2010-10-05 05:37:00 +00:00
Argyrios Kyrtzidis a992bbc08a Add test case for r115588.
llvm-svn: 115590
2010-10-05 03:15:43 +00:00
Argyrios Kyrtzidis dfbdfbba8f In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!

llvm-svn: 115588
2010-10-05 03:05:30 +00:00
John McCall 9916e3fa93 In the fragile ObjC ABI, save the caught exception to the side if there are
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot.  Fixes rdar://problem/8440970.

llvm-svn: 115575
2010-10-04 23:42:51 +00:00
Marcin Swiderski 87b1bb6fd2 Added support for C++ initializers in CFG.
llvm-svn: 115493
2010-10-04 03:38:22 +00:00
Bill Wendling a76cdeb783 Do x86_64.
llvm-svn: 115460
2010-10-03 08:34:05 +00:00
Bill Wendling 4a58223401 Test to verify that all of the MMX builtins are handled by the front-end.
llvm-svn: 115459
2010-10-03 03:39:54 +00:00
Douglas Gregor af25cfaae0 When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.

llvm-svn: 115444
2010-10-02 23:49:58 +00:00
Douglas Gregor 97c7571ef3 Introduce a new libclang function, clang_getCursorDisplayName(), which
produces a simple "display" name that captures the
arguments/parameters for a function, function template, class
template, or class template specialization.

llvm-svn: 115428
2010-10-02 22:49:11 +00:00
Douglas Gregor 4e3918c06b Teach clang_getCursorType() about base specifiers and other references
to types. 

Also, teach clang_getTypeDeclaration() about template specializations,
injected-class-names, and elaborated types.

Fixes <rdar://problem/8506460>.

llvm-svn: 115425
2010-10-02 21:57:58 +00:00
Douglas Gregor 3022037787 When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.

llvm-svn: 115421
2010-10-02 21:06:43 +00:00
Douglas Gregor 3478c75b71 Provide proper source location and range information for C++ base
specifier cursors in libclang. FIXME -=2, fixes the rest of
<rdar://problem/8274883>.

llvm-svn: 115419
2010-10-02 19:51:13 +00:00
Douglas Gregor 9109629e55 Implement chained PCH support for the macro definitions stored within
the "detailed" preprocessing record.

llvm-svn: 115417
2010-10-02 19:29:26 +00:00
Anders Carlsson fe15a78ff2 Use ParseObjCSelectorPiece for parsing getter and setter names in @property declarations. Fixes PR8169.
llvm-svn: 115411
2010-10-02 17:45:21 +00:00
Anders Carlsson 0e523cba82 Rename a test in preparation for fixing PR8169.
llvm-svn: 115410
2010-10-02 17:08:38 +00:00
Douglas Gregor 0eaa2bfe79 Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.

llvm-svn: 115387
2010-10-01 23:55:07 +00:00
Devang Patel d18c5aa20a Mark explict methods as explict in debug info.
llvm-svn: 115379
2010-10-01 23:32:17 +00:00
Chris Lattner 3be167f606 diagnose errors when a builtin that require constant arguments don't have them.
For example, on:

#include <emmintrin.h>
int foo(int N) {
 __m128i white2;
 white2 = _mm_slli_si128(white2, N);
 return 0;
} 

we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq

now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
      constant integer
 white2 = _mm_slli_si128(white2, N);
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
  ((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
            ^                                         ~~~~~~~
1 error generated.

llvm-svn: 115374
2010-10-01 23:23:24 +00:00
Gabor Greif 594ce3573a Doug's feedback
llvm-svn: 115356
2010-10-01 22:12:38 +00:00
Gabor Greif 16e028617c Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135

Some minor refacorings while I am here.

llvm-svn: 115355
2010-10-01 22:05:14 +00:00
Fariborz Jahanian de744dcce1 Restore test. Is for //rdar://8493239
llvm-svn: 115349
2010-10-01 21:26:26 +00:00
Francois Pichet 6d76e6cd92 Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.
Example: 
class A {
   void A::foo(); //warning: extra qualification on member 'foo'
};

llvm-svn: 115347
2010-10-01 21:19:28 +00:00
Douglas Gregor e6712983d2 Teach clang_getCursorReferenced() about Objective-C property reference
and protocol expressions. Fixes <rdar://problem/7833565>.

llvm-svn: 115346
2010-10-01 21:11:22 +00:00
Douglas Gregor 99a26afd49 Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.

llvm-svn: 115338
2010-10-01 20:25:15 +00:00
Douglas Gregor 7fb25418ed Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).

llvm-svn: 115322
2010-10-01 18:44:50 +00:00
Marcin Swiderski 3546b1aea1 Added generating CFGAutomaticObjDtors for exception variable in catch statement.
llvm-svn: 115266
2010-10-01 01:46:52 +00:00
Marcin Swiderski 6d5ee0c7f9 Added generating CFGAutomaticObjDtors for init statement, condition variable and implicit scope in for statement.
llvm-svn: 115265
2010-10-01 01:38:14 +00:00