Commit Graph

17888 Commits

Author SHA1 Message Date
Fariborz Jahanian ca3566fc20 Fix scoping of method declarations and issue
warning when same parameter name used multiple times.
// rdar://8877730

llvm-svn: 125229
2011-02-09 22:20:01 +00:00
Peter Collingbourne 5eec5f0422 Parse: add support for parsing CUDA kernel calls
llvm-svn: 125219
2011-02-09 21:12:02 +00:00
Peter Collingbourne c1270f51fa Lexer: add CUDA kernel call tokens
llvm-svn: 125218
2011-02-09 21:08:21 +00:00
Peter Collingbourne 41f8546233 AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actions
llvm-svn: 125217
2011-02-09 21:07:24 +00:00
Peter Collingbourne 9e2c81f00a AST, Sema, Serialization: keep track of cudaConfigureCall
llvm-svn: 125216
2011-02-09 21:04:32 +00:00
Devang Patel 84d40a431f Do not emit AT_MIPS_linkage_name for Objective-C method static variable i.
llvm-svn: 125210
2011-02-09 19:16:38 +00:00
Douglas Gregor 1388a89999 Finish up the diagnostic client before we've torn down the ASTReader,
since the diagnostic client might poke at source locations that have
not yet been deserialized.

llvm-svn: 125204
2011-02-09 18:47:31 +00:00
Daniel Dunbar 0bb0331d95 Driver/Frontend: Wire up -mregparm=.
llvm-svn: 125201
2011-02-09 17:54:19 +00:00
Nick Lewycky bae992ffd9 Non-void functions need to return some value.
llvm-svn: 125185
2011-02-09 08:42:57 +00:00
John McCall f75152fb9f Give these little helper functions definitions so that newer gccs stop
complaining.

llvm-svn: 125184
2011-02-09 08:31:17 +00:00
John McCall bd06678921 Remove vtables from the Stmt hierarchy; this was pretty easy as
there were only three virtual methods of any significance.

The primary way to grab child iterators now is with
  Stmt::child_range children();
  Stmt::const_child_range children() const;
where a child_range is just a std::pair of iterators suitable for
being llvm::tie'd to some locals.  I've left the old child_begin()
and child_end() accessors in place, but it's probably a substantial
penalty to grab the iterators individually now, since the
switch-based dispatch is kindof inherently slower than vtable
dispatch.  Grabbing them together is probably a slight win over the
status quo, although of course we could've achieved that with vtables, too.

