Commit Graph

14213 Commits

Author SHA1 Message Date
Ted Kremenek 24c8513022 BasicStoreManager: Use SymbolManager::canSymbolicate() to determine if a variable can be symbolicated.
llvm-svn: 74750
2009-07-03 00:36:16 +00:00
Ted Kremenek 0b0f206efa Fix a horrible CFG bug reported in <rdar://problem/7027684>. The wrong successor
block would get hooked up in some cases when processing empty compound
statements.

llvm-svn: 74743
2009-07-03 00:10:50 +00:00
Daniel Dunbar 43d74cd948 Revert prev commit, we have much bigger problems because 2.3 is missing
the subprocess module.

llvm-svn: 74738
2009-07-02 23:58:07 +00:00
Daniel Dunbar 22da185ed8 Avoid @staticmethod to allow use with Python 2.3.
llvm-svn: 74737
2009-07-02 23:56:37 +00:00
Ted Kremenek 06cc0e31b2 Replace guarded calls in RegionStoreManager to
ValueManager::getRegionValueSymbolVal() with unguarded calls to
ValueManager::getRegionValueSymbolValOrUnknown(). This changes centralizes the
decision of what values to symbolicate in SymbolManager rather than having it
scatter in RegionStoreManager.

llvm-svn: 74730
2009-07-02 22:16:42 +00:00
Ted Kremenek 725b4a3a51 Enhance RegionStore to lazily symbolicate fields and array elements for
structures passed-by-value as function arguments.

llvm-svn: 74729
2009-07-02 22:02:15 +00:00
Ted Kremenek 71bf4264bf Fix RUN line so this test doesn't hang.
llvm-svn: 74719
2009-07-02 18:44:31 +00:00
Fariborz Jahanian 9fa077c626 Patch to allocate list of bases in CXXRecordDecl
using ASTContxt allocation.

llvm-svn: 74717
2009-07-02 18:26:15 +00:00
Ted Kremenek df67d426d9 StoreManagers: Use 'hasGlobalsStorage()' and 'hasParametersStorage()' instead of
directly consulting if a VarDecl is an implicit or actual parameter, a global,
etc.

llvm-svn: 74716
2009-07-02 18:25:09 +00:00
Ted Kremenek 7e4a9a02c3 Add a separate MemSpaceRegion for function/method arguments passed on the stack.
This will simplify the logic of StoreManagers that want to specially reason
about the values of parameters.

llvm-svn: 74715
2009-07-02 18:14:59 +00:00
Ted Kremenek df15d29f17 Remove commented methods. Add MemRegion::printStdErr().
llvm-svn: 74709
2009-07-02 17:24:10 +00:00
Douglas Gregor c6d5edd2ed Add support for retrieving the Doxygen comment associated with a given
declaration in the AST. 

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment, 
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile). 

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
  - We don't actually attempt to parse the comment blocks themselves,
  beyond identifying them as Doxygen comment blocks to associate them
  with a declaration.
  - We won't find comment blocks that aren't adjacent to the
  declaration, because we start our search based on the location of
  the declaration.
  - We don't go through the necessary hops to find, for example,
  whether some redeclaration of a declaration has comments when our
  current declaration does not. Similarly, we don't attempt to
  associate a \param Foo marker in a function body comment with the
  parameter named Foo (although that is certainly possible).
  - Verification of my "no performance impact" claims is still "to be
  done".

llvm-svn: 74704
2009-07-02 17:08:52 +00:00
Douglas Gregor 1554825e20 Look through vector types when determining the base type of a type for declarator printing. Bug found via the PCH tester
llvm-svn: 74672
2009-07-01 23:58:14 +00:00
Fariborz Jahanian 5c6af0a998 Use Destroy for member initializer list clean up.
Per Doug's comments. Doug please review.

llvm-svn: 74666
2009-07-01 23:35:25 +00:00
Ted Kremenek 873db25879 Minor code cleanup: pull variables into scope of 'if' statement, limiting their
actual lifetime to their logical lifetime.

