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
c902c85b6c
Tweak test case so that the expected-error text matches on both i686 and x86-64.
...
llvm-svn: 72181
2009-05-20 20:30:46 +00:00
Douglas Gregor
895ef6e6f9
Add a va_list/template instantiation test suggested by Eli
...
llvm-svn: 72178
2009-05-20 18:50:16 +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
1f275ba1b4
Add comments to test case.
...
llvm-svn: 72165
2009-05-20 09:03:10 +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
387f863dde
Bad anders.
...
llvm-svn: 72156
2009-05-20 01:27:39 +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
95fc37fd8f
Start documenting precompiled headers
...
llvm-svn: 72146
2009-05-20 00:16:32 +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
ba4a4a012f
Remove finished FIXME.
...
llvm-svn: 72137
2009-05-19 21:17:33 +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
Daniel Dunbar
018958d94d
Update test
...
llvm-svn: 72110
2009-05-19 16:09: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
45966b4671
Remove the -arch option from clang-cc: for all practical purposes, it's
...
redundant with -triple.
llvm-svn: 72108
2009-05-19 11:12:40 +00:00
Eli Friedman
996ef2f7b6
Move analysis command-line options out of AnalysisConsumer.cpp into
...
clang-cc.cpp.
With this commit, all of the clang-cc command-line options are defined
in clang-cc.cpp.
llvm-svn: 72107
2009-05-19 10:18:02 +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
f5012718b4
Add comment about FullExprArg.
...
llvm-svn: 72098
2009-05-19 04:13:11 +00:00
Eli Friedman
2bd0f3964c
Move CreateAnalysisConsumer into a separate header AnalysisConsumer.h.
...
Start moving things around in the direction of refactoring the
command-line options out of AnalysisConsumer.cpp.
llvm-svn: 72097
2009-05-19 03:57:28 +00:00
Eli Friedman
33cd03cd89
Move the options for dependency file generation from DependencyFile.cpp
...
to clang-cc.cpp. Also, rename CreateDependencyFileGen to
AttachDependencyFileGen, and make it take a raw_ostream rather than
opening a file itself.
llvm-svn: 72096
2009-05-19 03:35:57 +00:00
Eli Friedman
6af494b426
Move options for -E mode from PrintPreprocessedOutput.cpp to
...
clang-cc.cpp.
llvm-svn: 72095
2009-05-19 03:06:47 +00:00
Eli Friedman
26c672b490
Refactor -dM mode out of the main routine for -E handling.
...
llvm-svn: 72090
2009-05-19 01:32:34 +00:00
Eli Friedman
42279c0f07
Move the warning options from Warnings.cpp to clang-cc.cpp.
...
llvm-svn: 72089
2009-05-19 01:17:04 +00:00
Eli Friedman
fcb57d5b6a
Switch some utilities in clang-cc to take a stream instead of a
...
filename (or unconditionally using stdout).
llvm-svn: 72085
2009-05-19 01:02:07 +00:00
Ted Kremenek
59328da69f
Update checker build.
...
llvm-svn: 72084
2009-05-19 00:48:25 +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
Eli Friedman
2b6d281e11
Build fixes for r72060; sorry for any inconvenience.
...
llvm-svn: 72062
2009-05-18 23:02:01 +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
Eli Friedman
f22439a709
Move the Wno-rewrite-macros option out of RewriteObjC.cpp in prepration
...
for moving ASTConsumers.h to include/clang/Frontend.
llvm-svn: 72059
2009-05-18 22:39:16 +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
Eli Friedman
a63ab2dc76
Rename the factory function for the ObjC rewriter to something sane.
...
llvm-svn: 72055
2009-05-18 22:29:17 +00:00
Eli Friedman
e5594d724b
Move AnalysisConsumer out of ASTConsumers.h in preparation for moving
...
ASTConsumers.h to include/clang/Frontend.
llvm-svn: 72054
2009-05-18 22:25:55 +00:00
Eli Friedman
94cf21e282
Refactor ASTConsumers to take a raw_ostream instead of a filename where
...
appropriate. There shouldn't be any significant functionality change.
llvm-svn: 72052
2009-05-18 22:20:00 +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
Daniel Dunbar
f7a24e176c
Several fixes to the clang man page.
...
- -emit-llvm isn't a stage selection option.
- Document -O4 and -flto.
- -ObjC++ and -ObjC apply to all inputs, not subsequent ones.
- Some versions of pod2man aren't happy about the comment after =over=?
- Some minor grammar fixes.
llvm-svn: 72044
2009-05-18 21:34:46 +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
Daniel Dunbar
9b097a81fe
Simplify tests now that GNU runtime supports exception handling.
...
llvm-svn: 72021
2009-05-18 17:43:32 +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
b191180042
Oops, dropped a -verify
...
llvm-svn: 72016
2009-05-18 17:02:28 +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
f811647c27
Improve test case a wee bit
...
llvm-svn: 72014
2009-05-18 16:49:49 +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
cc89325969
Remove tabs.
...
llvm-svn: 71997
2009-05-18 07:48:06 +00:00
Eli Friedman
174c310967
Remove unused parameter.
...
llvm-svn: 71996
2009-05-18 07:39:39 +00:00
Eli Friedman
07cdffc295
Add some comments to ASTConsumers.h describing what the different
...
ASTConsumers actually do.
llvm-svn: 71992
2009-05-18 01:16:21 +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
Eli Friedman
c3dcdd0980
A few minor updates to the user manual.
...
llvm-svn: 71964
2009-05-16 23:17:30 +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
Daniel Dunbar
f39ea8535b
Update test case; I'm confused why this wasn't failing on the buildbot
...
though?
llvm-svn: 71955
2009-05-16 19:30:01 +00:00
Sebastian Redl
45be55d181
Test case for previous commit. Explicit instantiation does the trick. (Thanks, Anders.)
...
llvm-svn: 71954
2009-05-16 18:59:35 +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
4f8b8ed2ac
Missing change for r71941 (PR2044).
...
llvm-svn: 71947
2009-05-16 13:58:00 +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
Ted Kremenek
f0d3237474
Update checker build.
...
llvm-svn: 71929
2009-05-16 06:05:27 +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
e5cc0f3288
Introduce the EXPR macro into StmtNodes.def, so that we can
...
distinguish between expression and statement nodes. No functionality
change.
llvm-svn: 71902
2009-05-15 22:19:30 +00:00
Douglas Gregor
5d13868263
Template instantiation for "for" loops
...
llvm-svn: 71901
2009-05-15 22:12:32 +00:00
Ted Kremenek
926dffce01
Update checker build.
...
llvm-svn: 71900
2009-05-15 21:56:27 +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
Ted Kremenek
eef7a21507
Add hack to scan-build to fix PR 4215
...
(http://llvm.org/bugs/show_bug.cgi?id=4215 ): When xcodebuild is invoked with
-sdk iphonesimulator3.0, use gcc-4.2 instead of the system default gcc.
llvm-svn: 71891
2009-05-15 21:14:16 +00:00
Fariborz Jahanian
5e15186c9a
added -fblocks to the test.
...
llvm-svn: 71890
2009-05-15 20:49:33 +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
Anders Carlsson
2101e68398
Add SemaTemplateInstantiateStmt.cpp to Xcode project.
...
llvm-svn: 71884
2009-05-15 20:08:59 +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
Ted Kremenek
a3d4d7b4fa
Update checker build.
...
llvm-svn: 71874
2009-05-15 18:40:51 +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
2aab87f393
Update checker build.
...
llvm-svn: 71846
2009-05-15 05:59:34 +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
46727df06a
Re-enable passing analyzer options from scan-build to ccc-analyzer.
...
llvm-svn: 71836
2009-05-15 04:20:31 +00:00
Ted Kremenek
f9903da7fa
Don't strip quotes in compiler line for -D arguments.
...
Fixes PR 4205.
llvm-svn: 71835
2009-05-15 04:07:18 +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
Anders Carlsson
ee209a6501
Add SemaTemplateInstantiateExpr.cpp to Xcode project.
...
llvm-svn: 71820
2009-05-15 00:10:12 +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
Anders Carlsson
0224c67400
Fix the same speling error in the test case (Duh).
...
llvm-svn: 71793
2009-05-14 21:20: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
Anders Carlsson
339869e986
Fix a speling error.
...
llvm-svn: 71791
2009-05-14 21:03:44 +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
2daacd1f08
Avoid generating temp in source directory
...
llvm-svn: 71776
2009-05-14 17:00:11 +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
Douglas Gregor
8533490df9
Add forward declaration of Token. Thanks to Martin Doucha for pointing this out
...
llvm-svn: 71772
2009-05-14 15:47:53 +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
Daniel Dunbar
ffe4e63b40
Note that clang follows the MSVC definition for #pragma pack.
...
llvm-svn: 71725
2009-05-13 21:40:49 +00:00
Daniel Dunbar
0aef72c697
Add a test case to showcase a difference in #pragma pack handling
...
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.
llvm-svn: 71723
2009-05-13 21:34:08 +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
Ted Kremenek
2b77677322
Update checker build.
...
llvm-svn: 71716
2009-05-13 20:49:00 +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
4060be74d9
Add PostStmt::getStmtAs(). This unbreaks the build.
...
llvm-svn: 71701
2009-05-13 19:23:41 +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
Ted Kremenek
a2d3093da7
Add ExplodedNode utility methods 'getLocationAs()' and 'getFirstPred()'
...
llvm-svn: 71699
2009-05-13 19:14:06 +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
Chris Lattner
939952c19c
remove the obsolete -fprint-source-range-info option
...
llvm-svn: 71675
2009-05-13 17:08:18 +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
c898a68998
convert test to use -verify
...
llvm-svn: 71642
2009-05-13 06:07:25 +00:00
Chris Lattner
cfd0fadc75
rename test
...
llvm-svn: 71641
2009-05-13 06:07:04 +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
Fariborz Jahanian
d9d6e6e039
Changed wording of warning when attribute is on
...
method definition.
llvm-svn: 71615
2009-05-13 00:47:33 +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
Daniel Dunbar
98d7164ab0
Tweak wording
...
llvm-svn: 71611
2009-05-13 00:23:53 +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
Daniel Dunbar
e83b560e06
Note a few more unsupported language extensions.
...
llvm-svn: 71607
2009-05-12 23:12:07 +00:00
Ted Kremenek
14fbc56a09
Update checker build.
...
llvm-svn: 71605
2009-05-12 22:44:02 +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
Douglas Gregor
2779733d0e
Diagnostic wording fix, from Anders Johnsen
...
llvm-svn: 71584
2009-05-12 20:24: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
Douglas Gregor
9e0d21a444
Align the N/A in the C++ status table, from Anders Johnsen
...
llvm-svn: 71576
2009-05-12 18:36:58 +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
Ted Kremenek
3c2775f0b0
Make scan-build process of --use-cc and --html-title more robust.
...
llvm-svn: 71567
2009-05-12 18:04:43 +00:00
Douglas Gregor
5a4d12afbf
Fill in more C++ status. We're now using the check mark to mean,
...
"complete, and we have tests for every paragraph".
llvm-svn: 71564
2009-05-12 17:55:28 +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
Chris Lattner
32efff659c
wrap up a version of the man page that is minimally helpful, but somewhat complete.
...
llvm-svn: 71524
2009-05-12 00:47:40 +00:00
Ted Kremenek
df5a6b6070
Update checker build.
...
llvm-svn: 71523
2009-05-12 00:45:33 +00:00
Chris Lattner
66c64f9ba4
add some more content.
...
llvm-svn: 71518
2009-05-12 00:01:32 +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
Ted Kremenek
25421bb8f6
Use Text::ParseWords to make 'clang -###' parsing more robust.
...
llvm-svn: 71504
2009-05-11 23:29:51 +00:00
Daniel Dunbar
a3bb6f2e5b
Tweak this non-default test so it still works w/ x86 feature support.
...
llvm-svn: 71494
2009-05-11 23:11:21 +00:00
Daniel Dunbar
e90fa18d6c
Test for x86 target features, I forgot to commit this.
...
llvm-svn: 71492
2009-05-11 23:06:15 +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
Chris Lattner
e3c3f40404
pull a bunch of options out of clang-cc.cpp. This doesn't include
...
options that the driver swizzles.
llvm-svn: 71487
2009-05-11 22:45:37 +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
Daniel Dunbar
e92449e4cc
Make cleanup-stack.c test stronger, and work in release-asserts mode.
...
llvm-svn: 71484
2009-05-11 22:30:29 +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