I also reclassified SwitchCase (correctly) as an abstract Stmt
class, which (as the first such class that wasn't an Expr subclass)
required some fiddling in a few places.

There are somewhat gross metaprogramming hooks in place to ensure
that new statements/expressions continue to implement
getSourceRange() and children().  I had to work around a recent clang
bug;  dgregor actually fixed it already, but I didn't want to
introduce a selfhosting dependency on ToT.

llvm-svn: 125183
2011-02-09 08:16:59 +00:00
Devang Patel 19ba2b4d6e Emit debug info for objc_selector.
llvm-svn: 125163
2011-02-09 03:15:05 +00:00
Douglas Gregor 2575631c0f When IRgen refers to a function declaration that is not a definition,
and we later find the definition, make sure that we add the definition
(not the declaration) to the list of deferred definitions to
emit. Fixes PR8864.

Thanks to Nick Lewycky for testing this	patch out

llvm-svn: 125157
2011-02-09 02:03:05 +00:00
Ken Dyck c8ae55050d Convert RecordLayout::Size to CharUnits from bits. No changes to
functionality intended.

llvm-svn: 125156
2011-02-09 01:59:34 +00:00
Ted Kremenek a40f8ebc83 static analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes.
The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain
practically no difference between the predecessor and successor nodes.  For example, if
the state is different between a predecessor and a node, the node is left in.  Only for
the 'environment' component of the state do we not care if the ExplodedNodes are different.
This paves the way for future optimizations where we can reclaim the environment objects.

llvm-svn: 125154
2011-02-09 01:27:33 +00:00
John McCall f4cd4f94d9 NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.
Also, reorganize and make very explicit the logic for determining
the value kind and type of a referenced declaration.

llvm-svn: 125150
2011-02-09 01:13:10 +00:00
Devang Patel 14524e0f24 If an aggregate argument is passed indirectly because it has non trivial
destructor or copy constructor than let debug info know about it.

Radar 8945514.

llvm-svn: 125142
2011-02-09 00:37:30 +00:00
Ted Kremenek 1953f97ac9 analyzer, retain/release checker: Remove hack where objects passed in message to 'self' are no longer tracked.
llvm-svn: 125130
2011-02-08 22:54:26 +00:00
Rafael Espindola c6236065b7 Update for API change.
llvm-svn: 125129
2011-02-08 22:44:16 +00:00
John McCall 7a198cef04 When checking the 'weak' and 'weakref' attributes, look for non-external
linkage rather than the presence of the 'static' storage class specifier.
Fixes rdar://problem/8814626.

llvm-svn: 125126
2011-02-08 22:35:49 +00:00
Fariborz Jahanian 701f094afb Fix an IRGen bug in property setter calls when
setter and getter types mismatch. // rdar://8966864

llvm-svn: 125125
2011-02-08 22:33:23 +00:00
Argyrios Kyrtzidis fa0734ec4f [analyzer] Move the files in lib/StaticAnalyzer to lib/StaticAnalyzer/Core.
Eventually there will also be a lib/StaticAnalyzer/Frontend that will handle initialization and checker registration.
Yet another library to avoid cyclic dependencies between Core and Checkers.

llvm-svn: 125124
2011-02-08 22:30:36 +00:00
Argyrios Kyrtzidis 4975170267 [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.cpp -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.cpp
llvm-svn: 125123
2011-02-08 22:30:15 +00:00
Argyrios Kyrtzidis f410a6299f [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> lib/StaticAnalyzer/Checkers/ExperimentalChecks.h
llvm-svn: 125122
2011-02-08 22:30:11 +00:00
Argyrios Kyrtzidis f99d595cfd [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineInternalChecks.h -> lib/StaticAnalyzer/Checkers/InternalChecks.h
llvm-svn: 125121
2011-02-08 22:30:02 +00:00
Douglas Gregor 92a96f5c32 Split the serialized representation for the detailed preprocessing
record away from the core processor record. The tangling of these two
data structures led to some inefficiencies (e.g., deserializing all
of the detailed preprocessing record when we didn't need it, such as
while performing code completion) along with some unnecessary
ugliness.

llvm-svn: 125117
2011-02-08 21:58:10 +00:00
Peter Collingbourne 3a34725ed1 AST: support for pre-arg expressions on CallExpr subclasses
llvm-svn: 125115
2011-02-08 21:18:02 +00:00
Peter Collingbourne 4b279a033b StmtPrinter: factor out arg printing code to PrintCallArgs
llvm-svn: 125114
2011-02-08 21:17:54 +00:00
Benjamin Kramer 1a648d1930 Allow multiple -B prefixes. Patch by Joerg Sonnenberger.
llvm-svn: 125111
2011-02-08 20:31:42 +00:00
John McCall d396b97c5a Clear the linkage cache recursively. Fixes PR8926.
llvm-svn: 125104
2011-02-08 19:01:05 +00:00
Argyrios Kyrtzidis 898fdbf82d In Sema::CheckShadow, get the DeclContext from the variable that we are checking
instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them.

Fixes http://llvm.org/PR9160 & rdar://problem/8966163.

llvm-svn: 125097
2011-02-08 18:21:25 +00:00
Fariborz Jahanian 87967425f9 Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter. 
// rdar://8962253

llvm-svn: 125094
2011-02-08 18:05:59 +00:00
Douglas Gregor 0beaec05af Update the writing of the block-information block in the AST file
format, so that llvm-bcanalyzer knows about all of the various record
kinds.

llvm-svn: 125086
2011-02-08 16:34:17 +00:00
John McCall ad7c5c1657 Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class.  Minor other refactorings.

Fixed a few address-space bugs while I was there.

llvm-svn: 125085
2011-02-08 08:22:06 +00:00
John McCall b0a3ecb41c Extend the const capture optimization to C++ record types with no
mutable fields and with trivial destructors and copy constructors.

llvm-svn: 125073
2011-02-08 03:07:00 +00:00
Douglas Gregor a57a66e8d0 Sema::MaybeBindToTemporary() shouldn't treat any expression returning
a glvalue as a temporary. Previously, we were enumerating all of the
cases that coul return glvalues and might be called with
Sema::MaybeBindToTemporary(), but that was gross and we missed the
Objective-C property reference case.

llvm-svn: 125070
2011-02-08 02:14:35 +00:00
Ken Dyck bec0285d7f Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
functionality intended.

llvm-svn: 125069
2011-02-08 02:02:47 +00:00
John McCall 653dac4b0a dgregor accidentally killed this assert, but on investigation, it can fire
on invalid code and we don't really care, so kill it harder.

llvm-svn: 125068
2011-02-08 01:59:10 +00:00
Fariborz Jahanian 14889fc671 Support for objc use of property-dot syntax as receiver
in liu of a class method getter. objc++ uses a different
code path and is more involved (TBD).

llvm-svn: 125061
2011-02-08 00:23:07 +00:00
John McCall 93be3f75cc When copy-capturing values for a nested capture, use a BlockDeclRefExpr.
llvm-svn: 125021
2011-02-07 18:37:40 +00:00
John McCall 351762cda2 A few more tweaks to the blocks AST representation:
- BlockDeclRefExprs always store VarDecls
  - BDREs no longer store copy expressions
  - BlockDecls now store a list of captured variables, information about
    how they're captured, and a copy expression if necessary
    
With that in hand, change IR generation to use the captures data in       
blocks instead of walking the block independently.        

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.

llvm-svn: 125005
2011-02-07 10:33:21 +00:00
Anton Yartsev 85129b8a86 pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)
llvm-svn: 125000
2011-02-07 02:17:30 +00:00
Anders Carlsson e866d44417 Fix self-host; if a thunk already exists and has available_externally linkage, we should change its linkage instead of asserting.
llvm-svn: 124986
2011-02-06 20:09:44 +00:00
Anders Carlsson 8b02183ff3 When building with optimizations, emit thunks with available_externally linkage so devirtualized function calls can also be de-thunked.
llvm-svn: 124984
2011-02-06 18:31:40 +00:00
Anders Carlsson fe8a9939f9 Simplify thunks code.
llvm-svn: 124983
2011-02-06 17:15:43 +00:00
Douglas Gregor 7115aee109 Add a __has_feature check for default template arguments in function
templates, a C++0x feature.

llvm-svn: 124973
2011-02-05 20:35:30 +00:00
Douglas Gregor 606c4ac325 Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behind it so
that we can provide proper uniquing based on inodes. This helps keep
the file manager much more consistent.

To take advantage of this when reparsing files in libclang, we disable
the use of the stat() cache when reparsing or performing code
completion, since the stat() cache is very likely to be out of date in
this use case.

llvm-svn: 124971
2011-02-05 19:42:43 +00:00
Sebastian Redl 0890502f44 Basic implementation of inherited constructors. Only generates declarations, and probably only works for very basic use cases.
llvm-svn: 124970
2011-02-05 19:23:19 +00:00
Anders Carlsson 73f97534b0 Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we
won't assert when building a thunk for an implicit virtual member function that is not marked used.

llvm-svn: 124967
2011-02-05 18:48:55 +00:00
Argyrios Kyrtzidis dd03d8ddaa [analyzer] Fix a false positive of the 'self' initialization checker.
A common pattern in classes with multiple initializers is to put the
subclass's common initialization bits into a static function that receives
the value of 'self', e.g:

   if (!(self = [super init]))
     return nil;
   if (!(self = _commonInit(self)))
     return nil;

It was reported that 'self' was not set to the result of [super init].
Until we can use inter-procedural analysis, in such a call, transfer the
ObjCSelfInitChecker flags associated with 'self' to the result of the call.

Fixes rdar://8937441 & http://llvm.org/PR9094

llvm-svn: 124940
2011-02-05 05:54:53 +00:00