llvm-svn: 74665
2009-07-01 23:30:34 +00:00
Douglas Gregor e4d00dd7f6 Fix PR 4489, a PCH crash during de-serialization.
llvm-svn: 74664
2009-07-01 23:29:14 +00:00
Ted Kremenek a8a295f2d9 Temporarily disable RegionStore for stack-addr-ps.c, as a new test case reveals
a case where RegionStore doesn't create symbolic values for the fields of
structs that are passed-by-value.

llvm-svn: 74662
2009-07-01 23:24:11 +00:00
Ted Kremenek 55e07efeed Add a FIXME to RegionStore, do some minor code cleanup, and get RegionStore to
pass misc-ps.m. Currently RegionStore/BasicStore don't do any special reasoning
about clang-style vectors, so we should return UnknownVal (in all cases) when
accessing their values via an array.

llvm-svn: 74660
2009-07-01 23:19:52 +00:00
Owen Anderson ecaeaa81b1 Update for changes in LLVM. Hopefully this is the last one for a while.
llvm-svn: 74657
2009-07-01 23:14:14 +00:00
Douglas Gregor ff6cbdf806 Keep track of more information within the template instantiation stack, e.g.,
by distinguishing between substitution that occurs for template
argument deduction vs. explicitly-specifiad template arguments. This
is used both to improve diagnostics and to make sure we only provide
SFINAE in those cases where SFINAE should apply.

In addition, deal with the sticky issue where SFINAE only considers
substitution of template arguments into the *type* of a function
template; we need to issue hard errors beyond this point, as
test/SemaTemplate/operator-template.cpp illustrates.

llvm-svn: 74651
2009-07-01 22:01:06 +00:00
Owen Anderson 03200753ee Hold the LLVMContext by reference instead of by pointer.
llvm-svn: 74642
2009-07-01 21:23:16 +00:00
Fariborz Jahanian 52337414b7 Updated CXXConstructorDecl AST node for ctor-initilaizer list.
No change in functionality.

llvm-svn: 74639
2009-07-01 21:05:43 +00:00
Daniel Dunbar df4a58edd8 Fix thinko in r74506, test condition for floats was inverted.
- Refactored slightly to make control flow more obvious.

llvm-svn: 74637
2009-07-01 20:37:45 +00:00
Daniel Dunbar 82ef1abf43 Driver: Mark some Compilation members const.
llvm-svn: 74636
2009-07-01 20:30:52 +00:00
Daniel Dunbar 38bfda6ab5 Driver: Move Compilation::Execute to Driver::ExecuteCompilation.
- The Compilation is just a helper class, it shouldn't have that amount of
   logic in it.

 - No functionality change.

llvm-svn: 74634
2009-07-01 20:03:04 +00:00
Fariborz Jahanian c1fc3ec878 Patch to implement template types in ctor-initializer list.
Also has fix for bugzilla-4469.

llvm-svn: 74631
2009-07-01 19:21:19 +00:00
Daniel Dunbar aa246cafaa Driver: Improve diagnostics for failed commands.
- Not all tools give good error messages, and sometimes the tool can fail w/o
   any error (for example, when signalled).

 - We suppress this message when the failing command is the compiler and it
   failed normally (exit code == 1), under the assumption that it gave a good
   diagnostic.

For example, for a linker failure we now get:
--
ddunbar@lordcrumb:tmp$ clang a.c b.c
ld: duplicate symbol _x in /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-bXYITq.o and /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-6uK4jD.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--

