Commit Graph

6346 Commits

Author SHA1 Message Date
Charles Davis 163855f46d dllimport and dllexport are declspec attributes, too. They're also
Win32-specific.

Also, fix a test to use FileCheck instead of grepping LLVM IR.

llvm-svn: 96364
2010-02-16 18:27:26 +00:00
Fariborz Jahanian b6a68c0465 Minor rewriter cleanup and a test for a block rewriting bug.
llvm-svn: 96361
2010-02-16 17:26:03 +00:00
Ted Kremenek 3eac2454dc Add test case showing that a recursive block that captures a block pointer that
isn't marked '__block' is bad.

llvm-svn: 96357
2010-02-16 16:55:10 +00:00
Anders Carlsson bc91b44a23 Add an extreme vbase offsets test. I'm kinda amazed that this works myself ;)
llvm-svn: 96356
2010-02-16 16:50:08 +00:00
Anders Carlsson 13f0f66223 Handle layout of vtables for virtual bases.
llvm-svn: 96355
2010-02-16 16:49:35 +00:00
Anders Carlsson 14157939ab Fix a bug where we would not emit secondary vtables for bases of a primary base.
llvm-svn: 96351
2010-02-16 16:02:57 +00:00
Ted Kremenek 228639746a Add simpler checker to check if variables captured by a block are uninitialized.
llvm-svn: 96341
2010-02-16 08:33:59 +00:00
John McCall d8d0d43fa3 Support local namespace aliases and permit them to be instantiated.
llvm-svn: 96335
2010-02-16 06:53:13 +00:00
Anders Carlsson 77904f1d5b Emit vbase offsets.
llvm-svn: 96329
2010-02-16 04:59:55 +00:00
Sanjiv Gupta ecd2600c52 Re-applying 96173. Looks like finally I got the test case right.
llvm-svn: 96321
2010-02-16 03:37:11 +00:00
Ted Kremenek 588fc83c74 Add test case to show that Clang now checks the format string
arguments of asprintf (<rdar://problem/6657191>).

llvm-svn: 96319
2010-02-16 02:14:24 +00:00
Ted Kremenek ccf701d375 Fix test case.
llvm-svn: 96311
2010-02-16 01:47:05 +00:00
Ted Kremenek c8b188d541 Refactor the logic for printf argument type-checking into analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.

Fixes <rdar://problem/3065808>.

llvm-svn: 96310
2010-02-16 01:46:59 +00:00
Douglas Gregor 4563532043 Skeleton for importing Objective-C classes
llvm-svn: 96306
2010-02-16 01:20:57 +00:00
Douglas Gregor b4964f7705 Cope with anonymous tags defined within declarators by structurally
comparing their types under the assumption that they are equivalent,
rather than importing the types and then checking for compatibility. A
few minor tweaks here:
  - Teach structural matching to handle compatibility between
  function types with prototypes and those without prototypes.
  - Teach structural matching that an incomplete record decl is the
  same as any other record decl with the same name.
  - Keep track of pairs of declarations that we have already checked
  (but failed to find as structurally matching), so we don't emit
  diagnostics repeatedly.
  - When importing a typedef of an anonymous tag, be sure to link the
  imported tag type to its typedef.

With these changes, we survive a repeated import of <stdlib.h> and
<stdio.h>. Alas, the ASTNodeImporter is getting a little grotty.

llvm-svn: 96298
2010-02-15 23:54:17 +00:00
Benjamin Kramer 634fc10fe1 Add Sema support for __builtin_fpclassify by extending the existing check for __builtin_isinf and friends. Part of PR6083.
llvm-svn: 96291
2010-02-15 22:42:31 +00:00
Fariborz Jahanian 8efe0ec899 Issue a bettter diagnostics for incorrect property setter name.
(radar 7647953).

llvm-svn: 96284
2010-02-15 22:20:11 +00:00
Chandler Carruth 3e0c140c50 Fix instantiation of template functions with local classes that contain virtual
methods.

llvm-svn: 96283
2010-02-15 22:12:26 +00:00
Douglas Gregor 3996e249ed Reimplement the structural-equality checks used to determine whether
two types in different AST contexts are equivalent. Rather than
transforming the type from one context into the other context, we
perform a deep structural comparison of the types. This change
addresses a serious problem with recursive data types like

  struct ListNode {
    int value;
    struct ListNode *Next;
  } xList;

llvm-svn: 96278
2010-02-15 22:01:00 +00:00
Fariborz Jahanian 30a42923d3 Class continuation now has its own property ast for
those declared in it. This is to allow duplicate
property diagnostics for properties declared in class extensions
multiple times (radar 7629420) and for future use.

llvm-svn: 96276
2010-02-15 21:55:26 +00:00
Fariborz Jahanian 06708cee8d Test to compile the rewritten file for my last patch.
(radar 7649577 related).

llvm-svn: 96274
2010-02-15 21:37:11 +00:00
Devang Patel e8814ce0a6 Use getLocStart(), instead of getLocEnd(), to record starting location of objc method. :)
llvm-svn: 96245
2010-02-15 18:08:38 +00:00
Sanjiv Gupta 9d23f93d52 reverting back 96242 as it still causes a test failure.
llvm-svn: 96244
2010-02-15 18:02:12 +00:00
Sanjiv Gupta af56d377f1 Re-applying 96173 with corresponding changes in test.
llvm-svn: 96242
2010-02-15 17:19:13 +00:00
Chandler Carruth 284bb2ec72 Defer covariance checks for dependent types. Add test cases that also ensure
they are re-checked on instantiation.

