Commit Graph

11962 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
Chris Lattner e983eae273 add two aliases for SSE functions we already have, fixing PR6316.
llvm-svn: 96363
2010-02-16 18:21:25 +00:00
Chris Lattner db5c16bc9c add freebsd/ppc[64] support, patch by Nathan Whitehorn, PR6318
llvm-svn: 96362
2010-02-16 18:14:57 +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
Anders Carlsson 13f0f66223 Handle layout of vtables for virtual bases.
llvm-svn: 96355
2010-02-16 16:49:35 +00:00
Anders Carlsson b716a543c9 Move some code around in preparation for virtual base vtables.
llvm-svn: 96354
2010-02-16 16:26:28 +00:00
Fariborz Jahanian e1ff123214 Fix rewriter bug when function call inside block with block parameter
causes C++ compile error (radar 7651312).

llvm-svn: 96352
2010-02-16 16:21:26 +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
Benjamin Kramer 64aae50539 Rename argument so the name reflects what it's doing.
llvm-svn: 96342
2010-02-16 10:07:31 +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
Anders Carlsson dc2dba306c More work on the new layout code.
llvm-svn: 96328
2010-02-16 04:49:44 +00:00
John McCall 6ce747220a When emitting complete destructors for classes with virtual bases, compute
the offset to the virtual bases statically inside of relying on the virtual
base offsets in the object's vtable(s).  This is both more efficient and
sound against the destructor's manipulation of the vtables.

Also extract a few helper routines.

Oh and we seem to pass all tests with an optimized clang now.

llvm-svn: 96327
2010-02-16 04:15:37 +00:00
John McCall 1e3715acc3 White-list comma expressions with the literal 0 as their RHS against
unused-value warnings.  This is a common macro idiom.

llvm-svn: 96326
2010-02-16 04:10:53 +00:00
John McCall 81e38507bd Make the various type-decl Types (and their associated ASTContext routines)
accept const decls.

llvm-svn: 96325
2010-02-16 03:57:14 +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
Daniel Dunbar 1951192213 ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support this as an argument.
llvm-svn: 96316
2010-02-16 01:55:04 +00:00
Daniel Dunbar 7f21a7f7ce ASTUnit::LoadFromCompilerInvocation - Take ownership of the provided invocation.
llvm-svn: 96315
2010-02-16 01:54:54 +00:00
Daniel Dunbar e922d9bdf0 CompilerInstance: Move LLVMContext member out of constructor.
llvm-svn: 96314
2010-02-16 01:54:47 +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 9503c46a2e Don't import __va_list_tag or __builtin_va_list when merging
llvm-svn: 96299
2010-02-16 00:04:46 +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
Ted Kremenek d51217e968 Convert GRExprEngine's handling of ObjCMessageExprs to use a worklist
to evaluate arguments.

llvm-svn: 96293
2010-02-15 23:02:46 +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 522e22d352 Tell ASTMerge to merge every declaration it sees, rather than cherry-picking those declarations that we know will work.
llvm-svn: 96280
2010-02-15 22:05:17 +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 02d964babe Fix a broken rewritin of @implementation keyword.
(fixes radar 7649577).

llvm-svn: 96270
2010-02-15 21:11:41 +00:00
John McCall 5f5cbf5d1d Optimize the implementation of IdDeclInfo pooling in the IdentifierResolver.
llvm-svn: 96253
2010-02-15 19:38:00 +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
Duncan Sands 998f9d975b Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!

llvm-svn: 96224
2010-02-15 16:14:01 +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
Zhongxing Xu ec345b7ecb Simplify code. If we can reach here, the base must be virtual.
llvm-svn: 96211
2010-02-15 04:28:35 +00:00
John McCall 7538eec67b When emitting an aggregate into a temporary, make sure we set the alignment
on the alloca.

The fact that codegen makes this class of bug so wonderfully easy to make is
embarrassing.

llvm-svn: 96204
2010-02-15 01:23:36 +00:00
Ted Kremenek 4ba99bee2a clang::Attr objects should be treated as AST nodes as well by
the LLVMConventionsChecker.

llvm-svn: 96202
2010-02-14 22:58:16 +00:00
Ted Kremenek 4853131459 Add LLVM conventions check that scans for AST elements (types, stmts, decls)
that allocate heap memory.

llvm-svn: 96184
2010-02-14 19:09:13 +00:00
Ted Kremenek 988805c81e Change LLVMConventionsChecker to accept an entire translation unit instead
of operating on each code decl.  This exposes two flaws in AnalysisConsumer
that should eventually be fixed:

(1) It is not possible to associate multiple "actions" with a single
    command line argument.  This will require the notion of an
	"analysis" group, and possibly tablegen support.  (although eventually
    we want to support dynamically loading analyses as well)

(2) AnalysisConsumer may not actually be scanning the declarations in namespaces.
    We'll experiment first in LLVMConventionsChecker before changing the
    behavior in AnalysisConsumer.

llvm-svn: 96183
2010-02-14 19:09:05 +00:00
Ted Kremenek 39df94b00d Rework translation unit actions to actually take an entire translation unit
as imput.

llvm-svn: 96182
2010-02-14 19:08:51 +00:00
Ted Kremenek c968e5e9b9 For the StringRef check, also visit the children of DeclStmts.
llvm-svn: 96181
2010-02-14 19:08:43 +00:00
Ted Kremenek 4806a833a7 Place type-checking static methods at type of file (where they will congregate).
No functionality change.

llvm-svn: 96180
2010-02-14 19:08:36 +00:00
Chris Lattner d0413848cc temporarily revert 96173, it is causing test failures.
llvm-svn: 96176
2010-02-14 18:38:38 +00:00
Sanjiv Gupta 1ef8cdd29b renamed pic16 specifiic macros.
llvm-svn: 96173
2010-02-14 18:20:18 +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
Benjamin Kramer 88ab94e7a3 Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.
llvm-svn: 96164
2010-02-14 14:14:16 +00:00