For a compiler crash we get:
--
ddunbar@lordcrumb:tmp$ clang t.i
Assertion failed: (CGT.getTargetData().getTypeAllocSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 573.
0   clang-cc          0x0000000100f1f1f1 PrintStackTrace(void*) + 38
... stack trace and virtual stack trace follow ...
clang: error: compiler command failed due to signal 6 (use -v to see invocation)
--

But for a regular compilation failure we get the usual:
--
ddunbar@lordcrumb:tmp$ clang c.c
c.c:1:6: error: invalid token after top level declarator
int x
     ^
1 diagnostic generated.
--

 - No test case, not amenable to non-executable testing. :/

 - <rdar://problem/6945613>

llvm-svn: 74629
2009-07-01 19:14:39 +00:00
Daniel Dunbar 126b3a103e Driver: Add Source argument for Commands to hold the Action which caused a
Command to be generated, to support more advanced diagnostics.
 - No functionality change.

llvm-svn: 74627
2009-07-01 19:02:28 +00:00
Sebastian Redl df718773f7 Add header search path for Gentoo stable, x86_64 version.
llvm-svn: 74626
2009-07-01 18:59:43 +00:00
Owen Anderson d9dd77ff6c Update for LLVMContext+Module change.
llvm-svn: 74615
2009-07-01 17:00:06 +00:00
Douglas Gregor c05d2a11d7 Two fixes to make Clang build on Visual C++ (again), from Alisdair Meredith.
llvm-svn: 74606
2009-07-01 15:12:53 +00:00
Steve Naroff 05efa97d38 Rework Sema::CheckConditionalOperands(). No functionality change.
This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups).

The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause).

Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming).
llvm-svn: 74604
2009-07-01 14:36:47 +00:00
Nate Begeman ef1a7fa89d Implement Eli's feedback for vecto constant expressions;
For ExtVectorType, initializer is splatted to all elements.
For VectorType, initializer is bitcast to vector type.

Verified that for VectorType, output is identical to gcc.

llvm-svn: 74600
2009-07-01 07:50:47 +00:00
Chris Lattner 3dd1b4b6f2 use new and simplified LLVM APIs. Patch by Jay Foad!
llvm-svn: 74585
2009-07-01 04:13:52 +00:00
Eli Friedman 2857ccbaa7 Fix for PR4192: fix the definition of int64_t on x86_64 Linux.
Note that I'm guessing that *BSD and Solaris do the same thing as Linux 
here, but it's quite possible I'm wrong; if the following testcase 
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:

#include <stdint.h>

int64_t x; long x;

llvm-svn: 74583
2009-07-01 03:36:11 +00:00
Zhongxing Xu b4ce4fc4ee add fixme.
llvm-svn: 74581
2009-07-01 02:12:57 +00:00
Douglas Gregor e3f1f350ff Cope with explicitly-specified function template arguments when there
are fewer template arguments than there are template parameters for
that function.

llvm-svn: 74578
2009-07-01 00:28:38 +00:00
Douglas Gregor 89026b5018 When explicit template arguments are provided for a function call,
substitute those template arguments into the function parameter types
prior to template argument deduction. There's still a bit of work to
do to make this work properly when only some of the template arguments
are specified.

llvm-svn: 74576
2009-06-30 23:57:56 +00:00
Fariborz Jahanian 302bb6661f Patch to support optional nested-name-specifier in in ctor-initializer
list.

llvm-svn: 74571
2009-06-30 23:26:25 +00:00
Douglas Gregor a727cb98a4 Preliminary parsing and ASTs for template-ids that refer to function
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.

llvm-svn: 74563
2009-06-30 22:34:41 +00:00
Ted Kremenek aff66a8a19 Update old CastRegion logic to not assume that ElementRegion's super region is a
TypedRegion. While we plan on removing this code at some point, it serves as a
good reference implementation for use with BasicStore until we are sure the new
CastRegion logic (in RegionStore.cpp) is correct.

llvm-svn: 74559
2009-06-30 22:31:23 +00:00
Ted Kremenek 58d8190417 Fix: <rdar://problem/7021553> clang -fsyntax-only crashes (in ParseDeclarationSpecifiers ... from ParseObjCTypeName)
Another case where we should use SmallVector::data() instead of taking the
address of element 0 of a SmallVector when the SmallVector has no elements.

llvm-svn: 74556
2009-06-30 22:19:00 +00:00
Fariborz Jahanian cae5482f6c Diagnose multiple initialization of anonymous union
fields in the ctor-initializer list.

llvm-svn: 74554
2009-06-30 21:52:59 +00:00
Ted Kremenek 8fd187986d Combine two conditional branches into one. No functionality change.
llvm-svn: 74552
2009-06-30 20:24:11 +00:00
Fariborz Jahanian 7baa71e2dd More diagnostics related to initialization of direct bases
in ctor-initializer list.