llvm-svn: 96217
2010-02-15 11:53:20 +00:00
Anders Carlsson 033d48697f Don't compute final overriders or build vtables for bases that don't need a vtable.
llvm-svn: 96171
2010-02-14 17:05:59 +00:00
Daniel Dunbar 6092d507f0 c-index-test: Unify and always print half-open extents.
llvm-svn: 96160
2010-02-14 08:32:51 +00:00
Daniel Dunbar 98c07e0e23 c-index-test: Unify syntax for printing extents. Yes, there were 4.
llvm-svn: 96158
2010-02-14 08:32:24 +00:00
Zhongxing Xu be36ecbb60 Fix pr6293. If ptr is NULL, no operation is preformed.
llvm-svn: 96154
2010-02-14 06:49:48 +00:00
John McCall 38200b081a Improve the diagnostic given when referring to a tag type without a tag (in C)
or that's been hidden by a non-type (in C++).

The ideal C++ diagnostic here would note the hiding declaration, but this
is a good start.

llvm-svn: 96141
2010-02-14 01:03:10 +00:00
Anders Carlsson 258a1e35e8 Improve support for non-virtual 'this' pointer adjustments. With this, it should be possible to use the new vtable layout code for all class hierarchies that do not involve virtual bases.
llvm-svn: 96137
2010-02-14 00:16:19 +00:00
Anders Carlsson d3adb0ced9 Add basic support for simple non-virtual 'this' pointer adjustments.
llvm-svn: 96136
2010-02-13 23:40:17 +00:00
Anders Carlsson e75aaa97b3 Start laying out secondary vtables.
llvm-svn: 96123
2010-02-13 22:05:23 +00:00
Anders Carlsson c1290adab7 Don't make return adjustments for pure virtual member functions.
llvm-svn: 96120
2010-02-13 21:16:54 +00:00
Anders Carlsson cf5a882da1 Handle virtual bases in return adjustment types.
llvm-svn: 96119
2010-02-13 21:07:32 +00:00
Anders Carlsson 6a6cbfc55f More work on covariant return types. We now handle non-virtual adjustments fine.
llvm-svn: 96114
2010-02-13 20:11:51 +00:00
Charles Davis 4ea31ab369 Emit the 'alignstack' LLVM function attribute when we encounter a function
marked 'force_align_arg_pointer'. Almost there; now all I need to do is finish
up the backend.

llvm-svn: 96100
2010-02-13 15:54:06 +00:00
Chandler Carruth 6b4756a224 Skip implicit instantiation of templated variables where a more recent
redeclaration provides an explicit instantiation or is invalid.

llvm-svn: 96097
2010-02-13 10:17:50 +00:00
Douglas Gregor 04922cbb46 Fix a fiendinshly fun little type-canonicalization bug, where we were
rebuilding a typename type terminating in a template-id (with
dependent template name, naturally) as a TypenameType when, because
its context could be fully resolved, we should have been building it
as a QualifiedNameType. Fixes PR6268.

llvm-svn: 96084
2010-02-13 06:05:33 +00:00
Douglas Gregor af050cb73a Permit the use of typedefs of class template specializations in
qualified declarator-ids. This patch is actually due to Cornelius;
fixes PR6179.

llvm-svn: 96082
2010-02-13 05:23:25 +00:00
Ted Kremenek 1a6672a3d4 Enhance RegionStore::InvalidateRegions() to correctly invalidate bindings
by scanning through the values of LazyCompoundVals.

llvm-svn: 96067
2010-02-13 01:52:33 +00:00
Eli Friedman d5c9399696 Fix for PR6274: teach constant folding to evaluate __builtin_expect.
llvm-svn: 96054
2010-02-13 00:10:10 +00:00
Douglas Gregor 8cdbe64de4 Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.

llvm-svn: 96044
2010-02-12 23:44:20 +00:00
Douglas Gregor 98c1018337 Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.

llvm-svn: 96024
2010-02-12 22:17:39 +00:00
Fariborz Jahanian 5ec502e35b Complain if block-literal expression's parameter name is
missing (in c/objc mode). Fixes radar 7528255.

llvm-svn: 96017
2010-02-12 21:53:14 +00:00
Chris Lattner 5647d3192c fix a bug in SourceManager::getInstantiationLocSlowCase, where
we'd add an offset from the spelling location space to the 
instantiation location, which doesn't make sense and would
lead up to the text diagnostics crashing when presented with
non-sensical locations.

This fixes rdar://7597492, a crash on 255.vortex.

llvm-svn: 96004
2010-02-12 19:31:35 +00:00
Fariborz Jahanian dc68f9539c Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).

llvm-svn: 96003
2010-02-12 19:27:33 +00:00
Anders Carlsson 0760481f26 Fix a refacto that broke the clang-on-clang build.
llvm-svn: 95994
2010-02-12 18:14:46 +00:00
Fariborz Jahanian a459c4453d Fixes a rewriter bug rewriting function decl.
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.

llvm-svn: 95992
2010-02-12 17:52:31 +00:00
Chris Lattner aa1cccbbef Fix PR6282: the include guard optimization cannot happen if the
guard macro is already defined for the first occurrence of the
header.  If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.

llvm-svn: 95972
2010-02-12 08:03:27 +00:00