Commit Graph

26008 Commits

Author SHA1 Message Date
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
Zhanyong Wan ea6d7f332d Fix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean Sturtevant, reviewed by chandlerc and Sebastian Redl).
llvm-svn: 115638
2010-10-05 17:56:33 +00:00
Sebastian Redl 009e7f203f Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.
llvm-svn: 115626
2010-10-05 16:15:19 +00:00
Sebastian Redl 2c373b9876 Thread PerFileData through the ASTReader again, this time with the LLVM changes.
llvm-svn: 115625
2010-10-05 15:59:54 +00:00
Douglas Gregor 2c2c4cd9fd 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: 115621
2010-10-05 15:41:24 +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
Zhongxing Xu 614e17dddf * Simplify code
* Fix dump() to make it consistent with the test case.

llvm-svn: 115609
2010-10-05 08:38:06 +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 0077b22aa4 If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup.  Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed.  Fixes PR8175 (again).

llvm-svn: 115586
2010-10-05 02:33:56 +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
Devang Patel 3703ff4163 dyn_cast is more appropriate here.
llvm-svn: 115569
2010-10-04 22:28:23 +00:00
Devang Patel 95eea45aa5 Add missing '}' :)
llvm-svn: 115568
2010-10-04 22:13:18 +00:00
Devang Patel 44b8bf0f5b Emit debug info for an aggregate while processing MemberExpr if the aggregate's debug info was delayed untill now.
llvm-svn: 115564
2010-10-04 21:46:04 +00:00
Devang Patel cbc7bc94c9 Fix filename in header comment.
llvm-svn: 115561
2010-10-04 21:15:33 +00:00
Douglas Gregor dc72caa6de When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.
llvm-svn: 115527
2010-10-04 18:21:45 +00:00
Daniel Dunbar 25a3ada060 www: Add a "Clang Related Projects" page, to collect links to external projects
using Clang in one way or another. Additions welcome!

llvm-svn: 115508
2010-10-04 15:40:45 +00:00
Marcin Swiderski 87b1bb6fd2 Added support for C++ initializers in CFG.
llvm-svn: 115493
2010-10-04 03:38:22 +00:00
Chris Lattner b9d4dfc86a Change to match 115473.
llvm-svn: 115474
2010-10-03 19:09: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
Chris Lattner 07704f1d7e the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

llvm-svn: 115423
2010-10-02 21:32:59 +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 db9fb5a427 Don't add -fno-spell-checking in libclang if a spell-checking-related argument is already in the command-line arguments
llvm-svn: 115420
2010-10-02 20:06:51 +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
Chris Lattner 64d7f2a014 when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr.  In
-ftrapv mode, they are not the same.

This fixes rdar://8478728 + PR8221

llvm-svn: 115388
2010-10-02 00:09:12 +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
Chris Lattner 07e96866a2 tidy
llvm-svn: 115383
2010-10-01 23:43:16 +00:00
Chris Lattner 407e7e3ace kill off CheckX86BuiltinFunctionCall
llvm-svn: 115382
2010-10-01 23:40:43 +00:00
Chris Lattner 04b03b1fc4 move imperative code to declarative definitions.
llvm-svn: 115381
2010-10-01 23:35:58 +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
Chris Lattner bd6e69368f enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's.  No clients of this new functionality yet!

llvm-svn: 115366
2010-10-01 22:53:11 +00:00
Chris Lattner dc226c2b9b random cleanups, no functionality change.
llvm-svn: 115361
2010-10-01 22:42:38 +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