llvm-svn: 74541
2009-06-30 17:34:52 +00:00
Douglas Gregor dda7ced32e When recursively instantiating function templates, keep track of the
instantiation stack so that we provide a full instantiation
backtrace. Previously, we performed all of the instantiations implied
by the recursion, but each looked like a "top-level" instantiation.

The included test case tests the previous fix for the instantiation of
DeclRefExprs. Note that the "instantiated from" diagnostics still
don't tell us which template arguments we're instantiating with.

llvm-svn: 74540
2009-06-30 17:20:14 +00:00
Torok Edwin b2b37c62d0 Reapply r74532, and inherit from OSTargetInfo instead of from Target.
'make test' passes now.

llvm-svn: 74539
2009-06-30 17:10:35 +00:00
Torok Edwin 4e0541649b Revert 74532 till I figure out why it breaks a bunch of tests.
llvm-svn: 74536
2009-06-30 17:00:25 +00:00
Douglas Gregor 18d6945650 Update C++ section data and directory structure to reflect N2914
llvm-svn: 74535
2009-06-30 16:45:27 +00:00
Fariborz Jahanian 5f12b5386c Compute ending of iterator in for-loop once.
llvm-svn: 74533
2009-06-30 16:36:53 +00:00
Torok Edwin 45d60b5bc3 Use templates instead of creating a new class for each OS/Target combination.
This unifies all the targets supported by an OS into a template.
It also cleans up the differences between the darwin targets.
Also __LP64__ wasn't needed for *BSD, since x86-64 target defines it anyway.

llvm-svn: 74532
2009-06-30 16:30:17 +00:00
Douglas Gregor 3256d04d22 Refactor ActOnDeclarationNameExpr into a "parsing action" part and a
"semantic analysis" part. Use the "semantic analysis" part when
performing template instantiation on a DeclRefExpr, rather than an ad
hoc list of rules to construct DeclRefExprs from the instantiation.

A test case for this change will come in with a large commit, which
illustrates what I was actually trying to work on.

llvm-svn: 74528
2009-06-30 15:47:41 +00:00
Zhongxing Xu 703db197e3 Instead of r74522, use another approach to fix xfail_regionstore_wine_crash.c.
Mark the super region of the binding of block level expr in the Environment
as live.

llvm-svn: 74525
2009-06-30 13:00:53 +00:00
Zhongxing Xu e205d43c75 When retrieving element region, if its super region has binding, return
unknown for it.

Mark the super region of a live region as live, if the live region is pointed
to by a live pointer variable.

These fixes xfail_regionstore_wine_crash.c.

llvm-svn: 74524
2009-06-30 12:32:59 +00:00
Zhongxing Xu d29e74e658 Block level expr should be visited. Otherwise variables in init expr of
DeclStmt would be dead before the DeclStmt.
For example:
int x = 0;
int y = x;
'x' would be dead before 'int y = x'.

llvm-svn: 74522
2009-06-30 12:11:58 +00:00
Zhongxing Xu d0a246fd08 add utility method.
llvm-svn: 74521
2009-06-30 11:52:40 +00:00
Zhongxing Xu 41bbd51c33 add utility methods.
llvm-svn: 74520
2009-06-30 11:50:39 +00:00
Zhongxing Xu 5df79c6642 remove dead code.
llvm-svn: 74517
2009-06-30 07:50:26 +00:00
Zhongxing Xu 6377a98774 We do not require the super region of element region be typed. So do not
create TypedViewRegion for it.

llvm-svn: 74516
2009-06-30 07:41:27 +00:00
Chris Lattner d466ea1b08 Implement PR4175, catching some questionable comparisons. Patch by
David Majnemer!

llvm-svn: 74513
2009-06-30 06:24:05 +00:00
Argyrios Kyrtzidis cfbfe78e9e De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

llvm-svn: 74506
2009-06-30 02:36:12 +00:00
Argyrios Kyrtzidis e3d025995c Introduce DeclContext::getParentASTContext().
It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.

llvm-svn: 74505
2009-06-30 02:35:38 +00:00
Argyrios Kyrtzidis ddcd132a5b Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
Timings showed no significant difference before and after the commit.

