Eli Friedman
55422ad068
Add IRGen support for local variables of reference type.
...
llvm-svn: 72462
2009-05-27 05:39:06 +00:00
Douglas Gregor
5178331379
Initial stab at a generalized operation for determining the
...
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like
typedef T* iterator;
iterator begin();
llvm-svn: 72461
2009-05-27 05:35:12 +00:00
Douglas Gregor
2517f334b4
Don't drop the computed implicit conversions when building a call to
...
overloaded operator[] or overloaded postfix unary operator (++,
--). Thanks to Eli for finding this bug!
llvm-svn: 72460
2009-05-27 05:00:47 +00:00
Eli Friedman
b909bf4937
Add IRGen support for return statements in functions with reference
...
type.
llvm-svn: 72459
2009-05-27 04:56:12 +00:00
Anders Carlsson
4034a95dc8
Handle operator call expressions where the callee is a member function.
...
llvm-svn: 72458
2009-05-27 04:18:27 +00:00
Anders Carlsson
d8b7ae205e
Functions that return references can be rvalues as well.
...
llvm-svn: 72457
2009-05-27 03:37:57 +00:00
Anders Carlsson
4ae70ff9a3
Add support for emitting calls to functions that return references (as lvalues only for now)
...
llvm-svn: 72449
2009-05-27 01:45:47 +00:00
Mike Stump
3e97f3b35d
Fix typo. I also fixed the hard to read case differences, so that no
...
one else is tempted to copy the style, incorrectly.
llvm-svn: 72448
2009-05-27 01:42:21 +00:00
Anders Carlsson
3a9463bfda
Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit an expr.
...
llvm-svn: 72446
2009-05-27 01:22:39 +00:00
Douglas Gregor
408c619afc
Template instantiation for "typeof" for both types and expressions.
...
llvm-svn: 72440
2009-05-26 22:09:24 +00:00
Mike Stump
ec3cbfe8c6
Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
...
llvm-svn: 72439
2009-05-26 22:03:21 +00:00
Douglas Gregor
28ad4b5da1
Make sure that CodeGen sees template instantiations.
...
llvm-svn: 72433
2009-05-26 20:50:29 +00:00
Daniel Dunbar
bee70bd1e7
Use .data() instead of &...[0].
...
- Just SmallVectors this time.
llvm-svn: 72432
2009-05-26 19:40:20 +00:00
Mike Stump
25306cacc6
Esnure that if we have a volatile structure as the destination, that
...
we actually have a destination.
llvm-svn: 72429
2009-05-26 18:57:45 +00:00
Douglas Gregor
31cf12c0a6
When evaluating a VarDecl as a constant or determining whether it is
...
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.
llvm-svn: 72428
2009-05-26 18:54:04 +00:00
Daniel Dunbar
1518b64ddc
When trying to pass an argument on the stack, assume LLVM will do the right
...
thing for non-aggregate types.
- Otherwise we unnecessarily pin values to the stack and currently end up
triggering a backend bug in one case.
- This loose cooperation with LLVM to implement the ABI is pretty ugly.
- <rdar://problem/6918722> [irgen] clang miscompile of many pointer varargs on
x86-64
llvm-svn: 72419
2009-05-26 16:37:37 +00:00
Anders Carlsson
09ac6f21c3
An Obj-C message send expression can never have a reference type.
...
llvm-svn: 72417
2009-05-26 15:22:25 +00:00
Douglas Gregor
a30d046059
Simplify printing of the statistics for types.
...
llvm-svn: 72415
2009-05-26 14:40:08 +00:00
Eli Friedman
5cd659fd32
Fix for PR4140: Add the start of a Linux toolchain (basically, just
...
barely enough to get the given usage of -print-file-name working).
llvm-svn: 72412
2009-05-26 07:52:18 +00:00
Anders Carlsson
00a2759ca9
Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.
...
llvm-svn: 72410
2009-05-26 04:57:27 +00:00
Anders Carlsson
3b70b300b0
A block that returns a reference is an lvalue.
...
llvm-svn: 72409
2009-05-26 02:03:20 +00:00
Eli Friedman
895771aa4b
Handle the edge case of a weak function with incomplete type correctly.
...
Found by code inspection; I haven't seen this in real-world code.
llvm-svn: 72408
2009-05-26 01:22:57 +00:00
Eli Friedman
7ab09572c6
Extend getPreferredTypeAlign to handle _Complex double and long long
...
correctly.
llvm-svn: 72401
2009-05-25 21:27:19 +00:00
Eli Friedman
cf7530ff43
PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
...
left out handling for stuff like (S())++ for the moment.
llvm-svn: 72394
2009-05-25 19:41:42 +00:00
Chris Lattner
23464b8f14
tweak non-null check to put the caret on the function, but underline the
...
argument. This avoids the argument from being silenced when the argument is
the NULL macro, which is defined in a system header. This also makes the output
a bit nicer, e.g.:
t.c:8:3: warning: null passed to a callee which requires a non-null argument
func1(NULL, cp2, i1);
^ ~~~~
vs something like:
t.c:8:10: warning: argument is null where non-null is required
func1(NULL, cp2, i1);
^
llvm-svn: 72393
2009-05-25 18:23:36 +00:00
Chris Lattner
83bd8281e5
Fix a couple of bugs:
...
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
of the # to unknown so that the preprocessor won't try to process it as
a real #. This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
macro to say the definition ends with the foo, not the #.
This is a follow-on fix to r72283, and rdar://6916026
llvm-svn: 72388
2009-05-25 17:16:10 +00:00
Chris Lattner
7ce761d204
improve comment, no functionality change.
...
llvm-svn: 72386
2009-05-25 16:23:08 +00:00
Eli Friedman
2d49c4f98d
Make sure an invalid concatentaion doesn't insert whitespace before
...
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev.
llvm-svn: 72370
2009-05-24 19:25:46 +00:00
Mike Stump
b9f2518626
Propagate volatile for implicit property refernces.
...
llvm-svn: 72353
2009-05-23 23:52:31 +00:00
Mike Stump
9afc476d4a
Propagate volatile around for property references.
...
llvm-svn: 72352
2009-05-23 23:48:13 +00:00
Mike Stump
5e9e61b8d2
Track volatile aggregate copies better. I'm hoping someone else will decide
...
how to get the backend to know that the operation is volatile.
llvm-svn: 72348
2009-05-23 22:29:41 +00:00
Mike Stump
332ec2ce81
Fix thinko, and implement aggregate volatile reads.
...
llvm-svn: 72347
2009-05-23 22:01:27 +00:00
Mike Stump
23abd46b79
More volatile fixes. Can't testcase these yet as ultimately volatile
...
is still ignored.
llvm-svn: 72344
2009-05-23 21:40:07 +00:00
Mike Stump
ca9fc09c61
Collapse a few FIXMEs together and refactor to make fixing the code easier.
...
llvm-svn: 72342
2009-05-23 20:28:01 +00:00
Mike Stump
93700fc988
Add support for volatile RValues.
...
llvm-svn: 72341
2009-05-23 20:21:36 +00:00
Daniel Dunbar
b8fb96905d
Fix use after free, found by Benjamin Kramer.
...
llvm-svn: 72333
2009-05-23 18:55:58 +00:00
Mike Stump
8673657275
One step to fixing up codegen for a=b, where a is a volatile struct.
...
llvm-svn: 72315
2009-05-23 04:13:59 +00:00
Eli Friedman
57406b2783
Add IEEE quad support to DefineFloatMacros.
...
llvm-svn: 72314
2009-05-23 03:50:01 +00:00
Daniel Dunbar
223db1c9e5
Initialize Obj-C GC attributes when emitting BlockDeclRefExprs.
...
- Otherwise we may incorrectly miss generation of some write barriers.
llvm-svn: 72313
2009-05-23 02:49:02 +00:00
Eli Friedman
f98fc352b8
PR4247: Widen the buffer slightly so it can hold all the definitions for
...
PPC double double.
(No testcase because no normal target uses the format at the moment.)
llvm-svn: 72310
2009-05-23 02:03:39 +00:00
Mike Stump
a35af82429
Fix typo.
...
llvm-svn: 72308
2009-05-23 02:02:29 +00:00
Douglas Gregor
4a9f481db9
Template instantiation for qualified declaration reference
...
expressions. We are now missing template instantiation logic for only
three classes of expressions:
- Blocks-related expressions (BlockExpr, BlockDeclRefExpr)
- C++ default argument expressions
- Objective-C expressions
Additionally, our handling of DeclRefExpr is still quite poor, since
it cannot handle references to many kinds of declarations.
As part of this change, converted the TemplateExprInstantiator to use
iteration through all of the expressions via clang/AST/StmtNodes.def,
ensuring that we don't forget to add template instantiation logic for
any new expression node kinds.
llvm-svn: 72303
2009-05-22 23:47:06 +00:00
Douglas Gregor
93fcf93bc6
Template instantiation for the GNU address-of-label extension.
...
llvm-svn: 72301
2009-05-22 23:25:52 +00:00
Douglas Gregor
36fe6901d4
Template instantiation for ExtVectorElementExpr.
...
llvm-svn: 72299
2009-05-22 23:07:44 +00:00
Douglas Gregor
038c338949
Fix lots of PCH crashes caused by the new assertions in
...
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now
runs cleanly (again).
llvm-svn: 72292
2009-05-22 22:45:36 +00:00
Ted Kremenek
92f3d1ff1c
Fix PCH crash caused by new assertions in llvm::SmallVector. Use
...
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.
llvm-svn: 72291
2009-05-22 22:34:23 +00:00
Fariborz Jahanian
88fead8c48
Cannot type cast @selector expressions.
...
llvm-svn: 72284
2009-05-22 21:42:52 +00:00
Daniel Dunbar
0721c2c155
In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
...
non-argument names, pass the tokens through.
llvm-svn: 72283
2009-05-22 21:35:34 +00:00
Douglas Gregor
efe7c393e1
Add a few tests to ensure that member functions of class templates can
...
call other member functions of class templates, including after
template instantiation. No functionality change.
llvm-svn: 72282
2009-05-22 21:26:58 +00:00
Douglas Gregor
a8db954f24
Representation of and template instantiation for member
...
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.
Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.
llvm-svn: 72281
2009-05-22 21:13:27 +00:00
Argyrios Kyrtzidis
f73f2d28a2
The disambiguation process for ambiguous paren expressions is not "side effects free", e.g:
...
(T(*)(int[x+y]));
is an (invalid) paren expression, but "x+y" will be parsed as part of the (rejected) type-id,
so unnecessary Action calls are made for an unused (and possibly leaked) "x+y".
Use a different scheme, similar to parsing inline methods. The parenthesized tokens are cached,
the context that follows is determined (possibly by parsing a cast-expression),
and then we re-introduce the cached tokens into the token stream and parse them appropriately.
llvm-svn: 72279
2009-05-22 21:09:47 +00:00
Argyrios Kyrtzidis
48ce3b553b
The TokenLexer may encounter annotations if the parser enters them using Preprocessor::EnterTokenStream.
...
So check for annotation before using the Token's IdentifierInfo.
llvm-svn: 72278
2009-05-22 21:09:31 +00:00
Fariborz Jahanian
a4404f21d1
This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
...
compiled with -fobjc-sender-dependent-dispatch. This is used in AOP, COP, implementing object
planes, and a few other things.
Patch by David Chisnall.
llvm-svn: 72275
2009-05-22 20:17:16 +00:00
Mike Stump
c63428b192
Fixup codegen for __block int i; i += rhs();. Should also slightly
...
improve codegen in some cases.
llvm-svn: 72273
2009-05-22 19:07:20 +00:00
Daniel Dunbar
adeeb052ad
Don't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
...
- We could just warn about -fno-unit-at-a-time, but in practice people using it
probably aren't going to get what they want out of clang.
Also, use "clang" specified error for unsupported things instead of driver
unsupported error.
llvm-svn: 72272
2009-05-22 19:02:20 +00:00
Daniel Dunbar
499f3f9c5d
x86_64 ABI: Account for sret parameters consuming an integer register.
...
- PR4242.
llvm-svn: 72268
2009-05-22 17:33:44 +00:00
Fariborz Jahanian
db3a4c1388
(Next runtime only) check to see if class implements forwardInvocation method
...
and objects of this class are derived from 'NSProxy'.
Under such conditions, which means that every method possible is
implemented in the class, we should not issue "Method definition not found"
warnings.
llvm-svn: 72267
2009-05-22 17:12:32 +00:00
Argyrios Kyrtzidis
24ad692f30
Some minor comments modifications.
...
There are no unnecessary action calls period (courtesy of the annotation scheme) and too many 'this means'..
llvm-svn: 72263
2009-05-22 15:12:46 +00:00
Sanjiv Gupta
47e296149e
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.
...
llvm-svn: 72261
2009-05-22 13:54:25 +00:00
Argyrios Kyrtzidis
12179bc014
Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate between a parenthesized type-id and
...
a paren expression without considering the context past the parentheses.
Behold:
(T())x; - type-id
(T())*x; - type-id
(T())/x; - expression
(T()); - expression
llvm-svn: 72260
2009-05-22 10:24:42 +00:00
Argyrios Kyrtzidis
5da1f08587
Factor the compound literal parsing out from ParseParenExpression and into a new ParseCompoundLiteralExpression.
...
No functionality change.
llvm-svn: 72259
2009-05-22 10:24:05 +00:00
Argyrios Kyrtzidis
9a9c0f4eff
Modification to ParseParenExpression.
...
Now it parses the cast expression unless 'stopIfCastExpr' is true.
llvm-svn: 72258
2009-05-22 10:23:40 +00:00
Argyrios Kyrtzidis
387a334656
Remove ParseSimpleParenExpression.
...
Embed its functionality into it's only user, ParseCXXCasts.
CXXCasts now get the "actual" expression directly, they no longer always receive a ParenExpr. This is better since the
parentheses are always part of the C++ casts syntax.
llvm-svn: 72257
2009-05-22 10:23:16 +00:00
Argyrios Kyrtzidis
7bd98440b3
Refactor the common code of 'ParseTypeofSpecifier' and 'ParseSizeofAlignofExpression' into a new
...
'ParseExprAfterTypeofSizeofAlignof' method.
llvm-svn: 72256
2009-05-22 10:22:50 +00:00
Argyrios Kyrtzidis
f5cc7ac4d5
Parse typeof-specifier the same way as sizeof/alignof are parsed.
...
-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;
llvm-svn: 72255
2009-05-22 10:22:18 +00:00
Zhongxing Xu
5a187dd21e
Pull EmitRecord() out of loop. It should be called only once.
...
llvm-svn: 72252
2009-05-22 08:38:27 +00:00
Torok Edwin
5b34933b90
Set correct calling convention even if there is a bitcast in the way.
...
This attempts to fix PR4239.
llvm-svn: 72251
2009-05-22 07:25:06 +00:00
Daniel Dunbar
51c7f97bea
(llvm up) Use llvm::Triple for storing target triples.
...
- This commit has some messy stuff in it to extend string lifetimes, but that
will go away once we switch to using the enum'd Triple interfaces.
llvm-svn: 72243
2009-05-22 02:53:45 +00:00
Daniel Dunbar
5bbebfe9bc
Don't rely on getArchName() to return a constant string reference.
...
llvm-svn: 72241
2009-05-22 02:21:04 +00:00
Eli Friedman
7942674be0
A few more tweaks for Solaris; please correct me if it's wrong somehow.
...
llvm-svn: 72240
2009-05-22 01:12:57 +00:00
Daniel Dunbar
58f345ceb1
Add --analyzer-no-default-checks and --analyzer-output options.
...
llvm-svn: 72238
2009-05-22 00:38:15 +00:00
Douglas Gregor
4871c4739d
Improve target support for Solaris.
...
llvm-svn: 72237
2009-05-21 23:51:30 +00:00
Douglas Gregor
1c37d9eed5
Template instantiation for C99 compound literals
...
llvm-svn: 72236
2009-05-21 23:48:18 +00:00
Douglas Gregor
0f9d4003df
Template instantiation for GNU array-range designators.
...
llvm-svn: 72234
2009-05-21 23:30:39 +00:00
Douglas Gregor
ca1aeecd37
Template instantiation for C99 designated initializers, because we
...
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.
llvm-svn: 72233
2009-05-21 23:17:49 +00:00
Douglas Gregor
c2607b9a08
Template instantiation for initializer lists
...
llvm-svn: 72229
2009-05-21 21:38:12 +00:00
Douglas Gregor
122660eb19
Fix CMake build for AST XML dumper
...
llvm-svn: 72228
2009-05-21 21:21:53 +00:00
Mike Stump
aed08f9929
Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhs
...
evaluated first. This can also improve codegen just a bit as we might
have another register to play with for the evaluation of the rhs.
llvm-svn: 72226
2009-05-21 21:05:15 +00:00
Fariborz Jahanian
8c46fec43d
Fixed a warning bug when receiver is an object via
...
setting of NSObject attribute.
llvm-svn: 72225
2009-05-21 21:04:28 +00:00
Douglas Gregor
7f5601e55f
AST XML dump, from Olaf Krzikalla!
...
llvm-svn: 72224
2009-05-21 20:55:50 +00:00
Douglas Gregor
31c7e99401
Template instantiation for unary type traits, e.g., __is_pod
...
llvm-svn: 72220
2009-05-21 18:55:48 +00:00
Fariborz Jahanian
cd1a88da02
Check on null arguments in the presense of nonnull attribute.
...
llvm-svn: 72219
2009-05-21 18:48:51 +00:00
Douglas Gregor
aa85d8221c
Template instantiation for C++ "typeid" expressions.
...
llvm-svn: 72218
2009-05-21 18:34:44 +00:00
Douglas Gregor
728d41bbb9
Template instantiation for C++ throw expressions
...
llvm-svn: 72217
2009-05-21 17:37:52 +00:00
Douglas Gregor
29fe6aeef3
Template instantiation for C++ delete expression
...
llvm-svn: 72216
2009-05-21 17:21:12 +00:00
Douglas Gregor
269f0b1b69
Merge the ASTVector and ASTOwningVector templates, since they offered
...
redundant functionality. The result (ASTOwningVector) lives in
clang/Parse/Ownership.h and is used by both the parser and semantic
analysis. No intended functionality change.
llvm-svn: 72214
2009-05-21 16:25:11 +00:00
Sebastian Redl
027de2adcd
Avoid using the built-in type checker for assignment in C++ when classes are involved. Patch by Vyacheslav Kononenko.
...
llvm-svn: 72212
2009-05-21 11:50:50 +00:00
Jay Foad
7d0479f2c2
Use v.data() instead of &v[0] when SmallVector v might be empty.
...
llvm-svn: 72210
2009-05-21 09:52:38 +00:00
Fariborz Jahanian
a6bed8370e
Minor refactoring. Uses an existing API to lookup a class method.
...
llvm-svn: 72203
2009-05-21 01:03:45 +00:00
Douglas Gregor
d0fefbafd1
Template instantiation for C++ "new" expressions.
...
llvm-svn: 72199
2009-05-21 00:00:09 +00:00
Douglas Gregor
920e3af495
Fix template instantiation for compound statements so that it properly
...
passes the "isStmtExpr" flag, to suppress warnings about unused
expressions.
llvm-svn: 72190
2009-05-20 22:57:03 +00:00
Ted Kremenek
1036912118
Add special cases to retain checker for 'create' methods in QCView, QCRenderer, and CIContext (Apple APIs).
...
This fixes:
<rdar://problem/6902710> clang: false positives w/QC and CoreImage methods.
llvm-svn: 72187
2009-05-20 22:39:57 +00:00
Douglas Gregor
1301fdd6c4
Introduce a new kind of RAII class, ASTOwningVector, which is an
...
llvm::SmallVector that owns all of the AST nodes inside of it. This
RAII class is used to ensure proper destruction of AST nodes when
template instantiation fails.
llvm-svn: 72186
2009-05-20 22:33:37 +00:00
Douglas Gregor
06555f134a
Template instantiation for CXXExprWithTemporaries, which occurs when
...
temporaries are generated for some object-constructing expressions in
templates that are not type-dependent.
Also, be sure to introduce the variable from a CXXConditionDeclExpr
into the set of instantiated local variables.
llvm-svn: 72185
2009-05-20 21:51:01 +00:00
Douglas Gregor
e70f108158
Template instantiation for the various kinds of AST nodes that occur
...
due to C++ type construction of the form T(a1, a2, ..., aN).
llvm-svn: 72183
2009-05-20 21:38:11 +00:00
Douglas Gregor
ce934146d0
Introduce a new expression type, CXXUnresolvedConstructExpr, to
...
describe the construction of a value of a given type using function
syntax, e.g.,
T(a1, a2, ..., aN)
when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.
llvm-svn: 72176
2009-05-20 18:46:25 +00:00
Fariborz Jahanian
d20a03f308
This patch provides preliminary support for non-fragile instance variables on the GNU runtime.
...
It currently requires a patches to GNU libobjc (and so is not enabled by default) which are currently
being tested and reviewed by GNUstep before being pushed upstream.
This patch does not allow support for synthesized ivars, but does provide the infrastructure
needed for supporting them.
Patch by David Chisnall
llvm-svn: 72175
2009-05-20 18:41:51 +00:00
Fariborz Jahanian
f1c25029b4
implementation of format_arg for ObjC methods/functions.
...
Still more to do.
llvm-svn: 72173
2009-05-20 17:41:43 +00:00
Zhongxing Xu
1075cc0b02
Treat AllocaRegion as SymbolicRegion in RegionStore::Retrieve().
...
llvm-svn: 72166
2009-05-20 09:18:48 +00:00
Zhongxing Xu
a7907608fb
* API change: we need to pass GRState to GRExprEngine::EvalBinOp() because
...
RegionStore needs to know the type of alloca region.
* RegionStoreManager::EvalBinOp() now converts the alloca region to its first
element region, as what is done to symbolic region.
llvm-svn: 72164
2009-05-20 09:00:16 +00:00
Eli Friedman
c21cb44de2
Handle the remaining unhandled cases in EmitReferenceBindingToExpr.
...
It would be nice if someone could write an ObjC++ testcase for the case
of passing a property returning a struct to a function taking a const
reference.
llvm-svn: 72159
2009-05-20 02:31:19 +00:00
Zhongxing Xu
050379b865
add header to be built by gcc 4.3 on Linux.
...
llvm-svn: 72158
2009-05-20 01:55:10 +00:00
Anders Carlsson
02bb7f0ac8
irgen for references to complex rvales (Very important...)
...
llvm-svn: 72157
2009-05-20 01:35:03 +00:00
Anders Carlsson
ad007d44b6
Create a temporary if the lvalue is a bitfield. Reported by Eli.
...
llvm-svn: 72155
2009-05-20 01:24:22 +00:00
Anders Carlsson
145eae5224
Add support for binding references to scalar rvalues.
...
llvm-svn: 72153
2009-05-20 01:03:17 +00:00
Anders Carlsson
7d4c083c19
Bind references to lvalues correctly.
...
llvm-svn: 72150
2009-05-20 00:36:58 +00:00
Anders Carlsson
6f5a015bd9
Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't support anything but at least we don't crash ;)
...
llvm-svn: 72147
2009-05-20 00:24:07 +00:00
Douglas Gregor
68f1096212
Add FIXMEs for the remaining C and C++ expression types that still
...
need template instantiation logic. Remove one FIXME by instantiating
the callee in a non-type-dependent CXXOperatorCallExpr.
llvm-svn: 72145
2009-05-19 23:29:16 +00:00
Douglas Gregor
ad3150cd38
Template instantiation for __builtin_va_arg.
...
llvm-svn: 72144
2009-05-19 23:10:31 +00:00
Douglas Gregor
0df91121ba
Template instantiation for __builtin_choose_expr.
...
llvm-svn: 72143
2009-05-19 22:43:30 +00:00
Douglas Gregor
f907cbf634
Ban the use of __builtin_types_compatible_p in C++; g++ doesn't support it,
...
and it isn't clear exactly what it's supposed to mean. Thanks Eli!
llvm-svn: 72142
2009-05-19 22:28:02 +00:00
Douglas Gregor
c25f766065
Template instantiation for __builtin_shufflevector.
...
llvm-svn: 72139
2009-05-19 22:10:17 +00:00
Eli Friedman
58ed0f2a80
Build fixes for r72135.
...
llvm-svn: 72136
2009-05-19 21:16:18 +00:00
Eli Friedman
5b5bd90a21
Move AnalysisConsumer.h and Analyses.def from tools/clang-cc to
...
include/clang/Frontend, and move AnalysisConsumer.cpp from
tools/clang-cc to lib/Frontend.
llvm-svn: 72135
2009-05-19 21:10:40 +00:00
Douglas Gregor
4b58ca02c5
Template instantiation for __builtin_types_compatible_p.
...
llvm-svn: 72134
2009-05-19 20:55:31 +00:00
Anders Carlsson
2d228cef50
Improve support for irgen of references.
...
llvm-svn: 72133
2009-05-19 20:40:02 +00:00
Douglas Gregor
8d7fef3cf2
Template instantiation for GNU statement expressions
...
llvm-svn: 72129
2009-05-19 20:31:21 +00:00
Douglas Gregor
115652db4a
Fix handling of the GNU "t ? : f" extension to the conditional
...
operator in C++, and verify that template instantiation for the
condition operator does the right thing.
llvm-svn: 72127
2009-05-19 20:13:50 +00:00
Douglas Gregor
3234db1e13
Template instantiation for compound assignment operators.
...
llvm-svn: 72126
2009-05-19 20:02:01 +00:00
Anders Carlsson
29a1be34b7
Only do the bitcast in EmitStoreOfScalar if the type is a boolean.
...
llvm-svn: 72125
2009-05-19 19:36:19 +00:00
Douglas Gregor
71b6a37bc4
Template instantiation for cast expressions.
...
llvm-svn: 72119
2009-05-19 19:05:47 +00:00
Anders Carlsson
8370964257
Pass the destination QualType to EmitStoreOfScalar. No functionality change.
...
llvm-svn: 72118
2009-05-19 18:50:41 +00:00
Anders Carlsson
775640d248
Don't always zext the result of the not unary operator to an int.
...
llvm-svn: 72117
2009-05-19 18:44:53 +00:00
Fariborz Jahanian
960910a159
Patch finishes off application of printf attribute on blocks.
...
llvm-svn: 72111
2009-05-19 17:08:59 +00:00
Duncan Sands
ca3a465b76
Add missing include for stderr and fprintf, needed
...
when compiling with gcc-4.4.
llvm-svn: 72109
2009-05-19 12:06:47 +00:00
Eli Friedman
69329a52cf
Fix a crash with -emit-html from stdin.
...
llvm-svn: 72104
2009-05-19 05:28:52 +00:00
Anders Carlsson
c82b86dfaa
Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. Stub out VisitCXXExprWithTemporaries.
...
llvm-svn: 72103
2009-05-19 04:48:36 +00:00
Anders Carlsson
549c5bd824
Create CXXConstructExpr calls for arguments passed to functions.
...
llvm-svn: 72102
2009-05-19 04:45:15 +00:00
Eli Friedman
cec35d7e6a
Clean up some unnecessary includes.
...
llvm-svn: 72101
2009-05-19 04:30:57 +00:00
Eli Friedman
e15ecf04a4
CMake updates for r72099; untested, so please tell me if there are any
...
issues.
llvm-svn: 72100
2009-05-19 04:21:30 +00:00
Eli Friedman
16b7b6f511
Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp
...
files to lib/Frontend.
llvm-svn: 72099
2009-05-19 04:14:29 +00:00
Anders Carlsson
97c793ad1c
When assigning from an rvalue to a const reference, the implicit cast from T -> const T is not an lvalue cast.
...
llvm-svn: 72082
2009-05-19 00:38:24 +00:00
Douglas Gregor
be81045db7
Template instantiation for call expressions.
...
llvm-svn: 72081
2009-05-19 00:38:01 +00:00
Fariborz Jahanian
b27c94199f
This patch allows clang to generate code for declared properties on the GNU runtime. As with @synchronized, this requires some extra functions that are included with other libraries (not with the GNU runtime itself) and so will cause linker errors when these are not present.
...
Patch by David Chisnall.
llvm-svn: 72079
2009-05-19 00:28:43 +00:00
Douglas Gregor
7a77a6bcf9
Template instantiation for array subscript expressions. This was far
...
easier than expected because of the limitation that subscript
operators must be member functions.
llvm-svn: 72076
2009-05-19 00:01:19 +00:00
Fariborz Jahanian
5f1f9d7a46
BlockDecl node must be complete before block attributes
...
can be processed. No change in functionality.
llvm-svn: 72066
2009-05-18 23:17:46 +00:00
Ted Kremenek
501ba0365a
Fix PR 4230: Don't flag leaks of NSAutoreleasePools until we know that we aren' at the top-most scope of autorelease pools.
...
llvm-svn: 72065
2009-05-18 23:14:34 +00:00
Eli Friedman
351fa4b1b2
Attempted CMake build fixes for r72060; this is untested, so please tell
...
me if there are any issues.
llvm-svn: 72063
2009-05-18 23:06:15 +00:00
Daniel Dunbar
13c358d9b8
Remove -fprintf-source-range-info from the Driver (this was renamed)
...
llvm-svn: 72061
2009-05-18 23:01:24 +00:00
Eli Friedman
9f30fc33d9
Move ASTConsumers.h to include/clang/Frontend, and move the associated
...
.cpp files to lib/Frontend. (As proposed on cfe-dev.)
llvm-svn: 72060
2009-05-18 22:50:54 +00:00
Douglas Gregor
38e7f8bd6d
Template instantiation for imaginary literals, because they were next in Expr.h
...
llvm-svn: 72058
2009-05-18 22:38:38 +00:00
Douglas Gregor
8e35e2d7ae
"This patch fixes an obvious buffer overrun in
...
SelectInterestingSourceRegion()," from Jay Foad!
llvm-svn: 72049
2009-05-18 22:09:16 +00:00
Douglas Gregor
4182e32172
Fix sorting of using directives, from Jay Foad
...
llvm-svn: 72048
2009-05-18 22:06:54 +00:00
Daniel Dunbar
82b22101e6
Reformat a comment
...
llvm-svn: 72046
2009-05-18 21:47:54 +00:00
Douglas Gregor
655fc35fcd
Deal with an icky corner case where we were complaining that a catch
...
statement was using an rvalue reference during the template
definition. However, template instantiations based on an lvalue
reference type are well-formed, so we delay checking of these property
until template instantiation time.
llvm-svn: 72041
2009-05-18 21:08:14 +00:00
Fariborz Jahanian
c1585be6bd
more printf attribute on block declaration and
...
checking when block is envoked. In progress.
llvm-svn: 72039
2009-05-18 21:05:18 +00:00
Daniel Dunbar
c61d0bd8f1
Debug info: Initialize runtime language field correctly for Objective-C
...
interface types.
llvm-svn: 72036
2009-05-18 20:51:58 +00:00
Douglas Gregor
5e16fbe562
Template instantiation for C++ try/catch statements.
...
llvm-svn: 72035
2009-05-18 20:51:54 +00:00
Anders Carlsson
9b02760923
Since we miscompile many cases when declaring a variable with a reference type, make them unsupported for now.
...
llvm-svn: 72034
2009-05-18 19:55:29 +00:00
Anders Carlsson
8dd2947696
Remove an unused builtin.
...
llvm-svn: 72033
2009-05-18 19:25:54 +00:00
Anders Carlsson
2081200b8c
Add 'cmp' SSE builtins and get rid of a bunch of other builtins.
...
llvm-svn: 72032
2009-05-18 19:16:46 +00:00
Douglas Gregor
2f547c7e3e
Include StmtNodes.def to declare Visit methods for all of the known
...
kinds of statements (in the instantiation logic). No functionality
change, but now we'll get linker errors if we add a statement but
forget to introduce its instantiation logic.
llvm-svn: 72031
2009-05-18 19:08:47 +00:00
Douglas Gregor
eaf847ab97
Simplify struct/class tag mismatch warning, per Sebastian's suggestion
...
llvm-svn: 72027
2009-05-18 18:46:22 +00:00
Fariborz Jahanian
28c433dcda
Minor tweak to support format attribute on blocks. No change in functionality.
...
llvm-svn: 72020
2009-05-18 17:39:25 +00:00
Daniel Dunbar
70f924df8a
Avoid potential out-of-bounds access in SourceManager::getLineNumber.
...
- Chris, please see added FIXMEs.
llvm-svn: 72019
2009-05-18 17:30:52 +00:00
Douglas Gregor
8567358cc9
When instantiating the definition of a member function of a class
...
template, introduce that member function into the template
instantiation stack. Also, add diagnostics showing the member function
within the instantiation stack and clean up the qualified-name
printing so that we get something like:
note: in instantiation of member function 'Switch1<int, 2, 2>::f'
requested here
in the template instantiation backtrace.
llvm-svn: 72015
2009-05-18 17:01:57 +00:00
Daniel Dunbar
29f36b4c9a
Silence a Release-Asserts warning.
...
llvm-svn: 72013
2009-05-18 16:48:48 +00:00
Eli Friedman
e6eb2edb50
Fix for PR2386: distinguish between insertion and replacements in the
...
delta tree.
The issue is roughly a conflict in ReplaceText between two kinds of
uses. One, it should be possible to replace a replacement: for example, the
ObjC rewriter calls ReplaceStmt for an expression, then replaces the resulting
expression with another expression. Two, it should be possible to
replace text that already has text inserted before it: for example, the
HTML rewriter inserts a bunch of tags at the beginning of the line, then
tries to escape the first character on the line. This patch
distinguishes the two cases by storing the deltas separately;
essentially, replacements and insertions no longer interfere with
each other.
Another possibility would be to add some sort of flag to ReplaceText, but
this seems a bit more intuitive and flexible.
There are a few downsides to the current solution: one is that there isn't
any way to remove/replace an insertion without touching additional
surrounding text; if such an operation turns out to be useful, an
additional method or flag can be added. Another is that an insertion
and replacing a string of length zero are distinct operations; I'm not
sure how to resolve this, or whether it will be confusing in practice.
This is relatively sensitive code, so please test and tell me if
anything breaks.
llvm-svn: 72000
2009-05-18 13:56:52 +00:00
Eli Friedman
174c310967
Remove unused parameter.
...
llvm-svn: 71996
2009-05-18 07:39:39 +00:00
Anders Carlsson
ee13926fbe
Make ActOnWhileStmt take a FullExprArg for the condition expr.
...
llvm-svn: 71990
2009-05-17 21:22:26 +00:00
Anders Carlsson
24824e5009
Make ActOnExprStmt take a FullExprArg.
...
llvm-svn: 71989
2009-05-17 21:11:30 +00:00
Anders Carlsson
0e70d84e29
Fix instantiate-function-1.cpp.
...
llvm-svn: 71988
2009-05-17 19:43:12 +00:00
Anders Carlsson
cdf1ca1cf4
Fix DISABLE_SMART_POINTERS build.
...
llvm-svn: 71984
2009-05-17 19:34:11 +00:00
Anders Carlsson
85a307dffb
Implement Sema::ActOnFinishFullExpr and create a CXXExprWithTemporaries node if necessary.
...
llvm-svn: 71983
2009-05-17 18:41:29 +00:00
Anders Carlsson
5262746c28
Add the FullExprArg wrapper and use it for if statement conditions.
...
llvm-svn: 71982
2009-05-17 18:26:53 +00:00
Anders Carlsson
23ca0b4869
Add support for converting member pointer types to LLVM types. Also mangle pointer to member functions correctly and add tests.
...
llvm-svn: 71981
2009-05-17 17:41:20 +00:00
Fariborz Jahanian
078cd52297
This patch fixes two bugs in the GNU Objective-C runtime implementation. One is a case in rethrowing exceptions where the C types don't match correctly (I already sent this patch to Daniel Dunbar, who found the bug, so it may have already been committed). The other fixes the case properties so that the methods generated as property accessors are added to the class structure correctly.
...
Patch by David Chisnall.
llvm-svn: 71980
2009-05-17 16:49:27 +00:00
Anders Carlsson
9303134cef
Add FIXME about not using MemberExpr nodes when the base type is a dependent type.
...
llvm-svn: 71979
2009-05-17 16:28:18 +00:00
Anders Carlsson
32440a0f48
Use the Itanium ABI for member pointers. Add a missing 'break' statement and a test case
...
llvm-svn: 71972
2009-05-17 02:06:04 +00:00
Eli Friedman
8f1d33e218
A couple of tweaks to make -ast-print produce code that's closer to
...
valid C code.
llvm-svn: 71971
2009-05-17 01:05:34 +00:00
Anders Carlsson
3c01271e93
Rewrite PureVirtualMethodCollector to use the overridden methods. Fixes <rdar://problem/6854087>
...
llvm-svn: 71970
2009-05-17 00:00:05 +00:00
Anders Carlsson
776a1403ed
Add OldMD to the list of methods NewMD overrides
...
llvm-svn: 71969
2009-05-16 23:59:08 +00:00
Anders Carlsson
36d87e179a
Add setters/getters to CXXMethodDecl so it can keep track of which virtual member functions it overrides (if any)
...
llvm-svn: 71968
2009-05-16 23:58:37 +00:00
Eli Friedman
15af3ee6a9
Make the RAII extension warning silencing for __extension__ a bit
...
narrower, so it doesn't catch expresions that aren't sub-expressions of
__extension__ operator.
llvm-svn: 71967
2009-05-16 23:40:44 +00:00
Eli Friedman
678d3bac03
Targets without long long should reduce the size of intmax_t
...
accordingly.
llvm-svn: 71966
2009-05-16 23:30:57 +00:00
Eli Friedman
ce7f900b3b
Refactor address-of-void extension a bit so that it's more obviously
...
correct. No functionality change, as far as I know.
llvm-svn: 71965
2009-05-16 23:27:50 +00:00
Anders Carlsson
7bf3c4227d
Fix another case where the extern-ness of extern "C" wasn't being captured.
...
This makes me think that we should make hasExternalStorage perform this check...
llvm-svn: 71962
2009-05-16 22:05:23 +00:00
Anders Carlsson
5b53576fe4
Don't return member pointer types for static member functions. Fixes 6879261.
...
llvm-svn: 71961
2009-05-16 21:43:42 +00:00
Eli Friedman
b529b01985
PR3942: Don't warn on unsigned overflow in preprocessor expressions.
...
llvm-svn: 71960
2009-05-16 21:24:10 +00:00
Anders Carlsson
d3a69ceaaf
extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.
...
llvm-svn: 71957
2009-05-16 21:02:39 +00:00
Anders Carlsson
524d5a4f5a
Improve checking of member expressions where the base type is a dependent type.
...
llvm-svn: 71956
2009-05-16 20:31:20 +00:00
Sebastian Redl
e769ecf8ab
Implement instantiation of a few boring, simple expressions. I don't think these are testable yet, though.
...
llvm-svn: 71953
2009-05-16 18:50:46 +00:00
Eli Friedman
168fe15b0d
Avoid calling mergeTypes in C++. I think these are the correct C++
...
alternatives, but please correct me if I'm wrong.
I eventually plan to assert in mergeTypes that we aren't in C++ mode
because composite types are fundamentally not a part of C++. The
remaining callers for code in the regression tests are
Sema::WarnConflictingTypedMethods and CodeGenFunction::EmitFunctionProlog;
I'm not quite sure what the correct approach is for those callers.
llvm-svn: 71946
2009-05-16 13:54:38 +00:00
Eli Friedman
e2cad65015
Add stricter checking for va_arg.
...
llvm-svn: 71942
2009-05-16 12:46:54 +00:00
Eli Friedman
54135838e2
PR2044: reject declarations of functions returning variably modified
...
types.
llvm-svn: 71941
2009-05-16 12:15:55 +00:00
Eli Friedman
0b4af8f755
PR3009: Get rid of bogus warning for scalar compound literals.
...
This patch isn't quite ideal in that it eliminates the warning for
constructs like "int a = {1};", where the braces are in fact redundant.
However, that would have required a bunch of refactoring, and it's
much less likely to cause confusion compared to redundant nested braces.
llvm-svn: 71939
2009-05-16 11:45:48 +00:00
Mike Stump
18bb9284ff
Reflow some comments.
...
llvm-svn: 71937
2009-05-16 07:57:57 +00:00
Mike Stump
87c57acfb7
Reflow some comments.
...
llvm-svn: 71936
2009-05-16 07:39:55 +00:00
Mike Stump
6814d1c126
Implement a FIXME, we now pass in the locations of the braces for enums.
...
llvm-svn: 71930
2009-05-16 07:06:02 +00:00
Eli Friedman
b05c41e0a1
Remove useless wrapper.
...
llvm-svn: 71928
2009-05-16 05:56:02 +00:00
Mike Stump
b9075ae9f7
Fixup __extension__ i = 1 parsing. Thanks Eli!
...
llvm-svn: 71927
2009-05-16 04:31:34 +00:00
Ted Kremenek
e4302ee3bb
Fix: <rdar://problem/6893565> False positive: don't flag leaks for return types that cannot be determined to be CF types
...
llvm-svn: 71921
2009-05-16 01:38:01 +00:00
Ted Kremenek
a28565ac62
Fix another bug in BugReporter where we wouldn't always select the bug report in a bug equivalence class with the shortest path.
...
llvm-svn: 71920
2009-05-16 01:11:58 +00:00
Douglas Gregor
30776d419f
Template instantiation for IndirectGotoStmt. Now my life is complete.
...
llvm-svn: 71917
2009-05-16 00:20:29 +00:00
Douglas Gregor
2a2d00f041
Template instantiation for switch statements
...
llvm-svn: 71916
2009-05-15 23:57:33 +00:00
Fariborz Jahanian
6404c420e5
Removed superfluous code.
...
llvm-svn: 71909
2009-05-15 23:19:35 +00:00
Fariborz Jahanian
4447e17c03
Early support for __format__attribute on blocks.
...
Work in progress...
llvm-svn: 71908
2009-05-15 23:15:03 +00:00
Anders Carlsson
789e2cce54
Basic support for member exprs where the base expr type is dependent.
...
llvm-svn: 71907
2009-05-15 23:10:19 +00:00
Daniel Dunbar
9a017d7fcf
Classes with "+load" methods need to go in the non-lazy class list (or
...
else the method will not be found by the runtime at class load time).
llvm-svn: 71904
2009-05-15 22:33:15 +00:00
Douglas Gregor
ca60224bbe
Template instantiation for break and continue statements.
...
llvm-svn: 71903
2009-05-15 22:32:39 +00:00
Douglas Gregor
5d13868263
Template instantiation for "for" loops
...
llvm-svn: 71901
2009-05-15 22:12:32 +00:00
Douglas Gregor
3daa82dba0
Template instantiation for do-while statements.
...
llvm-svn: 71899
2009-05-15 21:56:04 +00:00
Daniel Dunbar
19573e7d29
Factor code for adding module-level class lists into separate method.
...
- No functionality change.
llvm-svn: 71898
2009-05-15 21:48:48 +00:00
Mike Stump
76b824c388
Fixup parsing for (throw,throw) and __extension__ throw 1.
...
llvm-svn: 71897
2009-05-15 21:47:08 +00:00
Douglas Gregor
8a930c3b73
Template instantiation for WhileStmt and CXXConditionDeclExpr.
...
llvm-svn: 71896
2009-05-15 21:45:53 +00:00
Douglas Gregor
8d2ad873e7
Make sure that we use the canonical type for the names of instantiated
...
constructors and destructors. This is a requirement of
DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing,
so it should have been caught much earlier :(
Big thanks to Anders for the test case.
llvm-svn: 71895
2009-05-15 21:18:27 +00:00
Fariborz Jahanian
6802ed9968
improved on diagnosing misplacement of sentinel attributes.
...
No change in functionality.
llvm-svn: 71894
2009-05-15 21:18:04 +00:00
Douglas Gregor
3f17b47c7e
Allow instantiation of NULL expressions and statements
...
llvm-svn: 71889
2009-05-15 20:47:12 +00:00
Fariborz Jahanian
0aa5c4565d
This patch finishes off the sentinel attribute handling for
...
blocks and function pointers.
llvm-svn: 71888
2009-05-15 20:33:25 +00:00
Anders Carlsson
2cf4387931
I take it back, InstantiateExpr does not check for null.
...
llvm-svn: 71887
2009-05-15 20:29:28 +00:00
Anders Carlsson
1f911dce22
Instantiation support for 'this'
...
llvm-svn: 71886
2009-05-15 20:26:03 +00:00
Anders Carlsson
50574f5303
No need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.
...
llvm-svn: 71885
2009-05-15 20:10:48 +00:00
Douglas Gregor
1ec5e9f025
Make sure that the type associated with a class template is dependent.
...
llvm-svn: 71878
2009-05-15 19:11:46 +00:00
Douglas Gregor
9d73cabf22
Template instantiation for "if" statements. Also:
...
- Skip semantic analysis of the "if" condition if it is type-dependent.
- Added the location of the "else" keyword into IfStmt, so that we can
provide it for type-checking after template instantiation.
llvm-svn: 71875
2009-05-15 18:53:42 +00:00
Anders Carlsson
37604a0984
A C++ member function always has either weak linkage (if it's inline or defined inline) or strong linkage (other cases).
...
llvm-svn: 71873
2009-05-15 18:35:39 +00:00
Douglas Gregor
82049e6bdd
Move statement instantiation into its own file. No functionality change
...
llvm-svn: 71872
2009-05-15 18:22:25 +00:00
Douglas Gregor
12c3a5cedf
When word-wrapping, be more defensive about a ridiculously small number of columns. Fixes <rdar://problem/6892178>
...
llvm-svn: 71870
2009-05-15 18:05:24 +00:00
Douglas Gregor
67da0d97e6
Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
...
instantiating the definition of a function from a template.
llvm-svn: 71869
2009-05-15 17:59:04 +00:00
Anders Carlsson
f6e9ece507
Name mangling for class template specializations and template arguments.
...
llvm-svn: 71861
2009-05-15 16:09:15 +00:00
Chris Lattner
4579b76ff6
Fix processing of -Ufoo to not inject "#undef foo 1" into the predefines
...
buffer. This caused exciting nonsense like this:
$ clang t.c -fsyntax-only -UMACRO
In file included from <built-in>:104:
<command line>:1:14: warning: extra tokens at end of #undef directive [-Wextra-tokens]
#undef MACRO 1
^
//
1 diagnostic generated.
rdar://6891800
llvm-svn: 71860
2009-05-15 16:08:43 +00:00
Ted Kremenek
3281977dbb
Fix crash when deriving the enclosing summary of a method whose first selector slot has a null IdentifierInfo*. This happens when analyzing Growl.
...
llvm-svn: 71857
2009-05-15 15:49:00 +00:00
Ted Kremenek
4785e41c12
Remove extra whitespace character in string literal. Purely cosmetic.
...
llvm-svn: 71847
2009-05-15 06:02:08 +00:00
Ted Kremenek
3d436c7b35
Use dyn_cast instead of cast to allow our assumptions to be safely wrong.
...
llvm-svn: 71843
2009-05-15 05:34:49 +00:00
Ted Kremenek
608a6176a1
Cleanup internal checks bug reporting, allowing intermediate diagnostics to be generated for bad argument warnings, bad branches, etc.
...
llvm-svn: 71838
2009-05-15 05:25:09 +00:00
Ted Kremenek
73777059f0
BugReporter (extensive diagnostics): Do not include the range of target '}'
...
llvm-svn: 71832
2009-05-15 02:46:13 +00:00
Ted Kremenek
18665fe3c9
PathDiagnosticLocation::asRange(): for a PathDiagnosticLocation, the range of a DeclStmt is only the decl, not
...
the decl + initializer.
llvm-svn: 71831
2009-05-15 02:05:25 +00:00
Ted Kremenek
cfe7d02b2c
BugReporter (extensive diagnostics): Add control-flow piece to '}' in
...
loop body when generating 'Looping back to the head of the loop'
diagnostics.
llvm-svn: 71829
2009-05-15 01:50:15 +00:00
Anders Carlsson
19b8c4ce36
Instantiate return statements.
...
llvm-svn: 71825
2009-05-15 00:48:27 +00:00
Mike Stump
2c002929b2
Fixup debug information for the location information for __block
...
variables. For this to work, the backend needs to handle more complex
forms for locations.
A typical utterance would be:
%forwarding = getelementptr %0* %use_by_ref, i32 0, i32 1 ; <i8**> [#uses=1]
%0 = load i8** %forwarding ; <i8*> [#uses=1]
%1 = bitcast i8* %0 to %0* ; <%0*> [#uses=1]
%x = getelementptr %0* %1, i32 0, i32 4 ; <i32*> [#uses=1]
%2 = bitcast i32* %x to { }* ; <{ }*> [#uses=1]
call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
Presently when selection finds something it doesn't understand, it
just avoids generating any information, which is safe, just
incomplete. Radar 6867696
llvm-svn: 71824
2009-05-15 00:29:54 +00:00
Anders Carlsson
03b0dd5913
Add NullStmt::Clone and use it
...
llvm-svn: 71823
2009-05-15 00:21:21 +00:00
Anders Carlsson
f42de874b3
Instantiate goto and label statements. (Very useful, I know)
...
llvm-svn: 71822
2009-05-15 00:15:26 +00:00
Douglas Gregor
923feac4e2
Implement template instantiation for DeclStmt
...
llvm-svn: 71818
2009-05-15 00:01:03 +00:00
Fariborz Jahanian
0c20bddc41
Don't warn if result/argument type of an implemented
...
method is a qualified id which conforms to the matching type
of its method declaration.
llvm-svn: 71817
2009-05-14 23:52:54 +00:00
Douglas Gregor
0555e5fbce
Template instantiation for the NULL statement. Lame, I know
...
llvm-svn: 71816
2009-05-14 23:40:54 +00:00
Douglas Gregor
b4850465b7
Introduce basic support for instantiating the definitions of member
...
functions of class templates. Only compound statements and expression
statements are currently implemented.
llvm-svn: 71814
2009-05-14 23:26:13 +00:00
Anders Carlsson
0a7c01ff2b
Check that the function being overridden is virtual.
...
llvm-svn: 71802
2009-05-14 22:15:41 +00:00
Anders Carlsson
e0dd1d57b3
Improvements to the FunctionDecl getters/setters.
...
llvm-svn: 71800
2009-05-14 21:46:00 +00:00
Douglas Gregor
372565211e
Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts
...
llvm-svn: 71799
2009-05-14 21:44:34 +00:00
Ted Kremenek
f9fa3cb78a
Fix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a retained object.
...
llvm-svn: 71797
2009-05-14 21:29:16 +00:00
Douglas Gregor
24c332b140
Link FunctionDecls instantiated from the member functions of a class
...
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.
llvm-svn: 71792
2009-05-14 21:06:31 +00:00
Fariborz Jahanian
3133a2f08c
updated comments.
...
llvm-svn: 71790
2009-05-14 20:57:28 +00:00
Fariborz Jahanian
6607b21156
Adds recognition of sentinel attribute on block declarations.
...
llvm-svn: 71788
2009-05-14 20:53:39 +00:00
Anders Carlsson
8fb0b8a2cb
Better diagnostics for covariance when checking overriding return types.
...
llvm-svn: 71786
2009-05-14 19:52:19 +00:00
Sebastian Redl
4d226cf45f
When there are any member new operators, global versions aren't looked up at all.
...
llvm-svn: 71780
2009-05-14 18:11:41 +00:00
Fariborz Jahanian
4a528035fd
Diagnose missing sentinel argument on a funciton call
...
with sentinel attribute.
llvm-svn: 71778
2009-05-14 18:00:00 +00:00
Daniel Dunbar
0a2171ccd5
Skip the asm prefix when storing the name in block info.
...
- Otherwise we emit internal names with embedded '\01' characters,
which confuses some tools.
- Ideally all the code which wants to get a "display name" for the
given function should follow one code path, but this should be a
monotonic improvement for now.
llvm-svn: 71774
2009-05-14 16:42:16 +00:00
Douglas Gregor
d9034f0b89
In C++, warn when something previously declared as a "struct" is later
...
declared as a "class", or vice-versa. This warning is under the
control of -Wmismatched-tags, which is off by default.
llvm-svn: 71773
2009-05-14 16:41:31 +00:00
Mike Stump
31f099c8c2
Enhance debug information for block literals. Radar 6867696
...
llvm-svn: 71763
2009-05-14 02:03:51 +00:00
Daniel Dunbar
7911002bf9
We need to specify the "linkage name" to the subprogram now that we
...
emit the correct "display name". I suspect we need more work here, see
FIXME for example.
llvm-svn: 71761
2009-05-14 01:45:24 +00:00
Anders Carlsson
f2a2e338ff
Add return type checking for overriding virtual functions. We currently don't check covariance but that's next.
...
llvm-svn: 71759
2009-05-14 01:09:04 +00:00
Douglas Gregor
2ec748cd5a
Implement explicit instantiations of member classes of class templates, e.g.,
...
template<typename T>
struct X {
struct Inner;
};
template struct X<int>::Inner;
This change is larger than it looks because it also fixes some
a problem with nested-name-specifiers and tags. We weren't requiring
the DeclContext associated with the scope specifier of a tag to be
complete. Therefore, when looking for something like "struct
X<int>::Inner", we weren't instantiating X<int>.
This, naturally, uncovered a problem with member pointers, where we
were requiring the left-hand side of a member pointer access
expression (e.g., x->*) to be a complete type. However, this is wrong:
the semantics of this expression does not require a complete type (EDG
agrees).
Stuart vouched for me. Blame him.
llvm-svn: 71756
2009-05-14 00:28:11 +00:00
Fariborz Jahanian
9e87721d47
Look for and diagnose missing sentinel argument on message
...
dispatch arguments which have sentinel attribute.
llvm-svn: 71737
2009-05-13 23:20:50 +00:00
Daniel Dunbar
0beb7894c4
Make sure not to include the LLVM asm prefix in function names for
...
debug info.
llvm-svn: 71736
2009-05-13 23:08:57 +00:00
Anders Carlsson
e39935527e
Use an iterator type for found_decls_begin/found_decls_end.
...
llvm-svn: 71721
2009-05-13 21:22:06 +00:00
Anders Carlsson
49d216db15
Add a new, more advanced CheckDerivedToBaseConversion that takes custom diagnostic IDs.
...
llvm-svn: 71720
2009-05-13 21:11:42 +00:00
Ted Kremenek
3b204e4c2e
Add some basic type checking for attributes ns_returns_retained and
...
cf_returns_retained. Currently this attribute can now be applied to any
Objective-C method or C function that returns a pointer or Objective-C object
type.
Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to
expect that the diagnostics infrastructure will add quotes around the attribute
name when appropriate. Alonq with this change, I modified the places where this
warning is issued to passed the attribute's IdentifierInfo* instead of having a
hard-coded C constant string.
llvm-svn: 71718
2009-05-13 21:07:32 +00:00
Douglas Gregor
bbbb02d463
Explicit instantiations of templates now instantiate the definitions
...
of class members (recursively). Only member classes are actually
instantiated; the instantiation logic for member functions and
variables are just stubs.
llvm-svn: 71713
2009-05-13 20:28:22 +00:00
Anders Carlsson
5879fbd933
Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.
...
llvm-svn: 71706
2009-05-13 19:49:53 +00:00
Ted Kremenek
bae777254a
Enhance diagnostics value tracking logic for null dereferences and uninitialized values.
...
llvm-svn: 71700
2009-05-13 19:16:35 +00:00
Daniel Dunbar
8a35ef85d8
Driver: Emit an unsupported error on -iframework.
...
llvm-svn: 71698
2009-05-13 19:05:04 +00:00
Daniel Dunbar
ffdb8439d7
ABI handling: Fix invalid assertion, it is possible for a valid
...
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.
llvm-svn: 71695
2009-05-13 18:54:26 +00:00
Douglas Gregor
f61eca93c0
Improve the semantic checking for explicit instantiations of
...
templates. In particular:
- An explicit instantiation can follow an implicit instantiation (we
were improperly diagnosing this as an error, previously).
- In C++0x, an explicit instantiation that follows an explicit
specialization of the same template specialization is ignored. In
C++98, we just emit an extension warning.
- In C++0x, an explicit instantiation must be in a namespace
enclosing the original template. C++98 has no such requirement.
Also, fixed a longstanding FIXME regarding the integral type that is
used for the size of a constant array type when it is being instantiated.
llvm-svn: 71689
2009-05-13 18:28:20 +00:00
Ted Kremenek
5801f65a52
Fix crasher reported in PR 4209 caused by an invalid summary
...
generation when EvalObjCMessageExpr() did not resolve the
ObjCInterfaceDecl* for a receiver when the receiver's symbolic value
wasn't being explicitly tracked.
llvm-svn: 71685
2009-05-13 18:16:01 +00:00
Fariborz Jahanian
027b886a99
Some early declarations to support sentinel attribute on
...
message dispatches (and function calls later). No change in
functionality.
llvm-svn: 71683
2009-05-13 18:09:35 +00:00
Fariborz Jahanian
1880136520
Removed 4-letter :) word in comment.
...
Used simple array for Selector build.
llvm-svn: 71674
2009-05-13 16:19:02 +00:00
Ted Kremenek
4554f9b134
Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs && "Arg access out of range!").
...
For format string checking, only check the type of the format
specifier for non-vararg functions.
llvm-svn: 71672
2009-05-13 16:06:05 +00:00
Ted Kremenek
051a03d698
Fix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added autorelease tracking.
...
llvm-svn: 71647
2009-05-13 07:12:33 +00:00
Chris Lattner
ff96dd0301
Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
...
llvm-svn: 71643
2009-05-13 06:10:29 +00:00
Chris Lattner
b70f3de625
Fix rdar://6880951 by rejecting vectors of vectors.
...
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers. This should
probably be rethought, I'll file a bugzilla.
llvm-svn: 71640
2009-05-13 05:13:44 +00:00
Chris Lattner
df24298b40
reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
...
rdar://6880104
llvm-svn: 71639
2009-05-13 05:02:08 +00:00
Chris Lattner
5868c03191
eli correctly points out that this code is dead, just rip it out for
...
now until someone does it right
llvm-svn: 71638
2009-05-13 04:52:12 +00:00
Chris Lattner
afde259240
implement __sync_synchronize and __sync_lock_release,
...
rdar://6880573
llvm-svn: 71637
2009-05-13 04:46:13 +00:00
Chris Lattner
94578cba76
add support for __sync_nand_and_fetch and __sync_fetch_and_nand,
...
rdar://6880573
llvm-svn: 71636
2009-05-13 04:37:52 +00:00
Chris Lattner
e2df3f9fe5
Fix rdar://6880874 - [sema] crash on array types with different index sizes
...
llvm-svn: 71634
2009-05-13 04:12:56 +00:00
Chris Lattner
851eb927d7
Fix rdar://6881069, a crash on a form of vector_size that we
...
don't support. While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.
llvm-svn: 71633
2009-05-13 04:00:12 +00:00
Chris Lattner
46813bbfa2
Fix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
...
by using the appropriate CGM interface instead of directly creating a global.
llvm-svn: 71617
2009-05-13 02:50:56 +00:00
Chris Lattner
f160b5f9e1
When we expect two arguments but have zero, make sure to add
...
two empty arguments. Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.
This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion
llvm-svn: 71616
2009-05-13 00:55:26 +00:00
Douglas Gregor
a1f4997368
Semantic analysis for explicit instantiation of class templates. We
...
still aren't instantiating the definitions of class template members,
and core issues 275 and 259 will both affect the checking that we do
for explicit instantiations (but are not yet implemented).
llvm-svn: 71613
2009-05-13 00:25:59 +00:00
Douglas Gregor
1b57ff32a8
Implement parsing for explicit instantiations of class templates, e.g.,
...
template class X<int>;
This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.
llvm-svn: 71608
2009-05-12 23:25:50 +00:00
Chris Lattner
d98e7cf7c1
improve the diagnostic for uses of the GCC "global variable in a register" extension.
...
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension
llvm-svn: 71599
2009-05-12 21:44:00 +00:00
Douglas Gregor
36312bb5ee
Parser::ParseDeclarationOrFunctionDefinition no longer needs to accept
...
template parameters.
llvm-svn: 71598
2009-05-12 21:43:46 +00:00
Fariborz Jahanian
2bd617c46c
Method attributes may only be specified on method
...
declarations.
llvm-svn: 71597
2009-05-12 21:36:23 +00:00
Douglas Gregor
2399628cea
Refactor the parsing of declarations so that template declarations can
...
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.
llvm-svn: 71596
2009-05-12 21:31:51 +00:00
Chris Lattner
e541ea3a61
implement l-value codegen of comma expr
...
llvm-svn: 71595
2009-05-12 21:28:12 +00:00
Chris Lattner
e0be0dfced
push GlobalDecl through enough of the CodeGenModule interfaces
...
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.
llvm-svn: 71594
2009-05-12 21:21:08 +00:00
Chris Lattner
d035ebda2f
add an initial stab at emitting deferred c++ inline functions. This handles static
...
functions and methods declared inline, but not ctors/dtors or methods not declared
inline (apparently my previous patch wasn't good enough).
llvm-svn: 71591
2009-05-12 21:02:27 +00:00
Chris Lattner
eb7466d24a
cleanups, no functionality change.
...
llvm-svn: 71590
2009-05-12 20:58:15 +00:00
Chris Lattner
da7a0977d6
Method who have definitions in structs/classes are semantically inline.
...
Per the FIXME, it might be interesting to track whether the inline keyword
was also used on the method, but for now we don't do this. Testcase pending.
llvm-svn: 71589
2009-05-12 20:55:07 +00:00
Chris Lattner
bea5b622be
static methods don't get this pointers.
...
llvm-svn: 71586
2009-05-12 20:27:19 +00:00
Chris Lattner
e7834115eb
revert my previous patch, I committed the wrong file.
...
llvm-svn: 71585
2009-05-12 20:26:52 +00:00
Chris Lattner
cd74ffa3eb
static methods don't get this pointers.
...
llvm-svn: 71583
2009-05-12 20:21:39 +00:00
Ted Kremenek
1272f706ca
Fix: <rdar://problem/6320065> false positive - init method returns an object owned by caller
...
Now 'init' methods are treated by the retain/release checker as
claiming their receiver and allocating a new object.
llvm-svn: 71579
2009-05-12 20:06:54 +00:00
Fariborz Jahanian
e4128642a7
Fixed typos, used DenseSet for keeping track of
...
selectors which need use Nonfrgile API for
message dispatch.
llvm-svn: 71578
2009-05-12 20:06:41 +00:00
Chris Lattner
b61448d490
accept "#pragma clang foo" where we accept "#pragma GCC foo".
...
llvm-svn: 71572
2009-05-12 18:21:11 +00:00
Fariborz Jahanian
0f44d81a4c
Patch to implement ivar synthesis of properties declared in protocols
...
only and used in class imllementations (objc2 Nonfragile ABI specific).
llvm-svn: 71571
2009-05-12 18:14:29 +00:00
Daniel Dunbar
bbfd054746
Darwin x86-32 ABI: Now that structure passing is farther along, we
...
don't need special treatment for unions.
llvm-svn: 71559
2009-05-12 17:00:20 +00:00
Daniel Dunbar
203e2e8dd8
x86-64 ABI: clang incorrectly passes union { long double, float } in
...
register.
- Merge algorithm was returning MEMORY as it should.
llvm-svn: 71556
2009-05-12 15:22:40 +00:00
Zhongxing Xu
08a2ede018
Add logic for invalidating array region to CFRefCount.cpp. When invalidating
...
array region, set its default value to conjured symbol. When retrieving its
element, create new region value symbol for the element.
Also fix some 80 columns violations.
llvm-svn: 71548
2009-05-12 10:10:00 +00:00
Ted Kremenek
95d181936a
Fix <rdar://problem/6877235> Classes typedef-ed to CF objects should get the same treatment as CF objects
...
This was accomplished by having 'isTypeRef' recursively walk the typedef stack.
llvm-svn: 71538
2009-05-12 04:53:03 +00:00
Douglas Gregor
45fe0364aa
Make precompiled headers work with -E. When we're only preprocessing
...
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.
llvm-svn: 71534
2009-05-12 01:31:05 +00:00
Douglas Gregor
d002c7bc58
Encapsulate template arguments lists in a new class,
...
TemplateArgumentList. This avoids the need to pass around
pointer/length pairs of template arguments lists, and will eventually
make it easier to introduce member templates and variadic templates.
llvm-svn: 71517
2009-05-11 23:53:27 +00:00
Ted Kremenek
5fb7847fbf
BugReport::getEndPath() - Only add a Stmt's range to the constructed PathDiagnosticEventPiece if the BugReport contained no explicit ranges.
...
llvm-svn: 71516
2009-05-11 23:50:59 +00:00
Anders Carlsson
bd7d11f770
Factor code that's common to EmitCXXMemberCallExpr and EmitCXXConstructorCall out into a EmitCXXMemberCall function.
...
llvm-svn: 71514
2009-05-11 23:37:08 +00:00
Daniel Dunbar
097353cbb5
Darwin x86-32: Multi-dimensional arrays were not handled correctly,
...
spotted by Eli!
llvm-svn: 71490
2009-05-11 23:01:34 +00:00
Anders Carlsson
3881170898
Friend declarations are only valid inside class definitions.
...
llvm-svn: 71489
2009-05-11 22:55:49 +00:00
Ted Kremenek
97f75f8bda
When stripping element regions for invalidating region values, treat FieldRegions and ObjCIvarRegions as "base" regions in addition to VarRegions.
...
llvm-svn: 71488
2009-05-11 22:55:17 +00:00
Anders Carlsson
076fc36419
Fix test case by always setting the type spec type, even for friend decls.
...
llvm-svn: 71486
2009-05-11 22:42:30 +00:00
Anders Carlsson
f83c9faa2f
Add an ActOnFriendDecl and call it for friend class decls.
...
llvm-svn: 71482
2009-05-11 22:27:47 +00:00
Anders Carlsson
22e3784c79
For friend class decls, always use TK_Reference so we'll try to look up existing class decls first.
...
llvm-svn: 71481
2009-05-11 22:25:03 +00:00
Ted Kremenek
2ee73b86c0
EdgeBuilder: DeclStmts and BinaryOperators are not the enclosing location context when they are used as initialization code for loops.
...
llvm-svn: 71480
2009-05-11 22:19:32 +00:00
Ted Kremenek
c0b879b4a7
EdgeBuilder::cleanUpLocation() should used the PathDiagnosticLocation constructor for a single point, not a range.
...
llvm-svn: 71477
2009-05-11 21:42:34 +00:00
Douglas Gregor
c9f9b86732
Implement the notions of the "current instantiation" and "unknown
...
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:
template<typename T, typename U>
struct X {
typedef T type;
X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};
llvm-svn: 71471
2009-05-11 19:58:34 +00:00
Ted Kremenek
c14b594b14
BugReporter (extensive diagnostics): Add EdgeBuilder::cleanUpLocation for canonicalization locations and use this in both popLocation and rawAddEdge.
...
llvm-svn: 71470
2009-05-11 19:50:47 +00:00
Ted Kremenek
d4dacb05cc
Add ParentMap:getParentIgnoreParens().
...
llvm-svn: 71469
2009-05-11 19:49:27 +00:00
Fariborz Jahanian
5d5ed2d800
Patch to allow Nonfragile ABI to use 32-bit style legacy
...
message dispage API for all but a few messages. This is
a runtime performance improvement and there is not meant
to be a functional change.
llvm-svn: 71467
2009-05-11 19:25:47 +00:00
Daniel Dunbar
2ce6b3f91c
Darwin x86_32: Treat records with unnamed bit-fields as "empty".
...
llvm-svn: 71461
2009-05-11 18:58:49 +00:00
Ted Kremenek
d0e3ab2196
Fix regression reported in <rdar://problem/6866843>. The analyzer should extend the lifetime of an object stored to a container.
...
llvm-svn: 71452
2009-05-11 18:30:24 +00:00
Chris Lattner
9fea944f26
More improvements for GNU runtime objc EH, patch by David Chisnall!
...
llvm-svn: 71451
2009-05-11 18:16:28 +00:00
Ted Kremenek
dc7853cd98
Fix a bug found by Thomas Clement where 'return [[[NSString alloc] init] autorelease]' would emit a false 'too many overreleases' error.
...
llvm-svn: 71432
2009-05-11 15:26:06 +00:00
Zhongxing Xu
52091db11f
TypedRegion is a too general assumption. Usually we only want to invalidate
...
the VarRegion as a super region of an ElementRegion.
llvm-svn: 71431
2009-05-11 14:28:14 +00:00
Zhongxing Xu
c012656266
When retrieving an ElementRegion, if its super region is a StringRegion,
...
retrieve the string value.
llvm-svn: 71430
2009-05-11 14:23:36 +00:00
Zhongxing Xu
bf938d3160
Fix a bug that leads to infinite loop. Set the correct element type to
...
ElementRegion.
llvm-svn: 71428
2009-05-11 12:48:56 +00:00
Douglas Gregor
862d28e59c
With the introduction of nullptr, a template argument that refers to a declaration can now be NULL. Use cast_or_null appropriately
...
llvm-svn: 71412
2009-05-10 23:27:08 +00:00
Douglas Gregor
5e4e50c280
The canonical declaration of a NULL declaration is NULL
...
llvm-svn: 71409
2009-05-10 22:59:12 +00:00
Douglas Gregor
e362cea568
Implement the semantics of the injected-class-name within a class
...
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.
As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments.
A TagType is dependent if the declaration it references is dependent.
I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.
llvm-svn: 71408
2009-05-10 22:57:19 +00:00
Sebastian Redl
576fd424df
Implement C++0x nullptr.
...
llvm-svn: 71405
2009-05-10 18:38:11 +00:00
Ted Kremenek
1f8e4346fa
Add special warning about returning a retained object where a GC'ed object is expected.
...
llvm-svn: 71397
2009-05-10 16:52:15 +00:00
Ted Kremenek
dee56e37fc
retain/release checker: Flag a warning for non-owned objects returned
...
where an owned one is expected. Also add preliminary checking for
returning a positive retain count object in GC mode where an owned GC
object is expected.
llvm-svn: 71388
2009-05-10 06:25:57 +00:00
Ted Kremenek
3978f7972d
analyzer:
...
- Improve -autorelease diagnostics.
- Improve VLA diagnostics.
- Use "short description" for bug when outputting to TextDiagnostics
llvm-svn: 71383
2009-05-10 05:11:21 +00:00
Zhongxing Xu
c9c3dab491
When casting VarRegion, if the var type is aggregate type and the cast-to
...
pointee type is scalar type, create element region regardless with the sizes
of types.
llvm-svn: 71360
2009-05-09 15:34:29 +00:00
Zhongxing Xu
4131114d99
Remove the rest TypedViewRegion processing code. There should be no
...
TypedViewRegion usage in region store.
llvm-svn: 71359
2009-05-09 15:23:42 +00:00
Zhongxing Xu
d6daef9165
When evaluating pointer arithmetic, if the base location is a symbolic region,
...
convert it to the first element region.
Also do not assume the array region is typed.
llvm-svn: 71358
2009-05-09 15:18:12 +00:00
Zhongxing Xu
b18d7cab0c
Do not create a TypedViewRegion when the base struct region is a symbolic
...
region. In the future we may set the cast-to type as the same time. But for
now, we simply leave it as it is.
llvm-svn: 71357
2009-05-09 13:36:16 +00:00
Zhongxing Xu
7c3826484e
Do not layer a TypedViewRegion when casting symbolic or alloca regions.
...
Modify getLValueElement accordingly. Now we don't require base region
to be a typed region. Do not create TypedViewRegion when base region is
symbolic or alloca region. We can do so because each element region has
its type information.
llvm-svn: 71355
2009-05-09 13:20:07 +00:00
Zhongxing Xu
e3e94bbf19
Remove the case for casting to compatible type in
...
RegionStoreManager::CastRegion(). This case should be subsumed by others.
llvm-svn: 71353
2009-05-09 10:03:08 +00:00
Duncan Sands
c76fe8b611
Correct for renaming PaddedSize -> AllocSize in
...
LLVM.
llvm-svn: 71350
2009-05-09 07:08:47 +00:00
Zhongxing Xu
91e2ab496f
Rename:
...
SymbolRegionRValue => SymbolRegionValue
SymExpr::RegionRValue => SymExpr::RegionValueKind
llvm-svn: 71322
2009-05-09 04:08:27 +00:00
Zhongxing Xu
34d04b3ca9
As discussed with Ted, rename TypedRegion::getObjectType() to
...
TypedRegion::getValueType().
llvm-svn: 71321
2009-05-09 03:57:34 +00:00
Ted Kremenek
669604cded
Add back attribute string lookup for 'ns_returns_retained' and
...
'cf_returns_retained'.
llvm-svn: 71311
2009-05-09 03:08:29 +00:00
Ted Kremenek
c2de72776c
Add back analyzer support for ns_returns_retained and cf_returns_retained.
...
llvm-svn: 71309
2009-05-09 02:58:13 +00:00
Ted Kremenek
9ecdfaf66d
Add back Parse/Sema support for attributes cf_returns_retained and
...
ns_returns_retained, but do not include the other ownership attributes
we previously had.
llvm-svn: 71308
2009-05-09 02:44:38 +00:00
Ted Kremenek
2d0ff62a0d
It lives! The retain/release checker now tracks objects that are sent
...
'autorelease'.
llvm-svn: 71307
2009-05-09 01:50:57 +00:00
Zhongxing Xu
8038f7b30f
rename: MemRegion:
...
RValueType => ObjectType
LValueType => LocationType
No functionality change.
llvm-svn: 71304
2009-05-09 00:50:33 +00:00
Ted Kremenek
9ec08aa3f7
More hacking on autorelease errors. We now can emit basic errors (disabled for
...
now until ready).
llvm-svn: 71303
2009-05-09 00:44:07 +00:00
Ted Kremenek
d35272f96b
Put most of the boilerplate logic in place for reporting autorelease errors.
...
llvm-svn: 71301
2009-05-09 00:10:05 +00:00
Fariborz Jahanian
5276014db2
We want to diagnose sending message to a forward class
...
and we also want to tell which message is actually
being sent.
llvm-svn: 71296
2009-05-08 23:45:49 +00:00
Ted Kremenek
8c8fb488e6
retain/release checker: Add stub for HandleAutoreleaseCounts.
...
llvm-svn: 71290
2009-05-08 23:32:51 +00:00
Zhongxing Xu
ca143e73ea
Fix PR4182.
...
llvm-svn: 71288
2009-05-08 23:28:07 +00:00
Ted Kremenek
884a8996c5
retain/release checker: Refactor error-reporting code in EvalDeadSymbols and
...
EvalEndPath. This sets the stage for handling autorelease counts.
llvm-svn: 71283
2009-05-08 23:09:42 +00:00
Ted Kremenek
c218c84a80
Make BlockEntrace program points taggable.
...
llvm-svn: 71280
2009-05-08 23:08:34 +00:00