Commit Graph

8298 Commits

Author SHA1 Message Date
Fariborz Jahanian 7a3f3a0402 Contributed test case for PR7936
by Jean-Daniel Dupas.

llvm-svn: 111700
2010-08-21 00:17:33 +00:00
Fariborz Jahanian e4151b590e patch to support comparison involving
objctive-c pointer conversions. Fixes pr7936.

llvm-svn: 111699
2010-08-21 00:10:36 +00:00
Argyrios Kyrtzidis d32ee89ea2 Fix an issue with writing to PCH another included PCH, introduced by the "using an AST on-disk hash table for name lookup" commit.
When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts
may be incomplete, since we now lazily deserialize the visible decls of a particular name.
Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables
of DeclContexts before writing them out.

llvm-svn: 111698
2010-08-20 23:35:55 +00:00
Benjamin Kramer 6f35f3cd80 Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead. This matches GCC's behavior.
llvm-svn: 111692
2010-08-20 23:00:03 +00:00
Nick Lewycky fe71238b8d Add a workaround for PR7947, a crash trying to recover from invalid C++ code.
llvm-svn: 111675
2010-08-20 20:54:15 +00:00
Douglas Gregor e3b3464d4e Fix a major regression with value-initialization of class types with
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.

llvm-svn: 111650
2010-08-20 16:57:37 +00:00
Chris Lattner 9052c35479 fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC.  GCC is changing this in 
a series of their own PRs (e.g. 41323).

llvm-svn: 111637
2010-08-20 16:08:33 +00:00
Douglas Gregor 5be1eb8daf Revert r111609, which is failing its new test.
llvm-svn: 111611
2010-08-20 03:26:10 +00:00
John McCall a189f2eb0a Detect efforts to declare a template member friend and explicitly ignore them.
Avoids a crash.

llvm-svn: 111609
2010-08-20 01:40:01 +00:00
Jordy Rose 796b5122d9 Handle nested compound values in BindArray for multidimensional arrays. Fixes PR7945.
llvm-svn: 111602
2010-08-20 01:05:59 +00:00
Douglas Gregor b97b666c47 When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.

llvm-svn: 111597
2010-08-20 00:59:43 +00:00
John McCall f834bcd659 Mangle explicit template arguments in dependent or overloaded names.
llvm-svn: 111591
2010-08-20 00:17:19 +00:00
Douglas Gregor 7b02b583b2 When we decide not to reuse a precompiled preamble, clear out the
previous precompiled preamble completely. Fixes <rdar://problem/8330950>.

llvm-svn: 111590
2010-08-20 00:02:33 +00:00
Daniel Dunbar 77af1c564e libclang: Execute clang_codeCompleteAt() inside a crash recovery context.
- Test case is disabled for now, because something isn't write with file
   remapping.

llvm-svn: 111581
2010-08-19 23:44:10 +00:00
John McCall 13d031593e Correctly instantiate templates with non-type template arguments that
are local externs.  Fixes <rdar://problem/8302138>.

llvm-svn: 111570
2010-08-19 23:06:02 +00:00
Daniel Dunbar 438c7724f9 Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
 - Reparsing is still very crashy / weird, so I had to sprinkle random code into
   the remapped input to get it to do what I want (i.e., crash!).

llvm-svn: 111550
2010-08-19 19:40:40 +00:00
Eli Friedman 3c93e3dae7 Test for PR7888.
llvm-svn: 111545
2010-08-19 19:13:24 +00:00
Douglas Gregor c0afc67608 We don't actually need to check the implicit object argument's
conversion a second time for a conversion candidate (with the real
acting context), because the only problems we would find are access or
ambiguity issues that won't be diagnosed until we pick this
candidate. Add a test case to prove it to myself.

llvm-svn: 111526
2010-08-19 17:02:01 +00:00
Daniel Dunbar e6a39d33e5 CrashRecovery: Disable the reparse test for now while I investigate, it goes
bonkers sometimes.

llvm-svn: 111523
2010-08-19 16:40:14 +00:00
Douglas Gregor c9ed4681a8 Properly implement the part of C++ [over.match.funcs]p4 that treats
conversion functions as if their acting context were the class that
we're converting from (the implicit object argument's
type). Retroactively tweaking the implicit conversion sequence, as we
were trying to do before, breaks the invariants of that implicit
conversion sequence (e.g., the types and conversions don't match
up). Fixes <rdar://problem/8018274>.

llvm-svn: 111520
2010-08-19 15:57:50 +00:00
Anton Yartsev 583a1cf7b5 support for predicates with bool/pixel arguments
llvm-svn: 111515
2010-08-19 11:57:49 +00:00
Eli Friedman 4202c34539 Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types.  An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.

This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?