llvm-svn: 74504
2009-06-30 02:35:26 +00:00
Argyrios Kyrtzidis 8a803cc351 Remove the ASTContext parameter from the printing related methods of Decl.
llvm-svn: 74503
2009-06-30 02:35:04 +00:00
Argyrios Kyrtzidis 4e1a72b37b Decl::getTranslationUnitDecl() should return itself when the Decl is a TranslationUnitDecl.
llvm-svn: 74502
2009-06-30 02:34:53 +00:00
Argyrios Kyrtzidis b4b64ca752 Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

llvm-svn: 74501
2009-06-30 02:34:44 +00:00
Chris Lattner c61089a6c2 Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.
This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control.  There are many fixme's, but I think things are slightly
better than they were before.

One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.

llvm-svn: 74493
2009-06-30 01:26:17 +00:00
Fariborz Jahanian e853bfa970 Take care of Chris's comments.
llvm-svn: 74486
2009-06-30 00:17:27 +00:00
Anders Carlsson 124f34c150 Make an error message more clear.
llvm-svn: 74481
2009-06-30 00:06:57 +00:00
Fariborz Jahanian 651185bf47 A more detailed diagnosis of ill-formed ctor-initializer
list.

llvm-svn: 74480
2009-06-30 00:02:17 +00:00
Daniel Dunbar 86e35b3aba Use true/false instead of 1/0.
llvm-svn: 74479
2009-06-29 23:58:47 +00:00
Anders Carlsson 074a18a8fd Improvements to decltype. We now don't crash anymore when the expr is an overloaded function decl.
llvm-svn: 74472
2009-06-29 22:58:55 +00:00
Daniel Dunbar 302ab13b1a Don't define __KPRINTF_ATTRIBUTE__ unconditionally on OpenBSD.
llvm-svn: 74467
2009-06-29 22:45:37 +00:00
Douglas Gregor e8925dbc1d Improve code generation for function template specializations:
- Track implicit instantiations vs. the not-yet-supported explicit
  specializations
  - Give implicit instantiations of function templates (and member
  functions of class templates) linkonce_odr linkage.
  - Improve name mangling for function template specializations,
  including the template arguments of the instantiation and the return
  type of the function.

Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.

llvm-svn: 74466
2009-06-29 22:39:32 +00:00
Fariborz Jahanian 2be8bf44cd Diagnose multiple initialzation of data-member/base
in the ctor-initializer list. More to come.

llvm-svn: 74465
2009-06-29 22:33:26 +00:00
Anders Carlsson d7a1bc4466 Remove some dead code
llvm-svn: 74460
2009-06-29 21:39:57 +00:00
Douglas Gregor 8f5d4423ca Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.

llvm-svn: 74454
2009-06-29 20:59:39 +00:00
Daniel Dunbar 10de9e6602 OpenBSD support.
- Patch by Jonathan Gray!

llvm-svn: 74453
2009-06-29 20:52:51 +00:00
Argyrios Kyrtzidis 743e7db794 -Keep a reference to the ASTContext inside the TranslationUnitDecl.
-Introduce Decl::getASTContext() which returns the reference from the TranslationUnitDecl that it is contained in.

The general idea is that Decls can point to their own ASTContext so that it is no longer required to "manually" keep track and make sure that you pass the correct ASTContext to Decls' methods, e.g. methods like Decl::getAttrs should eventually not require a ASTContext parameter.

llvm-svn: 74434
2009-06-29 17:38:40 +00:00
Argyrios Kyrtzidis 3cfb28a68d Remove redundant leftover code.
llvm-svn: 74433
2009-06-29 17:38:09 +00:00
Chris Lattner e4edb8e818 Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.

llvm-svn: 74432
2009-06-29 17:34:55 +00:00
Douglas Gregor 70d83e27a4 Move FunctionDecl::TemplateSpecializationInfo out into its own class,
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.

llvm-svn: 74431
2009-06-29 17:30:29 +00:00
Steve Naroff 8d9cc9ebc1 Remove ASTContext::getObjCQualifiedIdType().
Convert clients to use ASTContext::getObjCObjectPointerType().

