Ted Kremenek
005e8a06f2
Cleanups and fixes to the nil-receiver checker, some of it fallout the
...
initial transition of the nil-receiver checker to the Checker
interface as done in r89745. Some important changes include:
1) We consolidate the BugType object used for nil receiver bug
reports, and don't include the type of the returned value in the
BugType (which would be wrong if a nil receiver bug was reported more
than once)
2) Added a new (temporary) flag to CheckerContext: DoneEvauating.
This is used by GRExprEngine when evaluating message expressions to
not continue evaluating the message expression if this flag is set.
This flag is currently set by the nil receiver checker. This is an
intermediate solution to allow the nil-receiver checker to properly
work as a plug-in outside of GRExprEngine. Basically, this flag
indicates that the entire message expression has been evaluated, not
just a precondition (which is what the nil-receiver checker does).
This flag *should not* be repurposed for general use, but just to pull
more things out of GRExprEngine that already in there as we devise a
better interface in the Checker class.
3) Cleaned up the logic in the nil-receiver checker, making the
control-flow a lot easier to read.
llvm-svn: 89804
2009-11-24 21:41:28 +00:00
Fariborz Jahanian
4fa66ce244
Refactor argument collection of constructor calls using
...
the common routine.
llvm-svn: 89802
2009-11-24 21:37:28 +00:00
Douglas Gregor
7f800f9d50
"Do" loops cannot have condition variables, so don't parse them.
...
llvm-svn: 89801
2009-11-24 21:34:32 +00:00
Douglas Gregor
680f861d74
Clean up the AST for while loops and fix several problems with
...
cleanups for while loops:
1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,
while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}
2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,
while (blah)
RAIIObject raii(blah+1);
llvm-svn: 89800
2009-11-24 21:15:44 +00:00
Anders Carlsson
3c9beab48a
Handle references correctly when synthesizing copy constructors.
...
With this change, the clang-on-clang test result is now
Expected Passes : 224
Unexpected Failures: 37
Which means that we can compile over 80% of clang with clang! :)
llvm-svn: 89799
2009-11-24 21:08:10 +00:00
John McCall
45b1a47a9c
Fix some major problems dealing with dependently-qualified names in implicit
...
member-reference contexts. Fixes some clang-on-clang asserts.
llvm-svn: 89796
2009-11-24 20:33:45 +00:00
Fariborz Jahanian
6f2d25e441
More cleanup of argument call collection.
...
llvm-svn: 89789
2009-11-24 19:27:49 +00:00
John McCall
e66edc18ae
Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
...
DependentScopeDeclRefExpr support storing templateids. Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.
This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.
Also resolves a few FIXMEs.
llvm-svn: 89785
2009-11-24 19:00:30 +00:00
Anders Carlsson
3a202f601e
Handle cases where we're constructing an array of objects and the constructor has default arguments.
...
llvm-svn: 89783
2009-11-24 18:43:52 +00:00
John McCall
847e2a10d6
Helper function for turning a TemplateName into a DeclarationName.
...
llvm-svn: 89782
2009-11-24 18:42:40 +00:00
Fariborz Jahanian
835026e9f1
Refactor collection of call arguments in common code.
...
Add support for variadic collection functions. More to do
here.
llvm-svn: 89781
2009-11-24 18:29:37 +00:00
Anders Carlsson
0b11a3ef71
GNUNullExpr is a valid sentinel even though it isn't of pointer type.
...
llvm-svn: 89778
2009-11-24 17:24:21 +00:00
Douglas Gregor
dcf1962405
Explicitly store the condition variable within switch statements, and
...
make sure that this variable is destroyed when we exit the switch
statement.
llvm-svn: 89776
2009-11-24 17:07:59 +00:00
Anders Carlsson
b9f96a3286
We always need to emit the base expression of a member expression, even when the member decl refers to an enum. Thanks to Eli for pointing this out!
...
llvm-svn: 89775
2009-11-24 16:57:33 +00:00
Anders Carlsson
b7408b95ed
Fix a crash when "instantiating" VarDecls that are neither type nor value dependent.
...
llvm-svn: 89774
2009-11-24 16:52:50 +00:00
Douglas Gregor
965f450d42
Introduce cleanup scopes for "if" statements in two places:
...
- Outside the "if", to ensure that we destroy the condition variable
at the end of the "if" statement rather than at the end of the
block containing the "if" statement.
- Inside the "then" and "else" branches, so that we emit then- or
else-local cleanups at the end of the corresponding block when the
block is not a compound statement.
To make adding these new cleanup scopes easier (and since
switch/do/while will all need the same treatment), added the
CleanupScope RAII object to introduce a new cleanup scope and make
sure it gets cleaned up.
llvm-svn: 89773
2009-11-24 16:43:22 +00:00
Douglas Gregor
48a409eb39
Rename CleanupScope -> DelayedCleanupBlock. No functionality change.
...
llvm-svn: 89769
2009-11-24 16:21:10 +00:00
Douglas Gregor
0156d1c8db
Un-break instantiation of if statements with conditional variables
...
llvm-svn: 89767
2009-11-24 16:07:02 +00:00
Edward O'Callaghan
db521ec23b
Fix for PR5568.
...
llvm-svn: 89766
2009-11-24 15:23:21 +00:00
Zhongxing Xu
c2998766f0
We can remove this file now.
...
llvm-svn: 89751
2009-11-24 08:28:49 +00:00
Zhongxing Xu
c6123a1a3c
Refactor undefined result checker. This is the last one.
...
llvm-svn: 89750
2009-11-24 08:24:26 +00:00
Zhongxing Xu
9e200798c2
Refactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into
...
CallAndMessageChecker.
llvm-svn: 89745
2009-11-24 07:06:39 +00:00
Anders Carlsson
59486a2ddb
Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTemporaries.
...
llvm-svn: 89742
2009-11-24 05:51:11 +00:00
Anders Carlsson
bd97548f35
When mangling a ctor/dtor we need to take into consideration whether it's a member template.
...
llvm-svn: 89741
2009-11-24 05:36:32 +00:00
Anders Carlsson
65e6d131f0
Set the template specialization kind before instantiating the function definition so that the function will have the right linkage.
...
llvm-svn: 89740
2009-11-24 05:34:41 +00:00
Eli Friedman
fb8a93fe1d
Teach Evaluate to handle member expressions referring to enum constants and
...
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.
llvm-svn: 89738
2009-11-24 05:28:59 +00:00
Anders Carlsson
0ade9715f2
Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.
...
llvm-svn: 89737
2009-11-24 05:16:24 +00:00
Anders Carlsson
6445773279
It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.
...
Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".
llvm-svn: 89736
2009-11-24 05:08:52 +00:00
Zhongxing Xu
72269ec8cb
rename UndefinedArgChecker to CallAndMessageChecker.
...
llvm-svn: 89735
2009-11-24 04:45:44 +00:00
Zhongxing Xu
da32375115
Rename: UndefinedArgChecker.cpp => CallAndMessageChecker.cpp
...
llvm-svn: 89734
2009-11-24 04:08:01 +00:00
Ted Kremenek
c0229557dd
Enhance null dereference diagnostics by indicating what variable (if any) was dereferenced. Addresses <rdar://problem/7039161>.
...
llvm-svn: 89726
2009-11-24 01:33:10 +00:00
Daniel Dunbar
8d731964d0
Sketch the rest of the clang -cc1 option definitions, aka fun with C-x C-(.
...
llvm-svn: 89721
2009-11-24 00:54:16 +00:00
Douglas Gregor
633caca353
Explicitly track the condition variable within an "if" statement,
...
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.
llvm-svn: 89717
2009-11-23 23:44:04 +00:00
Daniel Dunbar
8a9fa3af69
Add clang -cc1 parsing of diagnostic options.
...
llvm-svn: 89716
2009-11-23 23:41:17 +00:00
Ted Kremenek
b0c0b08c71
After performing a bounds check in ArrayBoundChecker, record the fact that a bounds check succeeded by transitioning the ExplodedGraph.
...
llvm-svn: 89712
2009-11-23 23:23:26 +00:00
Ted Kremenek
f57351570e
Clean up the Checker API a little more, resolving some hidden bugs
...
along the way. Important changes:
1) To generate a sink node, use GenerateSink(); GenerateNode() is for
generating regular transitions. This makes the API clearer and also
allows us to use the 'bool' option to GenerateNode() for a different
purpose.
2) GenerateNode() now automatically adds the generated node to the
destination ExplodedNodeSet (autotransition) unless the client
specifies otherwise with a bool flag. Several checkers did not call
'addTransition()' after calling 'GenerateNode()', causing the
simulation path to be prematurely culled when a non-fail stop bug was
encountered.
3) Add variants of GenerateNode()/GenerateSink() that take neither a
Stmt* or a GRState*; most callers of GenerateNode() just pass in the
same Stmt* as provided when the CheckerContext object is created; we
can just use that the majority of the time. This cleanup also allows
us to potentially coelesce the APIs for evaluating branches and
end-of-paths (which currently directly use builders).
4) addTransition() no longer needs to be called except for a few
cases. We now have a variant of addTransition() that takes a
GRState*; this allows one to propagate the updated state without
caring about generating a new node explicitly. This nicely cleaned up
a bunch of cases that called autoTransition() with a bunch of
conditional logic surround the call (that common logic has now been
swallowed up by addTransition() itself).
llvm-svn: 89707
2009-11-23 22:22:01 +00:00
Anders Carlsson
f2e4f72f03
Don't try to treat an enum constant as an lvalue.
...
llvm-svn: 89705
2009-11-23 21:56:41 +00:00
Anders Carlsson
2e7bc11f11
Convert the && and || operands to bool using standard conversions. Fixes PR5593.
...
llvm-svn: 89704
2009-11-23 21:47:44 +00:00
Fariborz Jahanian
d25c219475
Fixe a crash in encoding of SEL type caused by recent changes.
...
llvm-svn: 89696
2009-11-23 20:40:50 +00:00
Anders Carlsson
7fa434c2b8
Handle converting member pointers to bool.
...
llvm-svn: 89692
2009-11-23 20:04:44 +00:00
Fariborz Jahanian
3f21c159dc
Fix a recent regression probably caused by addition of altivec-style
...
type-casts in the parser.
llvm-svn: 89691
2009-11-23 19:51:43 +00:00
Ted Kremenek
b43737387b
Provide out-of-line definition for destructor of Checker.
...
llvm-svn: 89688
2009-11-23 18:53:03 +00:00
Ted Kremenek
02d6aca867
Tweak UndefBranchChecker to register the most nested "undefined" expression with bugreporter::registerTrackNullOrUndefValue instead of the condition itself.
...
llvm-svn: 89682
2009-11-23 18:12:03 +00:00
Fariborz Jahanian
0afc555196
Make 'SEL' pointer to a builtin type and not an
...
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).
llvm-svn: 89680
2009-11-23 18:04:25 +00:00
Ted Kremenek
d4dca6fde6
Cleanup title/description of "undefined branch" BugType and add some test cases for this check.
...
llvm-svn: 89679
2009-11-23 17:58:48 +00:00
Anders Carlsson
8c793172c2
Handle base-to-derived casts. Will land test case shortly.
...
llvm-svn: 89678
2009-11-23 17:57:54 +00:00
John Thompson
d976d3e552
Put back hard-coded paths for win32 until I figure out what happened to failed tests.
...
llvm-svn: 89677
2009-11-23 17:49:27 +00:00
Sebastian Redl
22e2e5c423
Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.
...
llvm-svn: 89668
2009-11-23 17:18:46 +00:00
Rafael Espindola
962e518da2
Reorder the header search a bit so that it matches gcc exactly:
...
*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first
llvm-svn: 89661
2009-11-23 16:31:19 +00:00
Sebastian Redl
a6602e9e2a
Let using directives refer to namespace aliases. Fixes PR5479.
...
llvm-svn: 89657
2009-11-23 15:34:23 +00:00
Douglas Gregor
378e1923b6
Require a class type to be complete before probing its conversion
...
functions for a switch condition's conversion to integral or
enumeration type.
llvm-svn: 89656
2009-11-23 13:53:21 +00:00
Douglas Gregor
d0c22e0d10
Implement conversion from a switch condition with class type to an
...
integral or enumeration type (vi user-defined conversions). Fixes PR5518.
llvm-svn: 89655
2009-11-23 13:46:08 +00:00
Douglas Gregor
bd866c2985
Canonical template arguments that are template template parameters by
...
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.
llvm-svn: 89654
2009-11-23 12:52:47 +00:00
Douglas Gregor
601f4f0b07
Improve type-checking of templates by distinguishing between members
...
of the current instantiation and members of an unknown specialization
when type-checking a qualified-if expression.
llvm-svn: 89653
2009-11-23 12:39:54 +00:00
Douglas Gregor
27381f3d93
Do not mark declarations as used when performing overload resolution. Fixes PR5541
...
llvm-svn: 89652
2009-11-23 12:27:39 +00:00
Douglas Gregor
65911498ef
Tolerate extraneous "template<>" headers better, downgrading the
...
complaint to a warning and providing a helpful node in the case where
the "template<>" header is redundant because the corresponding
template-id refers to an explicit specialization. C++0x might still
change this behavior, and existing practice is all over the place on
the number of "template<>" headers actually needed.
llvm-svn: 89651
2009-11-23 12:11:45 +00:00
Douglas Gregor
1c3feb5b25
Fix CMake build
...
llvm-svn: 89650
2009-11-23 12:03:50 +00:00
Douglas Gregor
ed6c744091
Centralize and complete the computation of value- and type-dependence for DeclRefExprs
...
llvm-svn: 89649
2009-11-23 11:41:28 +00:00
Zhongxing Xu
5f76620b53
UndefBranchChecker: more bug reporter helper information emit.
...
llvm-svn: 89643
2009-11-23 03:29:59 +00:00
Zhongxing Xu
56dd5f0f70
Initial refactor of UndefBranchChecker. We still use GRBranchNodeBuilder
...
in the checker directly. But I don't have a better approach for now.
llvm-svn: 89640
2009-11-23 03:20:54 +00:00
John McCall
6b51f28e82
Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
...
a new class. Use it pervasively throughout Sema.
My fingers hurt.
llvm-svn: 89638
2009-11-23 01:53:49 +00:00
Daniel Dunbar
785406bd19
Teach CodeGenFunction::EmitDecl to ignore Using and UsingShadow decls.
...
llvm-svn: 89633
2009-11-23 00:07:06 +00:00
Daniel Dunbar
e1cd0152a9
x86_64, PR5582: Layout bases for C++ records.
...
- Ideally we would have an single iteration interface for this, but this works
for now.
llvm-svn: 89632
2009-11-22 23:01:23 +00:00
Daniel Dunbar
180f1fe4ce
Recognize .hpp as a C++ header.
...
llvm-svn: 89630
2009-11-22 22:08:27 +00:00
Daniel Dunbar
f5835ea2e7
Add clang -cc1 parsing of analyzer options.
...
llvm-svn: 89629
2009-11-22 22:08:20 +00:00
John McCall
dc7b6079eb
Fix LookupResult's sanity-check to handle shadow decls.
...
llvm-svn: 89624
2009-11-22 20:57:36 +00:00
Ted Kremenek
12b64959ce
Change CheckDeadStores to use Expr::isNullPointerConstant, which will correctly determine whether an expression is a null pointer constant.
...
Patch by Kovarththanan Rajaratnam!
llvm-svn: 89621
2009-11-22 20:26:21 +00:00
Anders Carlsson
5838108317
Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.
...
llvm-svn: 89613
2009-11-22 19:25:33 +00:00
Anders Carlsson
ba958400a2
When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.
...
llvm-svn: 89611
2009-11-22 19:13:51 +00:00
Anders Carlsson
072094407d
Move bit-field layout out into a separate function. No functionality change.
...
llvm-svn: 89604
2009-11-22 17:37:31 +00:00
Ken Dyck
f540ae5ab3
Define SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.
...
llvm-svn: 89598
2009-11-22 15:47:12 +00:00
Ken Dyck
adc8511bc8
Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.
...
llvm-svn: 89597
2009-11-22 15:41:04 +00:00
Zhongxing Xu
014af28ce3
Undefined compound assignment result is checked in UndefinedAssignmentChecker. So this check is redundant.
...
llvm-svn: 89592
2009-11-22 13:36:20 +00:00
Zhongxing Xu
39638e133a
Remove invalid comments. The result is undefined only when operands are undefined.
...
llvm-svn: 89591
2009-11-22 13:30:10 +00:00
Zhongxing Xu
7f83e97b00
Save and restore the HasGen flag in MallocChecker.
...
llvm-svn: 89590
2009-11-22 13:22:34 +00:00
Benjamin Kramer
df58afae56
Don't include a dead header.
...
llvm-svn: 89587
2009-11-22 12:51:08 +00:00
Zhongxing Xu
f0b7fc8890
Remove UndefinedAssignmentChecker's header.
...
llvm-svn: 89585
2009-11-22 12:29:52 +00:00
John McCall
a9ee325d71
If a C++ qualified id is followed by a postfix suffix, it is never the direct
...
operand of an addressof operator, and so we should not treat it as an abstract
member-pointer expression and therefore suppress the implicit member access.
This is really a well-formedness constraint on expressions: a DeclRefExpr of
a FieldDecl or a non-static CXXMethodDecl (or template thereof, or unresolved
collection thereof) should not be allowed in an arbitrary location in the AST.
Arguably it shouldn't be allowed anywhere and we should have a different expr
node type for this. But unfortunately we don't have a good way of enforcing
this kind of constraint right now.
llvm-svn: 89578
2009-11-22 02:49:43 +00:00
John McCall
b53bbd42c8
Reorganize the intermediate BuildDeclarationNameExpr routines again.
...
llvm-svn: 89575
2009-11-22 01:44:31 +00:00
John McCall
283b901cf3
Consider a FunctionTemplate to be an overload all on its lonesome. Track
...
this information through lookup rather than rederiving it.
llvm-svn: 89570
2009-11-22 00:44:51 +00:00
Anders Carlsson
e18e29eeb9
Support emitting aggregate class initializers. Fixes PR5581.
...
llvm-svn: 89569
2009-11-21 23:56:04 +00:00
Fariborz Jahanian
252ba5fb6f
This patch implements objective-c's 'SEL' type as a built-in
...
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:
Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.
Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.
llvm-svn: 89561
2009-11-21 19:53:08 +00:00
Ted Kremenek
d354278b51
Make FixedAddressChecker and experimental check; it currently produces a ton of false positives when analyzing some projects (e.g., Wine).
...
llvm-svn: 89560
2009-11-21 17:55:24 +00:00
John McCall
4b1f16e6f8
Overload resolution doesn't decide whether to do ADL or not anymore; stopping
...
threading that state.
llvm-svn: 89557
2009-11-21 09:38:42 +00:00
Daniel Dunbar
88ad4c5d02
Mangler: Sketch mangling for TemplateArgument::Declaration kind.
...
- Several important FIXMEs related to whether arguments are expressions or external names, and the mangling of extern "C" names (c.f., PR5522).
llvm-svn: 89556
2009-11-21 09:17:15 +00:00
Daniel Dunbar
e949e6cced
Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.
...
- Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression).
- This also tidies up the predicate to be more obvious what is getting mangled.
llvm-svn: 89555
2009-11-21 09:14:52 +00:00
Daniel Dunbar
161ade4455
Mangler: Strengthen invariants, MangleContext::mangleName should only be called on var or function decls.
...
llvm-svn: 89554
2009-11-21 09:14:44 +00:00
Daniel Dunbar
8483d211bd
Mangler: Inline a bunch of functions into their sole caller, not that I don't love typing for typings sake, but...
...
llvm-svn: 89553
2009-11-21 09:12:13 +00:00
Daniel Dunbar
671f45e701
DeclPrinter: Indent access specifiers.
...
llvm-svn: 89552
2009-11-21 09:12:06 +00:00
Daniel Dunbar
1110dc06a8
Remove dead variable.
...
llvm-svn: 89551
2009-11-21 09:11:59 +00:00
Daniel Dunbar
fdae6f7cd3
Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.
...
llvm-svn: 89550
2009-11-21 09:11:45 +00:00
Daniel Dunbar
4118ec5571
IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.
...
llvm-svn: 89549
2009-11-21 09:06:31 +00:00
Daniel Dunbar
e128dd18ab
IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
...
instead of requiring clients to make a raw_svector_ostream, which is just an
implementation detail.
llvm-svn: 89548
2009-11-21 09:06:22 +00:00
Daniel Dunbar
ef5d75afeb
Sink free mangle* methods into MangleContext.
...
llvm-svn: 89547
2009-11-21 09:06:10 +00:00
Daniel Dunbar
4f1054ef2e
Add 1+2 consts.
...
llvm-svn: 89546
2009-11-21 09:05:59 +00:00
Daniel Dunbar
d614e326db
Delete trailing space.
...
llvm-svn: 89545
2009-11-21 09:05:47 +00:00
John McCall
d14a86427f
"Incremental" progress on using expressions, by which I mean totally ripping
...
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.
Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.
Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.
The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.
llvm-svn: 89544
2009-11-21 08:51:07 +00:00
Alexis Hunt
96d5c76498
Added rudimentary C++0x attribute support.
...
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)
llvm-svn: 89543
2009-11-21 08:43:09 +00:00
Daniel Dunbar
f4b39e9c95
Fix refacto, gcc's cc1 needs to see --output-pch=, which is not just an alias
...
for -output-pch=.
llvm-svn: 89534
2009-11-21 02:31:29 +00:00
Douglas Gregor
26aedb7460
Implement C++ [temp.param]p2 correctly, looking ahead when we see a
...
"typename" parameter to distinguish between non-type and type template
parameters. Fixes the actual bug in PR5559.
llvm-svn: 89532
2009-11-21 02:07:55 +00:00
Ted Kremenek
9d6daf2cc4
Restructure DereferenceChecker slightly to handle caching out when we would report a null dereference more than once.
...
llvm-svn: 89526
2009-11-21 01:50:48 +00:00
Ted Kremenek
caf2c51fad
Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker also handled undefined receivers in message expressions.
...
llvm-svn: 89524
2009-11-21 01:25:37 +00:00
Edward O'Callaghan
847f2a10ee
Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
...
llvm-svn: 89520
2009-11-21 00:49:54 +00:00
Ted Kremenek
f7adea43b4
More checker refactoring. Passing undefined values in a message expression is now handled by UndefinedArgChecker.
...
llvm-svn: 89519
2009-11-21 00:49:41 +00:00
John Thompson
c1b70ab9b8
Revised Win32 include path to search highest version in registry, plus platform SDK path
...
llvm-svn: 89517
2009-11-21 00:15:52 +00:00
Mike Stump
58ef18b38c
Checkpoint current work. WIP.
...
llvm-svn: 89513
2009-11-20 23:44:51 +00:00
Douglas Gregor
ade9bcd72e
Cope with extraneous "template" keyword when providing an out-of-line
...
definition of a member template (or a member thereof). Fixes PR5566.
llvm-svn: 89512
2009-11-20 23:39:24 +00:00
Daniel Dunbar
a764eef0e9
Driver: Add clang -cc1 dependency output options parsing.
...
llvm-svn: 89508
2009-11-20 23:28:07 +00:00
Daniel Dunbar
a604639635
Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
...
llvm-svn: 89503
2009-11-20 22:47:55 +00:00
Daniel Dunbar
2eaef18e76
Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.
...
llvm-svn: 89502
2009-11-20 22:32:38 +00:00
Daniel Dunbar
4274685b63
Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
...
llvm-svn: 89498
2009-11-20 22:21:52 +00:00
Daniel Dunbar
8bed86c43e
Standardize Driver translation to call clang-cc using '-foo' form instead of '--foo'.
...
llvm-svn: 89497
2009-11-20 22:21:36 +00:00
Douglas Gregor
a25d65d1b6
Implement C++ [basic.lookup.classref]p3, which states how the type
...
name 'T' is looked up in the expression
t.~T()
Previously, we weren't looking into the type of "t", and therefore
would fail when T actually referred to an injected-class-name. Fixes
PR5530.
llvm-svn: 89493
2009-11-20 22:03:38 +00:00
Douglas Gregor
e4f764f013
When checking the base object of a member access expression (b.foo,
...
b->foo), don't look through pointers unless we have an -> operator.
llvm-svn: 89480
2009-11-20 19:58:21 +00:00
Douglas Gregor
51c538bee4
Teach FixOverloadedFunctionReference to build new expression ASTs rather
...
than tweaking existing ASTs, since we were (*gasp*) stomping on ASTs
within templates. I'm glad we found this little stick of TNT early...
llvm-svn: 89475
2009-11-20 19:42:02 +00:00
Anders Carlsson
0a66c26191
Fix lifetime of conditional temporaries. Patch by Victor Zverovich!
...
llvm-svn: 89467
2009-11-20 17:27:56 +00:00
Daniel Dunbar
69fd86dd44
Add clang -cc1 parsing of CodeGenOptions.
...
llvm-svn: 89464
2009-11-20 17:23:30 +00:00
Ken Dyck
33211d9658
Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
...
UINT<n>_C(v) macros.
llvm-svn: 89461
2009-11-20 16:49:10 +00:00
Ken Dyck
8dcc21420b
Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
...
and UINT<n>_MAX defintions.
llvm-svn: 89460
2009-11-20 16:44:38 +00:00
Ken Dyck
764a5f3881
Avoid unwanted macro expansion in macros that paste together int<n>_t and
...
uint<n>_t definitions.
llvm-svn: 89459
2009-11-20 16:37:35 +00:00
David Chisnall
bc8bdea183
Fixed crash when using undefined protocols (GNU runtime).
...
llvm-svn: 89457
2009-11-20 14:50:59 +00:00
Benjamin Kramer
7d875c7e7e
Fix typo GCC 4.3 warned about.
...
llvm-svn: 89453
2009-11-20 10:03:00 +00:00
Eli Friedman
564048e692
Fix a couple minor memory leaks.
...
llvm-svn: 89450
2009-11-20 05:53:06 +00:00
Ted Kremenek
a4f7c180ae
Add simple static analyzer checker to check for sending 'release', 'retain', etc. directly to a class. Fixes <rdar://problem/7252064>.
...
llvm-svn: 89449
2009-11-20 05:27:05 +00:00
Ted Kremenek
c1f161c012
Unused ivar checker: ivars referenced by lexically nested functions should not be flagged as unused. Fixes <rdar://problem/7254495>.
...
llvm-svn: 89448
2009-11-20 04:31:57 +00:00
Zhongxing Xu
ab0ae2139a
Revert r89437 and add a comment.
...
llvm-svn: 89446
2009-11-20 03:50:46 +00:00
Mike Stump
d8d26d06a5
Implement throw d, where d is a class type that requires copy
...
construction. WIP.
llvm-svn: 89442
2009-11-20 02:31:07 +00:00
Douglas Gregor
3153da7154
Don't build an explicit conversion to a reference type
...
llvm-svn: 89441
2009-11-20 02:31:03 +00:00
Mike Stump
4d7a07bdaf
Handle throw d, where d is a class type but only has a trivial copy
...
constructor. WIP.
llvm-svn: 89438
2009-11-20 01:57:39 +00:00
Zhongxing Xu
6d9a942174
It's unnecessary to check for unknown at this point.
...
llvm-svn: 89437
2009-11-20 01:56:48 +00:00
Daniel Dunbar
f7535121a2
Driver: Add parsing for TargetOptions to CompilerInvocation::CreateFromArgs.
...
llvm-svn: 89435
2009-11-20 01:46:44 +00:00
Douglas Gregor
ee9067c51f
When we have a non-dependent expression such as
...
A::f
that occurs within a non-static member function with a type-dependent
"this", don't consider this to be a case for introduction of an
implicit "(*this)." to refer to a specific member function unless we
know (at template definition time) that A is a base class of *this.
There is some disagreement here between GCC, EDG, and Clang about the
handling of this case. I believe that Clang now has the correct,
literal interpretation of the standard, but have asked for
clarification (c++std-core-15483).
llvm-svn: 89425
2009-11-20 00:59:20 +00:00
Mike Stump
d1782cc478
Add suport for throw;. WIP.
...
llvm-svn: 89424
2009-11-20 00:56:31 +00:00
Mike Stump
18fc44dfd3
Fix rtti generation for throws. WIP.
...
llvm-svn: 89420
2009-11-20 00:43:57 +00:00
Mike Stump
101f052faf
Simplify rtti building code a little. Prep for reuse for throw rtti
...
generation.
llvm-svn: 89416
2009-11-20 00:31:50 +00:00
Ted Kremenek
dd2b2b23c8
Fix null dereference in NSAutoreleasePoolChecker when analyzing messages sent to blocks.
...
llvm-svn: 89413
2009-11-20 00:12:36 +00:00
Mike Stump
a7a1b7e780
Fixup key function calculations.
...
llvm-svn: 89412
2009-11-20 00:02:19 +00:00
Douglas Gregor
deebf6efab
Deduce a ConstantArrayType from a value-dependent initializer list
...
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!
llvm-svn: 89407
2009-11-19 23:25:22 +00:00
John McCall
8cd7813ca3
Draw a brighter line between "unresolved" expressions, where we have done the
...
appropriate lookup and simply can't resolve the referrent yet, and
"dependent scope" expressions, where we can't do the lookup yet because the
entity we need to look into is a dependent type.
llvm-svn: 89402
2009-11-19 22:55:06 +00:00
Fariborz Jahanian
e774fa6412
Don't issue spurious diagnostic with Obj-C fast enumeration.
...
(radar 7409165).
llvm-svn: 89400
2009-11-19 22:12:37 +00:00
Daniel Dunbar
84e8a249fa
Fix some default in the option classes, and some CompilerInvocation argification
...
errors.
llvm-svn: 89388
2009-11-19 20:54:59 +00:00
Mike Stump
cd2b821241
Fixup address point computations. WIP.
...
llvm-svn: 89386
2009-11-19 20:52:19 +00:00
Ted Kremenek
439a6d146c
Fix crash when using --analyzer-store=region when handling initializers with nested arrays/structs whose values are not explicitly specified. Fixes <rdar://problem/7403269>.
...
llvm-svn: 89384
2009-11-19 20:20:24 +00:00
Ted Kremenek
0c54d2da14
Remove printf statement.
...
llvm-svn: 89383
2009-11-19 20:01:53 +00:00
Ted Kremenek
4b35a2ed08
Only fetch the ASTContext object within the assertion.
...
llvm-svn: 89375
2009-11-19 19:04:08 +00:00
Daniel Dunbar
5d26212f6b
Silence -Asserts warning.
...
llvm-svn: 89373
2009-11-19 18:53:25 +00:00
Daniel Dunbar
8c9efca5bd
Driver: Move INPUT and UNKNOWN sentinel options into the OptParser.td file.
...
llvm-svn: 89371
2009-11-19 18:47:17 +00:00
Fariborz Jahanian
1eab66c7cc
Patch to implement new-operators with default args.
...
Fixes pr5547.
llvm-svn: 89370
2009-11-19 18:39:40 +00:00
Douglas Gregor
ad2956c25d
Cope with an amusingly little anomaly with dependent types and
...
incomplete array initialization, where we have the following in a
template:
int a[] = { 1, 2, something-value-dependent };
// ...
sizeof(a);
The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).
llvm-svn: 89366
2009-11-19 18:03:26 +00:00
John Thompson
e467e19766
Added preliminary support step for PS3
...
llvm-svn: 89362
2009-11-19 17:18:50 +00:00
Ken Dyck
aff01ceb95
Define WCHAR_MIN and WCHAR_MAX in terms of __WCHAR_WIDTH__ for consistency with
...
other limit macros.
llvm-svn: 89355
2009-11-19 15:53:08 +00:00
Ken Dyck
0138b9e1db
Define __WCHAR_WIDTH__ for use in stdint.h.
...
llvm-svn: 89353
2009-11-19 15:47:58 +00:00
Ken Dyck
f0b343f5b7
Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
...
widths. This corrects the values of these definitions for MSP430 and PIC16.
llvm-svn: 89350
2009-11-19 14:35:19 +00:00
Ken Dyck
a1f677c3d1
Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
...
stdint.h.
llvm-svn: 89348
2009-11-19 14:16:57 +00:00
Ken Dyck
279ed5189c
Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
...
arbitrary widths.
llvm-svn: 89347
2009-11-19 14:03:24 +00:00
Ken Dyck
575128656e
Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.
...
llvm-svn: 89346
2009-11-19 13:42:09 +00:00
Ken Dyck
9b25f781c5
Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
...
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.
llvm-svn: 89345
2009-11-19 13:18:59 +00:00
Ken Dyck
f982fc0b23
Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
...
replaced with __PTRDIFF_WIDTH__.
llvm-svn: 89344
2009-11-19 12:37:14 +00:00
Ken Dyck
8af6035ac9
Construct the macro body of PTRDIFF_MAX and PTRDIFF_MIN from __PTRDIFF_WIDTH__.
...
llvm-svn: 89343
2009-11-19 12:33:01 +00:00
Ken Dyck
056efe0fc7
Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.
...
llvm-svn: 89342
2009-11-19 12:21:52 +00:00
Ken Dyck
cc11129fda
Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
...
__INTPTR_WIDTH__ instead.
llvm-svn: 89340
2009-11-19 12:15:31 +00:00
Douglas Gregor
c8537c5156
Objective-C code completion within properties after "setter = " or
...
"getter = ", to provide suitable method names.
llvm-svn: 89334
2009-11-19 07:41:15 +00:00
Daniel Dunbar
51cd8f085f
Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.
...
llvm-svn: 89333
2009-11-19 07:37:51 +00:00
Daniel Dunbar
f57e69c78a
Add missing dependency for CMake.
...
llvm-svn: 89332
2009-11-19 07:37:40 +00:00
Daniel Dunbar
be6ef3874f
Sketch .td file and build system goop for OptTable based clang-cc options.
...
llvm-svn: 89330
2009-11-19 07:19:04 +00:00
Daniel Dunbar
52ed5feee5
Factor out OptTable::ParseArgs, for parsing an entire argument vector.
...
llvm-svn: 89327
2009-11-19 06:35:06 +00:00
Daniel Dunbar
da9e8e225d
clang-cc: Remove some more llvm: 🆑 :init arguments, by only setting values when
...
the argument is given.
Also, tweak Opt.Sysroot defaulting.
llvm-svn: 89318
2009-11-19 05:32:21 +00:00
Daniel Dunbar
d80277895d
Change -code-completion-debug-printer to -no-code-completion-debug-printer.
...
Also, tweak a few help strings and update CompilerInvocation serialization for prev change.
llvm-svn: 89317
2009-11-19 05:32:09 +00:00
Daniel Dunbar
484afa2d3b
Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm: 🆑 :init(true) arguments.
...
llvm-svn: 89315
2009-11-19 04:55:23 +00:00
Daniel Dunbar
da13faf982
Driver: ArgList doesn't depend on Options.h anymore.
...
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar
b323fd72ab
Driver: Take option ID for {Input,Unknown}Option, to drop dependency on actual options.
...
llvm-svn: 89312
2009-11-19 04:25:06 +00:00
Daniel Dunbar
8c00957008
Driver: Introduce OptSpecifier class for protecting access to an option id.
...
llvm-svn: 89310
2009-11-19 04:14:53 +00:00
Mike Stump
aa51ad6815
Refine vtable, rtti and rtti name instantiation so that they follow
...
the key function. All the code is wired up, but won't work yet, as I
had to turn off key function calculation as it doesn't work yet.
Also, we refine visibility of the vtable, rtti and rtti name to match
the class, as well as as arrange for all the symbols to be internal
for anonymous namespace entities.
llvm-svn: 89309
2009-11-19 04:04:36 +00:00
Daniel Dunbar
fffd18167d
Driver: Switch to using explicit {getLast,has}ArgNoClaim functions instead of taking a Claim argument.
...
- Most driver code always claims, and bool arguments don't play nice with the overloads.
llvm-svn: 89308
2009-11-19 04:00:53 +00:00
Mike Stump
beab381d2d
This doesn't work yet.
...
llvm-svn: 89307
2009-11-19 03:53:54 +00:00
Daniel Dunbar
b3b47b8dde
Driver: Resolve inconsistency in matching options against options which are
...
aliases -- just treat this case as an (unchecked) client error.
llvm-svn: 89306
2009-11-19 03:26:50 +00:00
Daniel Dunbar
0bfb21e4b0
Use Option::matches instead of direct ID comparison.
...
llvm-svn: 89305
2009-11-19 03:26:40 +00:00
Eli Friedman
06577388d7
The sub-statement of a case statement is not an unevaluated context!
...
llvm-svn: 89303
2009-11-19 03:14:00 +00:00
Douglas Gregor
1b605f7537
Improve code completion for Objective-C message sends, so that we
...
provide completion results before each keyword argument, e.g.,
[foo Method:arg WithArg1:arg1 WithArg2:arg2]
We now complete before "WithArg1" and before "WithArg2", in addition
to completing before "Method".
llvm-svn: 89290
2009-11-19 01:08:35 +00:00
Mike Stump
1a139f8fb5
Improve instantiation control for rtti data and allow key functions to
...
instantiate a class. WIP.
llvm-svn: 89289
2009-11-19 01:08:19 +00:00
Daniel Dunbar
46fffee081
Driver: Switch to using TableGen'erated Options.inc instead of Options.def file.
...
llvm-svn: 89288
2009-11-19 01:03:50 +00:00
Mike Stump
1960b20403
Refine linkage on thunks. WIP.
...
llvm-svn: 89287
2009-11-19 00:49:05 +00:00
Daniel Dunbar
aa767378ac
Driver: Split OptTable out into OptTable.{h,cpp}
...
llvm-svn: 89283
2009-11-19 00:15:11 +00:00
Douglas Gregor
e6078dab99
Improve the accuracy of code completion for the attributes of an @property declaration, so that we don't produce completions for attributes that would conflict with already-specified attributes
...
llvm-svn: 89281
2009-11-19 00:14:45 +00:00
Douglas Gregor
45f83ee87d
Improve code-completion results for the flags in an @property
...
declaration by providing patterns for "getter = <method>" and "setter
= <method>". As part of this, invented a new "pattern" result kind
that is merely a semantic string. The "pattern" result kind should
help with other kinds of code templates.
llvm-svn: 89277
2009-11-19 00:01:57 +00:00
Fariborz Jahanian
1e3609f6c4
Do not enter forward class 'Protocol' in decl context.
...
Will do it later. Fixes pr5552.
llvm-svn: 89269
2009-11-18 23:15:37 +00:00
Sebastian Redl
6a96bf7d6e
Do overload resolution for compound assignment even if only the RHS is overloadable. Compound assignment may be overloaded as a non-member, and anyway the overload resolution is necessary because it triggers implicit (used-defined) conversions. Fixes PR5512, but not really the deeper issues lurking. Those are standard defects.
...
llvm-svn: 89268
2009-11-18 23:10:33 +00:00
Douglas Gregor
36029f4118
Rename CodeCompleteObjCProperty to something more specific. No functionality change.
...
llvm-svn: 89267
2009-11-18 23:08:07 +00:00
Douglas Gregor
52e78bd992
Code completion after @dynamic
...
llvm-svn: 89265
2009-11-18 22:56:13 +00:00
John McCall
1f82f2462d
Overhaul previous-declaration and overload checking to work on lookup results
...
rather than NamedDecl*. This is a major step towards eliminating
OverloadedFunctionDecl.
llvm-svn: 89263
2009-11-18 22:49:29 +00:00
Douglas Gregor
5d6498827b
Code completion for Objective-C @synthesized.
...
llvm-svn: 89259
2009-11-18 22:32:06 +00:00
Fariborz Jahanian
fff3fb2b35
ignore parens surounding the type when diagnosing
...
pointer-to-member cast types used in expressions.
llvm-svn: 89255
2009-11-18 22:16:17 +00:00
Fariborz Jahanian
1bc0f9affc
This patch fixes a bug in misdiagnosing correct
...
use of pointer to data member.
llvm-svn: 89251
2009-11-18 21:54:48 +00:00
Sebastian Redl
d5b2453722
Track overriding methods when instantiating a template class. Fixes PR5550.
...
llvm-svn: 89248
2009-11-18 21:51:29 +00:00
Daniel Dunbar
7147de2c4e
Make MSVC happy.
...
llvm-svn: 89247
2009-11-18 21:42:57 +00:00
Sebastian Redl
931e0bd331
Pretend destructors are const and volatile. This allows calling them with const and/or volatile objects. Fixes PR5548.
...
llvm-svn: 89244
2009-11-18 20:55:52 +00:00
Sebastian Redl
4990a6347a
Don't generate superfluous and ambiguous built-in candidates for multi-level array subscript and arithmetic. Fixes PR5546.
...
llvm-svn: 89242
2009-11-18 20:39:26 +00:00
Ken Dyck
68fa5afada
Construct INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX from the exact-width limit
...
macros corresponding to __INTPTR_WIDTH__.
llvm-svn: 89239
2009-11-18 20:36:29 +00:00
Ken Dyck
2d4371d666
Define intptr_t and uintptr_t in terms of their equivalent exact-width types.
...
llvm-svn: 89237
2009-11-18 20:24:13 +00:00
Daniel Dunbar
26228a0d7a
Driver: Rework OptTable to have no dependency on the options it manages.
...
llvm-svn: 89234
2009-11-18 20:19:36 +00:00
Daniel Dunbar
a76762c9fb
Driver: Make local type name more distinct.
...
llvm-svn: 89233
2009-11-18 20:19:26 +00:00
Daniel Dunbar
f324fa7095
Driver: Store Option ID field as unsigned to drop dependency on the options
...
type.
llvm-svn: 89232
2009-11-18 20:19:19 +00:00
Ken Dyck
24cfcf15c3
Predefine __INTPTR_WIDTH__ for future use in stdint.h.
...
llvm-svn: 89231
2009-11-18 20:05:48 +00:00
Ken Dyck
fa01168a5c
Remove the __INTMAX_TYPE__ and __UINTMAX_TYPE__ built-in macros as they are no
...
longer used by stdint.h.
llvm-svn: 89230
2009-11-18 19:51:06 +00:00
Daniel Dunbar
f2ce9a217d
Use llvm::sys::Path to check isAbsolute, instead of hard coding. Also, remove random FIXME (?).
...
llvm-svn: 89229
2009-11-18 19:50:41 +00:00
Douglas Gregor
88e72a0bf6
Improve diagnostics and recovery when parsing @synthesized definitions
...
llvm-svn: 89227
2009-11-18 19:45:45 +00:00
Ken Dyck
ac11b7b625
Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-width
...
INTn_C and UINTn_C macros.
llvm-svn: 89226
2009-11-18 19:42:57 +00:00
Ken Dyck
63c8ef8256
Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros for
...
their corresponding exact-width type.
llvm-svn: 89224
2009-11-18 19:22:15 +00:00
Douglas Gregor
5d34fd3674
Implement code completion for Objective-C category names in @interface
...
and @implementation declarations.
llvm-svn: 89223
2009-11-18 19:08:43 +00:00
Mike Stump
ea950e249f
Reflow to fit 80-col.
...
llvm-svn: 89222
2009-11-18 18:57:56 +00:00
Ken Dyck
47181584f1
Define intmax_t and uintmax_t as the [u]intN_t type corresponding to
...
__INTMAX_WIDTH__.
llvm-svn: 89221
2009-11-18 18:57:04 +00:00
Fariborz Jahanian
41e803d8c7
Don't warn if objc method param types in declaration and
...
implementation mismatch in their qualifiers only.
This will match similar behavior in c/c++ and
fixes radar 7211653.
llvm-svn: 89220
2009-11-18 18:56:09 +00:00
Mike Stump
643818bdd8
Trim whitespace.
...
llvm-svn: 89219
2009-11-18 18:52:31 +00:00
Fariborz Jahanian
76197416ac
Improve on diagnosing type mismatches because of
...
lack of viable convesion functions.
llvm-svn: 89216
2009-11-18 18:26:29 +00:00
Sebastian Redl
55db1ec3ec
CastsAwayConstness shouldn't care if member pointers point into different classes. Fixes PR5545.
...
llvm-svn: 89215
2009-11-18 18:10:53 +00:00
Daniel Dunbar
21432d38a0
Driver: Switch Options.def to storing flags as a bitmask (instead of mangled
...
into a string).
llvm-svn: 89212
2009-11-18 17:42:34 +00:00
Douglas Gregor
49c22a74eb
Code completion for Objective-C class names after @interface,
...
@implementation, and in the declaration of the superclass of an
@interface.
llvm-svn: 89207
2009-11-18 16:26:39 +00:00
Edward O'Callaghan
c14422223b
Fix passing stdc++ correctly in the FreeBSD toolchain support, Credit to Roman Divacky.
...
llvm-svn: 89205
2009-11-18 14:51:31 +00:00
Ken Dyck
c0c98291e0
Predefine __INTMAX_WIDTH__ for the future parameterization of INTMAX macros in
...
stdint.h.
llvm-svn: 89203
2009-11-18 13:52:57 +00:00
Eli Friedman
acfb1dfa4d
Minor cleanup to member pointer handling.
...
llvm-svn: 89201
2009-11-18 09:41:26 +00:00
John McCall
5cebab12d5
Split LookupResult into its own header.
...
llvm-svn: 89199
2009-11-18 07:57:50 +00:00
Eli Friedman
928a567af1
Clean up EmitPointerToDataMemberBinaryExpr a bit.
...
llvm-svn: 89197
2009-11-18 05:01:17 +00:00
Douglas Gregor
5b4671c328
Code completion after @property, providing the names of forward-declared properties
...
llvm-svn: 89196
2009-11-18 04:49:41 +00:00
Douglas Gregor
baf6961ed4
Code completion for Objective-C properly lists
...
llvm-svn: 89194
2009-11-18 04:19:12 +00:00
Mike Stump
c0f632d6b2
Set up vtable visibility appropriately.
...
llvm-svn: 89193
2009-11-18 04:00:48 +00:00
Eli Friedman
030eee4e5c
Make CreateOverloadedUnaryOp build the correct node for postinc/dec operators.
...
llvm-svn: 89192
2009-11-18 03:58:17 +00:00
Mike Stump
83d5e00a96
Propagate hidden to the _ZTS symbols appropriately. WIP.
...
llvm-svn: 89191
2009-11-18 03:46:51 +00:00
Eli Friedman
794290ca29
Add an assertion to catch bad calls to EmitCallArgs.
...
llvm-svn: 89190
2009-11-18 03:42:04 +00:00
Eli Friedman
cfdd40c807
Simplify ActOnPostfixUnaryOp.
...
llvm-svn: 89188
2009-11-18 03:38:04 +00:00
Mike Stump
c5d2ed73ff
Be sure to set visibility for ZTI symbols for classes from the class.
...
llvm-svn: 89186
2009-11-18 03:21:29 +00:00
Mike Stump
f77aaa0089
Make _ZTI symbols hidden. This speeds up the dynamic linker.
...
llvm-svn: 89185
2009-11-18 02:53:28 +00:00
John McCall
e61f2ba7e4
Incremental progress on using declarations. Split UnresolvedUsingDecl into
...
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.
llvm-svn: 89184
2009-11-18 02:36:19 +00:00
Ted Kremenek
0469b7ea00
Add special clang_getCursor() support for @class . Handles <rdar://problem/7383421>.
...
llvm-svn: 89183
2009-11-18 02:02:52 +00:00
Douglas Gregor
9291bade4f
Code completion for member accesses that involve Objective-C properties and instance variables
...
llvm-svn: 89182
2009-11-18 01:29:26 +00:00
Douglas Gregor
63ce44aa6c
Eliminate some completely-redundant lookups
...
llvm-svn: 89181
2009-11-18 01:29:02 +00:00
Eli Friedman
132e70bfa4
PR5520: Make sure to check whether the base type is complete before looking for
...
operator->.
llvm-svn: 89180
2009-11-18 01:28:03 +00:00
Ted Kremenek
49939c2914
Add ObjCClassDecl::getSourceRange().
...
llvm-svn: 89179
2009-11-18 01:26:56 +00:00
Eli Friedman
24f55430c8
Missing piece of r89173.
...
llvm-svn: 89174
2009-11-18 00:57:03 +00:00
Eli Friedman
fe81e3fb3c
Refactor emitting call to delete operator into common function EmitDeleteCall.
...
llvm-svn: 89173
2009-11-18 00:50:08 +00:00
Mike Stump
5bbbb13765
Fix one last gotcha with typeid.
...
llvm-svn: 89172
2009-11-18 00:40:12 +00:00
Ted Kremenek
9b124e10a4
Add SourceLocations to ObjCClassDecl for the class identifiers referenced by @class .
...
llvm-svn: 89170
2009-11-18 00:28:11 +00:00
Douglas Gregor
a3329fa05e
Finish code completion for Objective-C message sends
...
llvm-svn: 89168
2009-11-18 00:06:18 +00:00
Mike Stump
4aaf79a942
Cleanup.
...
llvm-svn: 89166
2009-11-17 23:51:10 +00:00
Mike Stump
103a084cbe
Add rtti support for arrays, functiond without prototypes, vectors and
...
enums.
llvm-svn: 89165
2009-11-17 23:45:57 +00:00
Douglas Gregor
090dd181e5
Rename Objective-C message send completion functions to indicate that we're referring to message sends
...
llvm-svn: 89164
2009-11-17 23:31:36 +00:00
Douglas Gregor
bab2b3c70f
Refactor code-completion support for message sends, collecting the
...
code to find and add Objective-C methods (starting at an
ObjCContainerDecl) into a single, static function. Also, make sure
that we search into the implementations of classes and categories to
find even more methods.
llvm-svn: 89163
2009-11-17 23:22:23 +00:00
Ted Kremenek
a26da8503c
Pass source locations of identifiers referenced by @class through Action::ActOnForwardClassDeclaration().
...
llvm-svn: 89162
2009-11-17 23:12:20 +00:00
Mike Stump
96b96d5f2e
Add rtti info for function prototypes and refactor. This allows
...
pointer to member functions to work. WIP.
llvm-svn: 89161
2009-11-17 23:11:22 +00:00
Ted Kremenek
707ece6025
Do not register ObjCInterfaceDecls implicitly created by @class in the
...
current DeclContext. These "imaginary" declarations pose issues for
clients searching DeclContext for actual declarations. Instead,
register them for name lookup, and add the ObjCInterfaceDecl later to
the DeclContext when we hit an actual @interface declaration.
This also fixes a bug where the invariant that the Decls in a
DeclContext are sorted in order of their appearance is no longer
violated. What could happen is that an @class causes an
ObjCInterfaceDecl to get added first to the DeclContext, then the
ObjCClassDecl itself is added, and then later the SourceLocation of
the ObjCInterfaceDecl is updated with the correct location (which is
later in the file). This breaks an assumed invariant in
ResolveLocation.cpp (and possibly other clients).
llvm-svn: 89160
2009-11-17 22:58:30 +00:00
Fariborz Jahanian
95ace55701
This patch finalizes implementatin of weak_import
...
objective-c2 classes (radar 6815425).
llvm-svn: 89157
2009-11-17 22:42:00 +00:00
Mike Stump
6fdfea67ad
Add rtti support for pointer to data members.
...
llvm-svn: 89155
2009-11-17 22:33:00 +00:00
Fariborz Jahanian
3ad8dcfd55
More cases for weak_import objective-c2 classes.
...
(still radar 6815425).
llvm-svn: 89152
2009-11-17 22:02:21 +00:00
Mike Stump
db72c89eb1
Add rtti support for non-member pointers. WIP.
...
llvm-svn: 89148
2009-11-17 21:44:24 +00:00
Fariborz Jahanian
6726055375
More support for weak_import objective-c2 class.
...
(radar 6815425).
llvm-svn: 89146
2009-11-17 21:37:35 +00:00
Douglas Gregor
e8f0801265
Improve location information when adding conversion candidates
...
llvm-svn: 89141
2009-11-17 21:16:22 +00:00
David Chisnall
950a9518b1
Added block type introspection support.
...
As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.
llvm-svn: 89134
2009-11-17 19:33:30 +00:00
David Chisnall
cb1b7bf79d
Fixed bug where ivar offsets were being initialized as 0 with the fragile GNU ABI.
...
llvm-svn: 89133
2009-11-17 19:32:15 +00:00
Fariborz Jahanian
d3612399c5
Start support of weak_import objective-c classes.
...
(Radar 6815425).
llvm-svn: 89124
2009-11-17 19:08:08 +00:00
Ken Dyck
19ac306c2c
Replace (-INT8_C(128)), which uses an illegally out-of-range argument for
...
INT8_C, with (-INT8_C(127)-1) in the definition of INT8_MIN. Apply similar
changes to the definitions of INT16_MIN and INT24_MIN.
llvm-svn: 89120
2009-11-17 18:29:12 +00:00
Sebastian Redl
6eedcc1b86
Adjust format attribute index for implicit object arguments. Fixes PR5521.
...
llvm-svn: 89113
2009-11-17 18:02:24 +00:00
Douglas Gregor
8ce3321eb6
Implement code completion for Objective-C message sends to "super".
...
llvm-svn: 89112
2009-11-17 17:59:40 +00:00
Fariborz Jahanian
bc02a10ef3
Fixes a typo, reported by Doug.
...
llvm-svn: 89107
2009-11-17 17:15:16 +00:00
Anders Carlsson
6aa503900f
Fix PR5531.
...
llvm-svn: 89106
2009-11-17 17:11:23 +00:00
Douglas Gregor
d3c5d79837
Augment code-completion results to provide argument names and
...
placeholder arguments for Objective-C message sends.
llvm-svn: 89103
2009-11-17 16:44:22 +00:00
Douglas Gregor
ab6ccb5f88
StringRef'ify CodeCompletionString
...
llvm-svn: 89102
2009-11-17 16:43:05 +00:00
Ken Dyck
f78dc738a5
Use the INTn_C integer constant macros to generate limit constants with correct
...
suffixes. This corrects the suffixes for the limit constants of the 32-bit
types on MSP430 and PIC16, and the 64-bit types on PPC64, SystemZ, X86_64.
llvm-svn: 89101
2009-11-17 16:26:27 +00:00
Nuno Lopes
b9ac1dc910
recognize .hpp as c++ (needed for ./configure'ing boost)
...
llvm-svn: 89100
2009-11-17 15:36:35 +00:00
Nuno Lopes
11ab472ba1
add Fedora 11 include path. what a crap..
...
llvm-svn: 89098
2009-11-17 15:28:35 +00:00
Ken Dyck
e115235705
Remove unnecessary parens around the bodies of integer constant macros. C99
...
requires that their arguments be decimal, hex, octal constants---no signs
allowed---making the parens unnecessary.
llvm-svn: 89095
2009-11-17 13:54:02 +00:00
John McCall
afcee245cd
Temporarily unbreak the clang-on-llvm tests. :) Not going to fix unresolved
...
lookup all in a night.
llvm-svn: 89089
2009-11-17 10:36:41 +00:00
John McCall
1e9de059cc
Skip over shadow using decls during codegen.
...
llvm-svn: 89079
2009-11-17 09:33:40 +00:00
Daniel Dunbar
aca02c2730
Simplify CompilerInvocation::toArgs, now that LangOptions handling is more predictable.
...
llvm-svn: 89074
2009-11-17 09:15:57 +00:00
Daniel Dunbar
2208c57116
Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done
...
in the driver.
llvm-svn: 89073
2009-11-17 09:15:44 +00:00
Zhongxing Xu
23baa01af4
Add PreVisitReturn to Malloc checker. Now we can recognize returned memory
...
block.
llvm-svn: 89071
2009-11-17 08:58:18 +00:00
Daniel Dunbar
4930e3357b
Add -fblocks, -stack-protector, and -fobjc-nonfragile-abi defaulting to driver,
...
instead of using getDefaultLangOptions.
- Remove unused -fobjc-tight-layout while at it.
llvm-svn: 89065
2009-11-17 08:07:36 +00:00
Daniel Dunbar
f408303a3f
Add driver::types::isObjC predicate.
...
llvm-svn: 89064
2009-11-17 08:07:16 +00:00
Zhongxing Xu
4668c7ed1c
Add EvalEndPath interface to Checker. Now we can check memory leaked at the
...
end of the path. Need to unify interfaces.
llvm-svn: 89063
2009-11-17 07:54:15 +00:00
John McCall
f0f1cf087e
Store "sugared" decls in LookupResults (i.e. decl aliases like using declarations);
...
strip the sugar off in getFoundDecl() and getAsSingleDecl(), but leave it on for
clients like overload resolution who want to use the iterators.
Refactor a few pieces of overload resolution to strip off using declarations in
a single place. Don't do anything useful with the extra context knowledge yet.
llvm-svn: 89061
2009-11-17 07:50:12 +00:00
Zhongxing Xu
f19f251523
Clear the dest set.
...
llvm-svn: 89060
2009-11-17 07:19:51 +00:00
Daniel Dunbar
4656c53e12
Move -fnext-runtime defaulting to driver (and change clang-cc default to
...
-fnext-runtime), instead of using getDefaultLangOptions.
llvm-svn: 89058
2009-11-17 07:07:28 +00:00
Daniel Dunbar
0730e4f7e0
Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
...
llvm-svn: 89057
2009-11-17 07:06:20 +00:00
Douglas Gregor
5492edc852
Be more careful with anonymous namespaces, since Clang diagnoses the ambiguity here
...
llvm-svn: 89054
2009-11-17 06:52:37 +00:00
Daniel Dunbar
d609b7bbe9
Move char-is-signed defaulting to driver, instead of using
...
getDefaultLangOptions.
llvm-svn: 89053
2009-11-17 06:37:03 +00:00
Douglas Gregor
120f6a6675
Silence some warnings produced by Clang, and add a missing header
...
llvm-svn: 89051
2009-11-17 06:14:37 +00:00
Douglas Gregor
e0b2866147
Implement template instantiation for using directives, which is dead simple.
...
Also, make the "don't know how to instantiate a particular kind of
declaration" diagnostic nicer, so we don't have to trap Clang in a
debugger to figure out what went wrong.
llvm-svn: 89050
2009-11-17 06:07:40 +00:00
Daniel Dunbar
629f6bb95d
Add initial cut at CompilerInvocation::toArgs, which "serializes" the CompilerInvocation into a list of arguments which can be passed to clang-cc (eventually, clang -cc1).
...
- Unfortunately, this is currently a tedious and manual translation. Eventually it would be nice to automatically generate this code.
llvm-svn: 89049
2009-11-17 06:02:29 +00:00
John McCall
3f746828d7
Instead of hanging a using declaration's target decls directly off the using
...
decl, create shadow declarations and put them in scope like normal.
Work in progress.
llvm-svn: 89048
2009-11-17 05:59:44 +00:00
Daniel Dunbar
d6ea9028e7
Simplify PreprocessorOptions, it doesn't need abstracted field access.
...
llvm-svn: 89047
2009-11-17 05:52:41 +00:00
Douglas Gregor
3fad61786e
Require the object type of a member access expression ("." or "->") to
...
be complete.
llvm-svn: 89042
2009-11-17 05:17:33 +00:00
Daniel Dunbar
92881dbe73
Remove unused IsCXXAware and IgnoreSysRoots option from HeaderSearchOptions::Entry.
...
llvm-svn: 89035
2009-11-17 05:04:15 +00:00
Anders Carlsson
dee9a30204
Unify the way destructor epilogues are generated for synthesized and regular destructors. Also fix PR5529.
...
llvm-svn: 89034
2009-11-17 04:44:12 +00:00
Anders Carlsson
cfd3012756
More const is always good.
...
llvm-svn: 89033
2009-11-17 03:57:07 +00:00
Mike Stump
3afea1d8fe
Fix typo. Thanks Ted.
...
llvm-svn: 89031
2009-11-17 03:01:03 +00:00
Mike Stump
8f5e6770e7
Add typeinfo support for T* and const T* for all builtin types T.
...
llvm-svn: 89030
2009-11-17 02:57:13 +00:00
Mike Stump
3f75d552a3
Add typeid for the builtin types. WIP.
...
llvm-svn: 89028
2009-11-17 02:16:21 +00:00
John McCall
27b18f8144
Carry lookup configuration throughout lookup on the LookupResult. Give
...
LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics
(e.g. access control and deprecation) will be moved to automatically trigger
during lookup as part of this same mechanism.
This abstraction makes it much easier to encapsulate aliasing declarations
(e.g. using declarations) inside the lookup system: eventually, lookup will
just produce the aliases in the LookupResult, and the standard access methods
will naturally strip the aliases off.
llvm-svn: 89027
2009-11-17 02:14:36 +00:00
Eli Friedman
b0bc559b19
PR5526: Make sure to set the right cast kinds for the inserted implicit casts.
...
llvm-svn: 89023
2009-11-17 01:22:05 +00:00
Douglas Gregor
6c254bf522
When querying type qualifiers on QualType via one of the "non-local"
...
interfaces (which are used throughout the front end), combine the
qualifiers on the QualType instance with the qualifiers on the
canonical type to produce the set of qualifiers that, semantically,
apply to that type. This should design away a large category of
"qualifier-hidden-behind-a-typedef" buts like we saw in PR5383.
Performance-wise, this caused a regression of ~0.5% on Cocoa.h, but
it's totally worth it. We may actually be able to get a little more
performance back by using CanQualType more often.
llvm-svn: 89018
2009-11-17 00:55:50 +00:00
Mike Stump
c2c03349f3
Ensure we peer through () when handling typeid(*p).
...
llvm-svn: 89015
2009-11-17 00:45:21 +00:00
Mike Stump
4d0e9095e4
Since we always have 2 edges, we don't need to reserve 3 slot for the
...
PHI node.
llvm-svn: 89005
2009-11-17 00:10:05 +00:00
Mike Stump
e8cdcc9ab0
Minor CFG refinements for typeid and dynamic_cast.
...
llvm-svn: 89004
2009-11-17 00:08:50 +00:00
Eli Friedman
e85ef718d5
Fix up EmitMemberInitializer to handle many more cases.
...
llvm-svn: 88999
2009-11-16 23:53:01 +00:00
Eli Friedman
5e7d969526
Reorganize EmitMemberInitializer to put anonymous unions on the common codepath.
...
llvm-svn: 88995
2009-11-16 23:34:11 +00:00
Eli Friedman
22683fef03
Simplify the AST a bit by skipping creating member initializers for members
...
with a trivial constructor.
llvm-svn: 88990
2009-11-16 23:07:59 +00:00
Eli Friedman
c1daba3ec8
Make member initializers for union members work correctly.
...
llvm-svn: 88989
2009-11-16 22:58:01 +00:00
Mike Stump
6ca0e21de4
Implement dynamic_cast<void*>(E).
...
llvm-svn: 88988
2009-11-16 22:52:20 +00:00
Daniel Dunbar
24347f7cda
Store more information in HeaderSearchOptions so that its initialization is not
...
language dependent.
llvm-svn: 88981
2009-11-16 22:38:40 +00:00
Eli Friedman
c2ef215bda
Implement a few more cases for copy constructor synthesis.
...
llvm-svn: 88971
2009-11-16 21:47:41 +00:00
Douglas Gregor
1b8fe5b716
First part of changes to eliminate problems with cv-qualifiers and
...
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:
typedef const int CInt;
typedef CInt Self;
Self.isConstQualified() currently returns false!
Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:
- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.
This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of
Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()
expressions over to
Context.hasSameUnqualifiedType(T1, T2)
llvm-svn: 88969
2009-11-16 21:35:15 +00:00
Eli Friedman
c08bdea63d
Clean up scalar cast kind handling; make cast kind handling explicitly handle
...
more cases. No intended visible change.
llvm-svn: 88968
2009-11-16 21:33:53 +00:00
Mike Stump
bf44533846
Audit done, all the required casts are already done.
...
llvm-svn: 88966
2009-11-16 21:22:19 +00:00
Devang Patel
37b4b8b1da
revert r88963.
...
llvm-svn: 88965
2009-11-16 21:17:07 +00:00
Devang Patel
b71c28db22
Use TrackingVH to hold forward decl. This one is for RecordType.
...
llvm-svn: 88963
2009-11-16 21:06:35 +00:00
Eli Friedman
00dbf4c3c6
Parallel fix to r88951: use TrackingVH to hold forward decl.
...
llvm-svn: 88962
2009-11-16 21:04:30 +00:00
Sebastian Redl
658262fd26
Repair broken FindCompositePointerType. Correct early termination condition. Get CVR qualifiers from canonical types. Traverse collected qualifiers in reverse order on rebuilding the pointer, so that we don't swap inner and outer qualifiers. That last one fixes PR5509.
...
llvm-svn: 88960
2009-11-16 21:03:45 +00:00
Eli Friedman
b05d0824c6
Fix valgrind uninitialized error.
...
llvm-svn: 88952
2009-11-16 20:33:31 +00:00
Devang Patel
10909d5faf
Use TrackingVH to hold forward decl.
...
llvm-svn: 88951
2009-11-16 20:09:38 +00:00
Rafael Espindola
abab87936e
Use configure options for searching for libstdc++.
...
llvm-svn: 88945
2009-11-16 19:49:37 +00:00
Eli Friedman
f2f534d12a
Fix PR5488: special-case the overloaded arrow operator so that we don't try to
...
treat it as a unary operator.
llvm-svn: 88938
2009-11-16 19:13:03 +00:00
David Chisnall
b3b44ce433
Fixed two minor differences between clang and GCC-generated runtime structures for the GNU runtime.
...
llvm-svn: 88937
2009-11-16 19:05:54 +00:00
Fariborz Jahanian
9290ede494
Handle case of missing '@end' in implementation context
...
gracefully, on par with gcc, by: Issuing a warning,
doing final sematinc check of its definitions and generating
its meta-data.
llvm-svn: 88934
2009-11-16 18:57:01 +00:00
Anders Carlsson
0d82fa66a5
The ssp and sspreq function attributes should only be applied to function definitions, not declarations or calls.
...
llvm-svn: 88915
2009-11-16 16:56:03 +00:00
Ken Dyck
2dc8d5fa3e
Parameterize the constant-generating macros in stdint.h with new built-in
...
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).
llvm-svn: 88914
2009-11-16 16:36:33 +00:00
Duncan Sands
7876dad8e7
Pass a value for the isSigned parameter of CreateIntCast, rather than
...
passing the name (an exotic way of specifying that the result is signed!).
llvm-svn: 88909
2009-11-16 13:11:21 +00:00
Mike Stump
65511704f7
Implement most of dynamic_cast. WIP.
...
llvm-svn: 88901
2009-11-16 06:50:58 +00:00
Eli Friedman
49ddc5fb94
Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.
...
This doesn't have any visible effects at the moment because normally the
implicit cast code forces the type to the expected type.
llvm-svn: 88896
2009-11-16 05:55:46 +00:00
Eli Friedman
8c98dffd1f
Some minor cleanup for EmitCastLValue.
...
llvm-svn: 88894
2009-11-16 05:48:01 +00:00
Eli Friedman
03bf60a704
Set the cast kind for a few more code paths.
...
llvm-svn: 88893
2009-11-16 05:44:20 +00:00
Eli Friedman
e6ce354795
Fix a couple of cases where we weren't generating the right kind of call
...
for a call to a virtual function.
llvm-svn: 88891
2009-11-16 05:31:29 +00:00
Eli Friedman
011c4c341b
Implement two-argument form of delete operator.
...
llvm-svn: 88890
2009-11-16 05:16:40 +00:00
Zhongxing Xu
731f46264f
* Do the same thing to the basicstore as in r84163.
...
* Add a load type to GRExprEngine::EvalLoad().
* When retrieve from 'theValue' of OSAtomic funcitions, use the type of the
region instead of the argument expression as the load type.
* Then we can convert CastRetrievedSVal to a pure assertion. In the future
we can let all Retrieve() methods simply return SVal.
llvm-svn: 88888
2009-11-16 04:49:44 +00:00
Eli Friedman
141fbf3f36
Add constant evaluation for comma operator with floating-point operand. Fixes
...
PR5449.
llvm-svn: 88885
2009-11-16 04:25:37 +00:00
Zhongxing Xu
223f5119e1
Remove an unused parameter.
...
llvm-svn: 88882
2009-11-16 02:52:18 +00:00
Chandler Carruth
2496fe14ec
Fix a missing include from r88876.
...
llvm-svn: 88879
2009-11-15 23:10:57 +00:00
Anders Carlsson
d787204e6d
When generating the deleting ctor, emit a call to delete.
...
llvm-svn: 88878
2009-11-15 23:03:25 +00:00
Anders Carlsson
2a50e95da4
Make sure that virtual destructors have delete operators.
...
llvm-svn: 88877
2009-11-15 22:49:34 +00:00
Anders Carlsson
1b69be2a8f
Add DeclarationName::dump().
...
llvm-svn: 88876
2009-11-15 22:30:43 +00:00
Mike Stump
4ac39ef6f9
Peer through refernces for typeid. WIP.
...
llvm-svn: 88871
2009-11-15 20:30:39 +00:00
Anders Carlsson
7ade203c6c
Deallocation functions must also be static.
...
llvm-svn: 88859
2009-11-15 19:08:46 +00:00
Anders Carlsson
623e9798df
allocation functions are always static.
...
llvm-svn: 88858
2009-11-15 18:59:32 +00:00
Anders Carlsson
e1d34ba0e4
Factor finding a deallocation function for a record type out into a separate function.
...
llvm-svn: 88857
2009-11-15 18:45:20 +00:00
Mike Stump
1bf924b121
Finish off zero check for typeid(*p) so that it will do a __cxa_bad_typeid.
...
llvm-svn: 88852
2009-11-15 16:52:53 +00:00
Anders Carlsson
2c9e274e57
If we find a deallocation function in the class scope, but it is a placement function we should not look for a deallocation function in the global scope.
...
llvm-svn: 88851
2009-11-15 16:43:15 +00:00
Edward O'Callaghan
e9a58b10ad
Add MIPS support to Triple for Linux and the PSP. Credit to Bruno Cardoso Lopes.
...
llvm-svn: 88850
2009-11-15 10:22:07 +00:00
Douglas Gregor
8f3952cda9
When performing a static downcast as part of a static_cast, make sure
...
that we're dealing with canonical types like the documentation say
(yay, CanQualType). Alas, this is another instance where using
getQualifiers() on a non-canonical QualType got us in trouble.
Good news: with this fix, Clang can now parse all of its own headers!
llvm-svn: 88848
2009-11-15 09:20:52 +00:00
Douglas Gregor
598caeee37
Don't gratuitously mark the default constructors of base or member initializers as used
...
llvm-svn: 88847
2009-11-15 08:51:10 +00:00
Douglas Gregor
54fdb417fe
When adding the underlying declaration of a decl to a lookup-results
...
set, expand overloaded function declarations. Long-term, this should
actually be done by the name-lookup code rather than here, but this
part of the code (involving using declarations) is getting a makeover
now and the test-case is useful.
llvm-svn: 88846
2009-11-15 08:11:13 +00:00
Mike Stump
c9b231c8d1
Implement typeid for class types.
...
llvm-svn: 88843
2009-11-15 08:09:41 +00:00
Douglas Gregor
c473cbb3b2
When looking for operator() to type-check a call to an object of class
...
type, use full qualified name lookup rather than the poking the
declaration context directly. This makes sure that we see operator()'s
in superclasses. Also, move the complete-type check before this name
lookup.
llvm-svn: 88842
2009-11-15 07:48:03 +00:00
Douglas Gregor
a7e3ea3f64
If any errors have occurred by the time we hit the end of a function body, clear out any remaining temporaries so they aren't seen later.
...
llvm-svn: 88834
2009-11-15 07:07:58 +00:00