llvm-svn: 111512
2010-08-19 04:39:37 +00:00
Anton Yartsev fc83c60755 support for the rest of AltiVec functions with bool/pixel arguments and return values (except predicates)
llvm-svn: 111511
2010-08-19 03:21:36 +00:00
Anton Yartsev 9e96898032 support for vec_perm and all dependent functions (vec_mergeh, vec_mergel, vec_pack, vec_sld, vec_splat) with bool/pixel arguments and return values
llvm-svn: 111509
2010-08-19 03:00:09 +00:00
John McCall 5cf48cd17c On second thought, don't warn about reinterpret_casts under -Wcast-align.
llvm-svn: 111497
2010-08-19 01:19:08 +00:00
Ted Kremenek 50e0105f1c Add warning for functions/blocks that have attribute 'noreturn' but return a non-void result. (<rdar://problem/7562925>)
llvm-svn: 111492
2010-08-19 00:52:13 +00:00
John McCall f733268e7a When deducing the element type of an array, ignore qualifiers if
the context allows us to ignore qualifiers on the array type itself.

llvm-svn: 111486
2010-08-19 00:20:19 +00:00
Daniel Dunbar 79acdd9402 libclang: Put clang_reparseTranslationUnit inside a crash recovery context.
llvm-svn: 111451
2010-08-18 23:09:31 +00:00
Douglas Gregor fb640869ed There is no pointer conversion between to similar types (i.e., same
type ignoring cv-qualifiers). These are qualification
conversions. Fixes PR7934.

llvm-svn: 111428
2010-08-18 21:25:30 +00:00
Tom Care b9933f365e Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified

llvm-svn: 111426
2010-08-18 21:17:24 +00:00
John McCall 78fbb61ed7 Contextual arity is a feature of mangling expressions; kill off
mangleCallExpression.  Also, operator names with unknown arity should
be mangled as binary operators;  this is actually covered by an oddly-
positioned sentence in the ABI document.  Fixes PR7891.

llvm-svn: 111395
2010-08-18 19:18:59 +00:00
Daniel Dunbar 583c3b775e libclang: Put clang_parseTranslationUnit inside a crash recovery context.
llvm-svn: 111387
2010-08-18 18:43:17 +00:00
Douglas Gregor c1a42fdd53 Make sure to add MallocAttr to explicitly-declared operator new/new[]
when -fassume-sane-operator-new. Patch by Tom Jablin!

llvm-svn: 111363
2010-08-18 15:06:25 +00:00
John McCall 8f42893aff Flesh out the test cases a little.
llvm-svn: 111359
2010-08-18 09:58:15 +00:00
John McCall 02db245d5e Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class.  Also, look into templates when doing this.

llvm-svn: 111357
2010-08-18 09:41:07 +00:00
Douglas Gregor caa1bf434d Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.

llvm-svn: 111338
2010-08-18 00:39:00 +00:00
Chris Lattner b1995dffaf Fix PR7889 by generalizing some over specialized code. There is no
reason that this should be limited to simple lvalues.

llvm-svn: 111331
2010-08-18 00:08:27 +00:00
Chris Lattner 00d5141aef fix PR7892, a crash on valid in c++ codegen of __PRETTY_FUNCTION__
llvm-svn: 111330
2010-08-17 23:58:10 +00:00
Fariborz Jahanian 9d7d3d84ac Diagnose if type of iboutletcollection attribute is a builtin type.
llvm-svn: 111324
2010-08-17 23:19:16 +00:00
Argyrios Kyrtzidis beb71b315a Rename -Wunused-method -> -Wunused-member-function.
llvm-svn: 111305
2010-08-17 22:06:44 +00:00
John McCall 6d86202fa7 Whoops. Don't fall through into the overload case when mangling a
dependent call expression.

llvm-svn: 111300
2010-08-17 21:51:21 +00:00
Argyrios Kyrtzidis cad715fb9b Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.
This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.

llvm-svn: 111298
2010-08-17 21:43:11 +00:00
Fariborz Jahanian 798f83239c Diagnose use of iboutletcollection on ivar/property
of non-object types. Radar 8308053.

llvm-svn: 111296
2010-08-17 21:39:27 +00:00
John McCall 815039af77 Implicit decl ref expressions might not have name locations; don't silently
fail to instantiate them.

llvm-svn: 111293
2010-08-17 21:27:17 +00:00
Ted Kremenek 4f2ab5a549 Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.

llvm-svn: 111283
2010-08-17 21:00:06 +00:00
Fariborz Jahanian b5d59b66c2 Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.

llvm-svn: 111275
2010-08-17 20:23:12 +00:00
Douglas Gregor 175ea046ee A member function never has "C" linkage. Fixes <rdar://problem/8318976>.
llvm-svn: 111238
2010-08-17 16:09:23 +00:00
Douglas Gregor 7116a8c19a When generating code completion patterns for method declarations, give
the resulting pattern the appropriate cursor kind of an instance or
class method declaration.

llvm-svn: 111237
2010-08-17 16:06:07 +00:00
Chris Lattner c0a585d63c Implement #pragma push_macro, patch by Francois Pichet!
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Douglas Gregor b0ce9b79ba 1 != I. Fix the formulation of code-completion patterns for
Objective-C method declarations with > 2 parameters.

llvm-svn: 111233
2010-08-17 15:53:35 +00:00