llvm-svn: 74424
2009-06-29 16:22:52 +00:00
Zhongxing Xu 4744d560b8 Invalidate the alloca region by setting its default value to conjured symbol.
llvm-svn: 74419
2009-06-29 06:43:40 +00:00
Zhongxing Xu 25d710ee50 The default answer for isBoundable() should be false.
llvm-svn: 74418
2009-06-29 05:44:14 +00:00
Bill Wendling 1835107ed0 Make the StackProtector bitfield use enums instead of obscure numbers.
llvm-svn: 74414
2009-06-28 23:01:01 +00:00
Anders Carlsson b012ca92ac Move the check for vprintf* functions inside of SemaCheckStringLiteral. Fixes PR4470.
llvm-svn: 74413
2009-06-28 19:55:58 +00:00
Chris Lattner 877a48e67a make these tests pass with the stack canary stuff even on targets where they default to on.
llvm-svn: 74412
2009-06-28 19:49:49 +00:00
Nate Begeman 886448d694 Fix incorrect AST's being produced, noticed by Eli.
The issue this was working around is no longer present in TOT clang.

llvm-svn: 74411
2009-06-28 19:12:57 +00:00
Zhongxing Xu 55e070031f Now this test case passes.
llvm-svn: 74410
2009-06-28 14:25:10 +00:00
Zhongxing Xu 0628f539a8 Adjust retrieve handler priority. If a field is of array type, it should be
handled by RetrieveArray().

llvm-svn: 74409
2009-06-28 14:16:39 +00:00
Zhongxing Xu 6f610707cf Invalidate a field of struct type by setting its default value to conjured
symbol.

llvm-svn: 74408
2009-06-28 13:59:24 +00:00
Zhongxing Xu d260db1238 Do not crash on binding concrete integer location.
llvm-svn: 74407
2009-06-28 10:16:11 +00:00
Zhongxing Xu f7a6de3a12 Simplify some code. As in region store, we always expect the location is a
memregion.

llvm-svn: 74406
2009-06-28 09:26:15 +00:00
Bill Wendling d63bbadbef Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.

llvm-svn: 74405
2009-06-28 07:36:13 +00:00
Nate Begeman bd956c4290 OpenCL 1.0 support:
Handle rules for ExtVector + ExtVector and ExtVector + Scalar operations. 
Fix problem Eli noticed where we were allowing pointer types to be splatted to
vector elements.

llvm-svn: 74404
2009-06-28 02:36:38 +00:00
Nate Begeman c8961a424d Implement feedback from Eli re: the purpose of lax vector conversions
llvm-svn: 74397
2009-06-27 22:05:55 +00:00
Douglas Gregor 15448f8d23 Improve support for overloaded operator templates.
llvm-svn: 74390
2009-06-27 21:05:07 +00:00
Eli Friedman 5e774b1333 Fix the parser error hanlding for __builtin_offsetof to actually print
out an error for a malformed __builtin_offsetof.

