Commit Graph

16790 Commits

Author SHA1 Message Date
Ted Kremenek 89e53fddb8 Add FIXME.
llvm-svn: 84696
2009-10-20 23:48:29 +00:00
Ted Kremenek 8aed49000d Use llvm::OwningPtr in CFGBuilder, fixing a leak on an error path.
llvm-svn: 84695
2009-10-20 23:46:25 +00:00
Fariborz Jahanian e4d94cee05 Code-gen for CXXZeroInitValueExpr AST passed
as argument to a function call. Removes a FIXME.

llvm-svn: 84694
2009-10-20 23:29:04 +00:00
Anders Carlsson b68b028a02 Change ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase yet because FixOverloadedFunctionReference needs to be updated too. Doug, plz review.
llvm-svn: 84693
2009-10-20 22:53:47 +00:00
Anders Carlsson 5789c497a0 Fix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.
llvm-svn: 84686
2009-10-20 22:07:59 +00:00
Ted Kremenek d45ff6cced Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.

llvm-svn: 84684
2009-10-20 21:39:41 +00:00
Fariborz Jahanian 9559ced10b Updated, we support == and != builtins for member pointers.
llvm-svn: 84679
2009-10-20 21:10:15 +00:00
Fariborz Jahanian 00c6d13dce Changes to reflect more pointer-to-member support.
llvm-svn: 84670
2009-10-20 20:31:50 +00:00
Mike Stump 38382028c7 For now, we need to have the llvm type of the block pointer remain as
it was.  Fixes codegen bug introduced yesterday.

llvm-svn: 84668
2009-10-20 20:30:01 +00:00
Fariborz Jahanian ac741ffd44 Moved comment to its proper place in my last patch.
llvm-svn: 84662
2009-10-20 20:07:35 +00:00
Fariborz Jahanian 9a587b0111 Patch implements ranking conversions between member pointers [over.ics.rank]
llvm-svn: 84660
2009-10-20 20:04:46 +00:00
Devang Patel e21912d1ae Do not eagerly cache DITypes because it allows real struct type to be shadowed by forward declared struct type.
llvm-svn: 84659
2009-10-20 19:55:01 +00:00
Daniel Dunbar f4534ee0a3 Driver: If unable to find the gcc tool chain, try the next OS rev.
llvm-svn: 84656
2009-10-20 19:25:43 +00:00
Devang Patel e4f2b2a8ac Encode global variable name in debug info.
llvm-svn: 84653
2009-10-20 18:26:30 +00:00
Daniel Dunbar 710a80d3ba Add missing semi-colon.
llvm-svn: 84650
2009-10-20 18:07:06 +00:00
Fariborz Jahanian b14d70413f Changed text of warning in my last patch.
Related to radar:
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

llvm-svn: 84647
2009-10-20 17:24:11 +00:00
Edward O'Callaghan 462e4ab4ac Bring Darwin into the switch-case statement instead of its own if for readability.
llvm-svn: 84646
2009-10-20 17:22:50 +00:00
Fariborz Jahanian 040d75d9b6 Issue warning if method body starts with a semicolon.
Fixes 
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

llvm-svn: 84645
2009-10-20 16:39:13 +00:00
Steve Naroff bb4568a37d Add an example to help claify the process/assumptions...
llvm-svn: 84642
2009-10-20 16:36:34 +00:00
Steve Naroff 531e284064 - Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.
- Remove clang_wantOnlyLocalDeclarations().

- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().

- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.

llvm-svn: 84634
2009-10-20 14:46:24 +00:00
Eli Friedman 06ed2a5c94 Remove default argument for ImpCastExprToType. Add appropriate argument
to all callers.  Switch a few other users of CK_Unknown to proper cast 
kinds.

Note that there are still some situations where we end up with 
CK_Unknown; they're pretty easy to find with grep. There 
are still a few missing conversion kinds, specifically 
pointer/int/float->bool and the various combinations of real/complex 
float/int->real/complex float/int.

llvm-svn: 84623
2009-10-20 08:27:19 +00:00
Ted Kremenek 2e385f9319 Call 'clear()' in ~RopePieceBTreeLeaf(), decrementing the reference
counts of the bufffers referened by the RopePieces in
RopePieceBTreeLeaf.  This (I believe) corrently fixes the leak I meant
to fix in r84601 (which ended up causing an overrelease).

llvm-svn: 84615
2009-10-20 06:31:34 +00:00
Douglas Gregor a5cb6da0cd Handle substitutions into the "first qualifier in scope" of a
qualified member access expression (e.g., t->U::member) when that
first qualifier refers to a template parameters.

llvm-svn: 84612
2009-10-20 05:58:46 +00:00
Ted Kremenek 988c5811ee Revert 84601. Looks like it was causing failures on some systems.
llvm-svn: 84610
2009-10-20 05:53:05 +00:00
Ted Kremenek cbd395c898 BumpVectorContext: Use 'unsigned' integer type with PointerIntUnion instead of bool to keep it clear that we are reasoning about an unsigned integer with a single bit.
llvm-svn: 84607
2009-10-20 05:49:17 +00:00
Chris Lattner bd19b18100 Implement PR5242: don't desugar a type more than once in a diagnostic. This
implements a framework that allows us to use information about previously
substituted values to simplify subsequent ones.  Maybe this would be useful
for C++'y stuff, who knows.  We now get:

t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
  return (size_t) 0 + (size_t) 0;
         ~~~~~~~~~~ ^ ~~~~~~~~~~

on the testcase.  Note that size_t is only aka'd once.

