summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Introduce the virtual method Decl::getPrimaryDecl().Argyrios Kyrtzidis2009-07-051-0/+16
| | | | | | | When a Decl subclass can have multiple re-declarations in the same declaration context (like FunctionDecl), getPrimaryDecl() will return a particular Decl that all of them will point to as the "primary" declaration. llvm-svn: 74800
* Avoid re-checking the parameters of a function, when trying to resolve a ↵Argyrios Kyrtzidis2009-07-051-5/+12
| | | | | | location. llvm-svn: 74799
* Make use of ASTNode for return value of clang::ResolveLocationInAST() and in ↵Argyrios Kyrtzidis2009-07-051-4/+4
| | | | | | the index-test tool. llvm-svn: 74798
* Introduce ASTNode class into the AST library.Argyrios Kyrtzidis2009-07-052-0/+91
| | | | | | ASTNode is an immutable pair of a Decl and Stmt. If Stmt is not null, Decl should be its immediate parent. llvm-svn: 74797
* Do an early check for function definition.Argyrios Kyrtzidis2009-07-051-10/+12
| | | | llvm-svn: 74796
* Per PR4506, fix the type of size_t on OpenBSD.Eli Friedman2009-07-051-1/+12
| | | | llvm-svn: 74795
* Catch function redeclarations with incompatible exception specifications.Sebastian Redl2009-07-043-0/+57
| | | | llvm-svn: 74787
* This fixes the case where the wrong symbol is emitted leading to linking ↵Fariborz Jahanian2009-07-031-4/+9
| | | | | | | | errors when you reference a class before defining it (GNU runtime). Patch by David Chisnall. llvm-svn: 74772
* remove utility methods that are not very useful.Zhongxing Xu2009-07-031-1/+1
| | | | llvm-svn: 74762
* Add an intermediate typedef for __builtin_va_tag to make it a bit easier Eli Friedman2009-07-031-1/+2
| | | | | | | to deal with for AST pretty-printing/rewriting. Patch by Abramo Bagnara. llvm-svn: 74752
* Remove unused method.Ted Kremenek2009-07-031-3/+0
| | | | llvm-svn: 74751
* BasicStoreManager: Use SymbolManager::canSymbolicate() to determine if a ↵Ted Kremenek2009-07-031-1/+1
| | | | | | variable can be symbolicated. llvm-svn: 74750
* Fix a horrible CFG bug reported in <rdar://problem/7027684>. The wrong successorTed Kremenek2009-07-031-1/+1
| | | | | | | block would get hooked up in some cases when processing empty compound statements. llvm-svn: 74743
* Replace guarded calls in RegionStoreManager toTed Kremenek2009-07-021-21/+7
| | | | | | | | | 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
* Enhance RegionStore to lazily symbolicate fields and array elements forTed Kremenek2009-07-022-2/+13
| | | | | | structures passed-by-value as function arguments. llvm-svn: 74729
* Patch to allocate list of bases in CXXRecordDeclFariborz Jahanian2009-07-022-6/+10
| | | | | | using ASTContxt allocation. llvm-svn: 74717
* StoreManagers: Use 'hasGlobalsStorage()' and 'hasParametersStorage()' instead ofTed Kremenek2009-07-023-7/+21
| | | | | | | directly consulting if a VarDecl is an implicit or actual parameter, a global, etc. llvm-svn: 74716
* Add a separate MemSpaceRegion for function/method arguments passed on the stack.Ted Kremenek2009-07-021-3/+11
| | | | | | | This will simplify the logic of StoreManagers that want to specially reason about the values of parameters. llvm-svn: 74715
* Remove commented methods. Add MemRegion::printStdErr().Ted Kremenek2009-07-021-0/+4
| | | | llvm-svn: 74709
* Add support for retrieving the Doxygen comment associated with a givenDouglas Gregor2009-07-029-5/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Look through vector types when determining the base type of a type for ↵Douglas Gregor2009-07-011-0/+2
| | | | | | declarator printing. Bug found via the PCH tester llvm-svn: 74672
* Use Destroy for member initializer list clean up.Fariborz Jahanian2009-07-012-2/+15
| | | | | | Per Doug's comments. Doug please review. llvm-svn: 74666
* Minor code cleanup: pull variables into scope of 'if' statement, limiting theirTed Kremenek2009-07-011-10/+8
| | | | | | actual lifetime to their logical lifetime. llvm-svn: 74665
* Fix PR 4489, a PCH crash during de-serialization.Douglas Gregor2009-07-012-2/+0
| | | | llvm-svn: 74664
* Add a FIXME to RegionStore, do some minor code cleanup, and get RegionStore toTed Kremenek2009-07-011-11/+23
| | | | | | | | 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
* Update for changes in LLVM. Hopefully this is the last one for a while.Owen Anderson2009-07-012-4/+4
| | | | llvm-svn: 74657
* Keep track of more information within the template instantiation stack, e.g.,Douglas Gregor2009-07-014-31/+107
| | | | | | | | | | | | | | 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
* Hold the LLVMContext by reference instead of by pointer.Owen Anderson2009-07-012-4/+4
| | | | llvm-svn: 74642
* Updated CXXConstructorDecl AST node for ctor-initilaizer list.Fariborz Jahanian2009-07-011-0/+13
| | | | | | No change in functionality. llvm-svn: 74639
* Fix thinko in r74506, test condition for floats was inverted.Daniel Dunbar2009-07-011-7/+7
| | | | | | - Refactored slightly to make control flow more obvious. llvm-svn: 74637
* Driver: Mark some Compilation members const.Daniel Dunbar2009-07-011-2/+2
| | | | llvm-svn: 74636
* Driver: Move Compilation::Execute to Driver::ExecuteCompilation.Daniel Dunbar2009-07-012-48/+48
| | | | | | | | | - The Compilation is just a helper class, it shouldn't have that amount of logic in it. - No functionality change. llvm-svn: 74634
* Patch to implement template types in ctor-initializer list.Fariborz Jahanian2009-07-013-8/+22
| | | | | | Also has fix for bugzilla-4469. llvm-svn: 74631
* Driver: Improve diagnostics for failed commands.Daniel Dunbar2009-07-011-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Driver: Add Source argument for Commands to hold the Action which caused aDaniel Dunbar2009-07-012-16/+18
| | | | | | | Command to be generated, to support more advanced diagnostics. - No functionality change. llvm-svn: 74627
* Add header search path for Gentoo stable, x86_64 version.Sebastian Redl2009-07-011-0/+8
| | | | llvm-svn: 74626
* Update for LLVMContext+Module change.Owen Anderson2009-07-012-8/+13
| | | | llvm-svn: 74615
* Two fixes to make Clang build on Visual C++ (again), from Alisdair Meredith.Douglas Gregor2009-07-011-5/+5
| | | | llvm-svn: 74606
* Rework Sema::CheckConditionalOperands(). No functionality change.Steve Naroff2009-07-012-98/+136
| | | | | | | | | 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
* Implement Eli's feedback for vecto constant expressions;Nate Begeman2009-07-011-5/+52
| | | | | | | | | 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
* use new and simplified LLVM APIs. Patch by Jay Foad!Chris Lattner2009-07-012-6/+3
| | | | llvm-svn: 74585
* Fix for PR4192: fix the definition of int64_t on x86_64 Linux.Eli Friedman2009-07-013-3/+17
| | | | | | | | | | | | | 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
* add fixme.Zhongxing Xu2009-07-012-0/+3
| | | | llvm-svn: 74581
* Cope with explicitly-specified function template arguments when thereDouglas Gregor2009-07-015-12/+39
| | | | | | | are fewer template arguments than there are template parameters for that function. llvm-svn: 74578
* When explicit template arguments are provided for a function call,Douglas Gregor2009-06-304-27/+167
| | | | | | | | | 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
* Patch to support optional nested-name-specifier in in ctor-initializerFariborz Jahanian2009-06-303-18/+23
| | | | | | list. llvm-svn: 74571
* Preliminary parsing and ASTs for template-ids that refer to functionDouglas Gregor2009-06-308-16/+191
| | | | | | | templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. llvm-svn: 74563
* Update old CastRegion logic to not assume that ElementRegion's super region is aTed Kremenek2009-06-301-3/+3
| | | | | | | | 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
* Fix: <rdar://problem/7021553> clang -fsyntax-only crashes (in ↵Ted Kremenek2009-06-301-4/+4
| | | | | | | | | 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
* Diagnose multiple initialization of anonymous unionFariborz Jahanian2009-06-301-1/+8
| | | | | | fields in the ctor-initializer list. llvm-svn: 74554
OpenPOWER on IntegriCloud