llvm-svn: 74388
2009-06-27 20:38:33 +00:00
Douglas Gregor 0799d916e1 Add a Last Updated field to the C++ status page
llvm-svn: 74387
2009-06-27 19:33:58 +00:00
Fariborz Jahanian 3fe6b61b23 Renamed MarcDestructorReferenced -> MarkDestructorReferenced
llvm-svn: 74386
2009-06-27 15:05:11 +00:00
Eli Friedman d95e1cda9e Fix screwup with my previous patch which broke tests. (The patch is
making sure we return true when annotating a function template with 
explicit template arguments, but not when we don't annotate anything.)

llvm-svn: 74383
2009-06-27 08:17:02 +00:00
Eli Friedman 9fe1bb40ae Fix a crash with constructs like x<false>() in C++. No testcase because
it doesn't actually work yet; we just error out a bit more gracefully.

llvm-svn: 74381
2009-06-27 06:24:06 +00:00
Eli Friedman 173e0b7a96 Fix a bogus error overloading an operator where the only class
parameter has a dependent type.

llvm-svn: 74380
2009-06-27 05:59:59 +00:00
Anders Carlsson f0a7f3b089 Implement support for the format_arg attribute. Fixes PR4442.
llvm-svn: 74369
2009-06-27 04:05:33 +00:00
Anders Carlsson 74d7f0dd65 Make it possible for using decls to point to operators. Fixes PR4441.
llvm-svn: 74362
2009-06-27 00:27:47 +00:00
Ted Kremenek 8e5f6951eb Remove the last 'GetXXX' methods from GRStateManager.
llvm-svn: 74361
2009-06-27 00:24:54 +00:00
Douglas Gregor 1e880602ad Make a note of improvements to function templates
llvm-svn: 74360
2009-06-27 00:08:54 +00:00
Fariborz Jahanian 24a175b37c Patch to mark destructors when they are used.
llvm-svn: 74359
2009-06-26 23:49:16 +00:00
Anders Carlsson bae2737202 Fix test.
llvm-svn: 74358
2009-06-26 23:44:14 +00:00
Douglas Gregor fc516c93c1 Set the rest of the flags we need to perform template argument
deduction using a base class of the argument type. No actual
functionality change; this is just a hook.

llvm-svn: 74356
2009-06-26 23:27:24 +00:00
Douglas Gregor cf0b47d179 During template argument deduction from a function call, allow
deduction from pointer and pointer-to-member types to work even in the
presence of a qualification conversion (C++ [temp.deduct.type]p3
bullet 2). 

llvm-svn: 74354
2009-06-26 23:10:12 +00:00
Anders Carlsson 94ff77a356 More auto work.
llvm-svn: 74339
2009-06-26 22:18:59 +00:00
Anders Carlsson f82bb6b4ed Fix test.
llvm-svn: 74335
2009-06-26 21:54:43 +00:00
Douglas Gregor febe45a727 A little template argument deduction test uncovered an "oops". As part
of template instantiation, we were dropping cv-qualifiers on the
instantiated type in a few places. This change reshuffles the
type-instantiation code a little bit so that there's a single place
where we add qualifiers to the instantiated type, so that we won't end
up with this same bug in the future.

llvm-svn: 74331
2009-06-26 21:40:05 +00:00
Nate Begeman ea12f6ebb5 OpenCL 1.0 Support: fix a bug with lvalue swizzles
llvm-svn: 74324
2009-06-26 21:12:50 +00:00
Douglas Gregor 705c900d23 Template argument deduction is no longer responsible for checking
non-dependent parameter types. Instead, class template partial
specializations perform a final check of all of the instantiated
arguments. This model is cleaner, and works better for function
templates where the "final check" occurs during overload resolution.

Also, cope with cv-qualifiers when the parameter type was originally a
reference type, so that the deduced argument can be more qualified
than the transformed argument.

llvm-svn: 74323
2009-06-26 20:57:09 +00:00
Anders Carlsson 6bd992d1c3 Can't have arrays of auto.
llvm-svn: 74314
2009-06-26 19:33:28 +00:00
Anders Carlsson 364035d1a8 An auto variable can't appear in its own initializer.
llvm-svn: 74312
2009-06-26 19:16:07 +00:00
Anders Carlsson 082acded44 Implement enough of the 'auto' keyword so we can claim to support N2546.
llvm-svn: 74307
2009-06-26 18:41:36 +00:00
Devang Patel 2872df839d typo
llvm-svn: 74305
2009-06-26 18:33:42 +00:00
Devang Patel 0d425350b2 Revrt PR4228 fix for now.
llvm-svn: 74304
2009-06-26 18:32:22 +00:00
Daniel Dunbar c7d0e6525d Simplify, and fix a possible crash (never happens however, because we don't ever
take this path with non-builtin floating point types).

llvm-svn: 74303
2009-06-26 18:32:06 +00:00
Daniel Dunbar e5ebf02e0e Fix bar title in graphs.
llvm-svn: 74302
2009-06-26 18:29:52 +00:00
Douglas Gregor cceb97559e Improve template argument deduction for reference parameters when
deducing template arguments from a function call. Plus, add a bunch of
tests.

llvm-svn: 74301
2009-06-26 18:27:22 +00:00
Nate Begeman 2ffd384441 OpenCL 1.0 Support:
Add support for scalar to vector and partially initialized vector constant initializers. 

llvm-svn: 74299
2009-06-26 18:22:18 +00:00
Daniel Dunbar 3ecc92147d Update performance numbers (missed a link)
llvm-svn: 74297
2009-06-26 18:15:47 +00:00
Daniel Dunbar 5b165e4930 Update performance numbers.
llvm-svn: 74296
2009-06-26 18:14:41 +00:00
Fariborz Jahanian ebe772e2f2 Minor change per Doug's comments.
- Fariborz

llvm-svn: 74287
2009-06-26 16:08:57 +00:00
Nate Begeman f275870014 OpenCL 1.0 support: attributes
llvm-svn: 74280
2009-06-26 06:32:41 +00:00
Anders Carlsson 6915bf6158 Add NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAliasDecl.
llvm-svn: 74279
2009-06-26 06:29:23 +00:00
Anders Carlsson f057cb2310 See through UsingDecls in more places.
llvm-svn: 74269
2009-06-26 05:26:50 +00:00
Anders Carlsson 288dcd1158 Fix failing test.
llvm-svn: 74268
2009-06-26 05:14:36 +00:00
Zhongxing Xu 3d0fc146f9 Fix build break.
llvm-svn: 74267
2009-06-26 05:13:13 +00:00
Chris Lattner d86a13e02e Improve error recovery in C++: when we hit 'implicit int' cases in C++,
these are usually because the parser was thoroughly confused.  In addition
to typing the value being declared as an int and hoping for the best, we
mark the value as invalid so we don't get chains of errors when it is
used downstream.  In C, implicit int actually is valid, so typing the thing
as int is good and marking it invalid is bad. :)