llvm-svn: 84604
2009-10-20 05:36:05 +00:00
Chris Lattner c243f299ce teach FormatDiagnostic to aggregate previously formatted arguments and
pass them down into the ArgToStringFn implementation.  This allows 
redundancy across operands to a diagnostic to be eliminated.

This isn't used yet, so no functionality change.

llvm-svn: 84602
2009-10-20 05:25:22 +00:00
Ted Kremenek 2f9876cf7c Fix a reference count imbalance in RewriteRope::MakeRopeString().
This was causing a ton of memory to be leaked when using HTML
diagnostics with the static analyzer (on large files with many errors).

llvm-svn: 84601
2009-10-20 05:25:11 +00:00
Chris Lattner dac91470d7 code cleanup, convert if tree to switch etc.
llvm-svn: 84599
2009-10-20 05:12:36 +00:00
Mike Stump d015328f15 Refine the type of the first parameter to block invoke functions.
WIP.  I have yet to find the magic incantation to get the structure
type to be defined.  If someone has a pointer, love to hear it.

llvm-svn: 84590
2009-10-20 02:12:22 +00:00
Anders Carlsson b9e71d9fd1 Force triple for test.
llvm-svn: 84589
2009-10-20 01:52:47 +00:00
Ted Kremenek 481c121ab5 RegionStore: Use the *default* binding (instead of the *direct* binding) of an Objective-C object
region when doing lazy value retrieval of an ivar.

This fixes: <rdar://problem/7312221>

llvm-svn: 84584
2009-10-20 01:20:57 +00:00
Ted Kremenek 90c953e98f retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start before '_' when determining Cocoa fundamental rule.
Fixes: <rdar://problem/7265711>
llvm-svn: 84569
2009-10-20 00:13:00 +00:00
Fariborz Jahanian a4a9334a50 Builtin candidate minimization for
<<=, >>= and the rest.

llvm-svn: 84568
2009-10-20 00:04:40 +00:00
Ted Kremenek e28968828b Fix inverted preprocessor guard, and fix the resulting compiler error that was unmasked.
llvm-svn: 84555
2009-10-19 22:27:32 +00:00
Ted Kremenek 02b319ce18 Really fix <rdar://problem/7312058> by adding a 'displayDiagnostics' option to
clang_createTranslationUnit() and clang_createTranslationUnitFromSourceFile(). The user can now
specify if the diagnostics from Clang are printed to stderr or are silenced completely. We can
obviously evolve this API to be more general in the future.

Note: Added a FIXME since I wasn't certain what was the best way to redirect to something analogous
to '/dev/null' on Windows.

llvm-svn: 84548
2009-10-19 22:15:09 +00:00
Douglas Gregor c59e56190e Parse a simple-template-id following a '~' when calling a destructor, e.g.,
t->~T<A0, A1>()

Fixes PR5213.

llvm-svn: 84545
2009-10-19 22:04:39 +00:00
Ted Kremenek 428c637ada The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit to specify
alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding
DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object
is destroyed.

The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences
diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes
<rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients.

llvm-svn: 84539
2009-10-19 21:44:57 +00:00
Fariborz Jahanian b9e8c42ee6 Add the built-in candidate set reduction hueristic
to '+=', '-=', '*=' and '/=' builtin operators and
fixes a logic bug exposed by doing this.

llvm-svn: 84538
2009-10-19 21:30:45 +00:00
Ted Kremenek 9dd89ba393 Re-order includes so that the logic involving '#ifdef LLVM_ON_WIN32' appears after the main #includes. The ultimate solution is to just use LLVM-portable methods in llvm/System.
llvm-svn: 84534
2009-10-19 21:17:25 +00:00
Fariborz Jahanian 996a6aa3f1 Copy conversion of an expression to its base class
is a standard convesion and not a user-defined
conversion.

llvm-svn: 84525
2009-10-19 19:18:20 +00:00
Anders Carlsson 0999aafda5 Handle emitting the assignment operator when the lhs is a reference. Fixes PR5227.
llvm-svn: 84518
2009-10-19 18:28:22 +00:00
Anders Carlsson 027732b5b9 Set the cast kind to CK_NoOp for C-style casts that are really const casts. Fixes PR5248.
llvm-svn: 84514
2009-10-19 18:14:28 +00:00
Steve Naroff 505fb84ed9 Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.
Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).

llvm-svn: 84499
2009-10-19 14:34:22 +00:00
Steve Naroff 2f78a6f368 Change indenting for case/compound statements to conform to the rest of clang.
llvm-svn: 84498
2009-10-19 13:41:39 +00:00
Benjamin Kramer b625a13c79 CIndex: make variable non-static to avoid potential race conditions, per
Daniel's comment.

llvm-svn: 84484
2009-10-19 10:20:24 +00:00
Daniel Dunbar 28a24fdbbc Workaround a bug exposed by the FileCheckify of message-length.c, the caret end
column computation isn't correct and could exceed the line length, which
resulted in a buffer overflow later.
 - Chris, is there a better way for this code to compute the final column used
   by the caret?

llvm-svn: 84475
2009-10-19 09:11:21 +00:00
Edward O'Callaghan f208b55825 AuroraUX toolchain should call GNU assembler not the Solaris assembler.
llvm-svn: 84469
2009-10-19 07:02:08 +00:00
Chris Lattner 2c02111000 convert this to FileCheck, PR5232
llvm-svn: 84466
2009-10-19 06:45:49 +00:00
Daniel Dunbar d238681113 Avoid std::string concatenation.
llvm-svn: 84458
2009-10-19 01:21:19 +00:00