Commit Graph

18056 Commits

Author SHA1 Message Date
Daniel Dunbar baa74770c9 Change Clang-Code-Compile tests to only -emit-llvm instead of running
codegen/as.

llvm-svn: 89634
2009-11-23 00:07:14 +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
Daniel Dunbar 7b8fcadf68 CMake: Add support for running tests with valgrind.
llvm-svn: 89625
2009-11-22 21:55:22 +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 1299f36af1 Update a test to FileCheck.
llvm-svn: 89610
2009-11-22 18:56:40 +00:00
Ken Dyck 65da2db736 Use intptr_t from stdint.h (in freestanding mode) instead of redefining it here
with __INTPTR_TYPE__.

llvm-svn: 89609
2009-11-22 18:29:06 +00:00
David Chisnall 27033c9171 Test case for bug fixed in r89457.
llvm-svn: 89605
2009-11-22 17:42:02 +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
Edward O'Callaghan 0825f09306 Fix for PR5233.
llvm-svn: 89603
2009-11-22 16:21:47 +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
Alexis Hunt 12048d868b Use intptr_t rather than long so that this test will not fail on LLP64 systems,
where long is only 32-bits and so a reinterpret_cast would be ill-formed.

llvm-svn: 89583
2009-11-22 07:05:50 +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
Alexis Hunt 9631fcc998 Fix 80-cols violation.
llvm-svn: 89558
2009-11-21 09:45:54 +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
Ted Kremenek 775d9c149d Add RegionStore test case that shows that floating point values are also implicitly tracked for undefined values. (test case for <rdar://problem/6811085>).
llvm-svn: 89538
2009-11-21 02:52:12 +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
Ted Kremenek f3febe4bdc Add another test case to show the precision of RegionStore over
BasicStore.  In this example, BasicStore would lose information about
the pointer in path after '*path++', causing the analyzer to falsely
flag a null dereference.  This addresses <rdar://problem/7191542>.

llvm-svn: 89533
2009-11-21 02:17:47 +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