llvm-svn: 74266
2009-06-26 04:45:06 +00:00
Chris Lattner 5558e9fc55 fix PR4452, a crash on invalid. The error recovery is still terrible in this case
but at least we don't crash :)

llvm-svn: 74264
2009-06-26 04:27:47 +00:00
Chris Lattner 6dde0bfef7 oink is dead.
llvm-svn: 74263
2009-06-26 04:10:17 +00:00
Anders Carlsson 5f212cbb73 Fix another assert related to using decls.
llvm-svn: 74262
2009-06-26 03:54:13 +00:00
Chris Lattner e2355f70fa rearrange more code, this avoids a token lookahead for foo<
llvm-svn: 74261
2009-06-26 03:52:38 +00:00
Chris Lattner 0eed3a6813 move some code around, no functionality change.
llvm-svn: 74260
2009-06-26 03:47:46 +00:00
Chris Lattner 704edfb095 simplify some code.
llvm-svn: 74259
2009-06-26 03:45:46 +00:00
Anders Carlsson 8d0f6b7c87 When creating LookupResults, see through UsingDecls. Fixes PR4450.
llvm-svn: 74258
2009-06-26 03:37:05 +00:00
Anders Carlsson 5140b3c4a6 Fix PR4448.
llvm-svn: 74257
2009-06-26 03:02:18 +00:00
Nate Begeman c69b740df4 OpenCL 1.0 support: explicit casts to ext-vector types
llvm-svn: 74247
2009-06-26 00:50:28 +00:00
Ted Kremenek bb597cdfc2 Remove '#include <sstream>' from libAnalysis.
llvm-svn: 74245
2009-06-26 00:43:22 +00:00
Ted Kremenek af1ac826f6 Update method signature.
llvm-svn: 74244
2009-06-26 00:41:43 +00:00
Ted Kremenek 18e1caa6bf Unbreak build.
llvm-svn: 74238
2009-06-26 00:25:05 +00:00
Ted Kremenek 27433af0ee Add missing header file.
llvm-svn: 74233
2009-06-26 00:15:05 +00:00
Douglas Gregor 4adbc6d947 Implicit instantiation for function template specializations.
For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.

llvm-svn: 74232
2009-06-26 00:10:03 +00:00
Ted Kremenek 4ac764d72e Remove orphaned header file.
llvm-svn: 74231
2009-06-26 00:08:20 +00:00