summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Adding hasDeclaration overload for TemplateSpecializationTypeEdwin Vane2013-02-254-16/+101
| | | | | | | | | | | | | | TemplateSpecializationType doesn't quite have getDecl(). Need to go through TemplateName to get a TemplateDecl. Added test cases for the hasDeclaration() overload for TemplateSpecializationType. Also introduced the type matcher templateSpecializationType() used by the new hasDeclaration() test case. Updated LibASTMatchersReference. Reviewers: klimek llvm-svn: 176025
* Support in hasDeclaration for types with getDecl()Edwin Vane2013-02-252-2/+26
| | | | | | | | | | | Re-introducing r175532. The has_getDecl metafunction didn't compile with Visual Studio. This revision uses approaches has_getDecl from a different angle that isn't a problem for Visual Studio. Added dedicated tests for the metafunction. Reviewers: klimek llvm-svn: 176024
* Reverting r176019. Corrupt patch.Edwin Vane2013-02-252-36/+2
| | | | llvm-svn: 176021
* Support in hasDeclaration for types with getDecl()Edwin Vane2013-02-252-2/+36
| | | | | | | | | | | Re-introducing r175532. The has_getDecl metafunction didn't compile with Visual Studio. This revision approaches has_getDecl from a different angle that isn't a problem for Visual Studio. Added dedicated tests for the metafunction. Reviewers: klimek llvm-svn: 176019
* Update generated documentation after recent matcher addition.Daniel Jasper2013-02-251-0/+55
| | | | llvm-svn: 176018
* Add matcher for AccessSpecDecls.Daniel Jasper2013-02-252-0/+103
| | | | | | | Also, add matchers isPrivate(), isProtected() and isPublic(), that restrict the matching of such AccessSpecDecls and all other Decls. llvm-svn: 176017
* [analyzer] Relax assumption in FindLastStoreBRVisitor that the thing we are ↵Ted Kremenek2013-02-251-31/+34
| | | | | | | | | | | | looking for is always a VarRegion. This was triggering assertion failures when analyzing the LLVM codebase. This is fallout from r175988. I've got delta chewing away on a test case, but I wanted the fix to go in now. llvm-svn: 176011
* [analyzer] add the notion of an "interesting" lvalue expression for ↵Ted Kremenek2013-02-253-4/+20
| | | | | | | | | | ExplodedNode pruning. r175988 modified the ExplodedGraph trimming algorithm to retain all nodes for "lvalue" expressions. This patch refines that notion to only "interesting" expressions that would be used for diagnostics. llvm-svn: 176010
* Add more attributes from the command line to functions.Bill Wendling2013-02-2544-449/+444
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Documentation: add an idea for a (weird) clang toolDmitri Gribenko2013-02-251-0/+4
| | | | llvm-svn: 176005
* Update Clang for a minor DIBuilder breaking change.David Blaikie2013-02-251-10/+9
| | | | llvm-svn: 176003
* Moving initialization into the initializer list and correcting ↵Aaron Ballman2013-02-241-4/+3
| | | | | | capitalization, as suggested by Chandler. llvm-svn: 176001
* Documentation: add an idea for an automatic refactoringDmitri Gribenko2013-02-241-0/+4
| | | | llvm-svn: 176000
* Allow breaking between a type and name in variable declarations.Daniel Jasper2013-02-244-46/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes llvm.org/PR14967 and is generall necessary to avoid situations where the column limit is exceeded. The challenge is restricting such lines splits, otherwise clang-format suddenly starts breaking at bad places. Before: ReallyLongReturnType<TemplateParam1, TemplateParam2> ReallyReallyLongFunctionName( const std::string &SomeParameter, const SomeType<string, SomeOtherTemplateParameter> &ReallyReallyLongParameterName, const SomeType<string, SomeOtherTemplateParameter> &AnotherLongParameterName) {} After: ReallyLongReturnType<TemplateParam1, TemplateParam2> ReallyReallyLongFunctionName( const std::string &SomeParameter, const SomeType<string, SomeOtherTemplateParameter> & ReallyReallyLongParameterName, const SomeType<string, SomeOtherTemplateParameter> & AnotherLongParameterName) {} llvm-svn: 175999
* Add the testcase from PR13573, this used to crash.Benjamin Kramer2013-02-241-0/+5
| | | | | | The error is a bit strange tbh, but better than crashing. llvm-svn: 175996
* [analyzer] tracking stores/constraints now works for ObjC ivars or struct ↵Ted Kremenek2013-02-249-466/+895
| | | | | | | | | | | | | | | | | | | | | | | fields. This required more changes than I originally expected: - ObjCIvarRegion implements "canPrintPretty" et al - DereferenceChecker indicates the null pointer source is an ivar - bugreporter::trackNullOrUndefValue() uses an alternate algorithm to compute the location region to track by scouring the ExplodedGraph. This allows us to get the actual MemRegion for variables, ivars, fields, etc. We only hand construct a VarRegion for C++ references. - ExplodedGraph no longer drops nodes for expressions that are marked 'lvalue'. This is to facilitate the logic in the previous bullet. This may lead to a slight increase in size in the ExplodedGraph, which I have not measured, but it is likely not to be a big deal. I have validated each of the changed plist output. Fixes <rdar://problem/12114812> llvm-svn: 175988
* Add "KnownSVal" to represent SVals that cannot be UnknownSVal.Ted Kremenek2013-02-244-26/+34
| | | | | | | This provides a few sundry cleanups, and allows us to provide a compile-time check for a case that was a runtime assertion. llvm-svn: 175987
* Add regression test for serialized diagnostics for notes without locations.Ted Kremenek2013-02-241-0/+30
| | | | | | This meant to be included in r175802. llvm-svn: 175986
* PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incompleteRichard Smith2013-02-242-1/+10
| | | | | | array type. llvm-svn: 175982
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-2415-98/+113
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* Add comments for the MacroDirective & MacroInfo classes.Argyrios Kyrtzidis2013-02-241-2/+17
| | | | llvm-svn: 175977
* In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the ↵Argyrios Kyrtzidis2013-02-242-3/+15
| | | | | | | | | | | | consumer just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with ASTConsumer::HandleTopLevelDecl. ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls; a consumer can treat an instantiated static data member however it wants of course. llvm-svn: 175976
* Better formatting of conditional expressions.Daniel Jasper2013-02-233-53/+74
| | | | | | | | | | | | | | | | | | | | | | | In conditional expressions, if the condition is split over multiple lines, also break before both operands. This prevents formattings like: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c; Which are bad, because they suggestion incorrect operator precedence: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c); This lead to the discovery that the expression parser incorrectly handled conditional operators and that it could also handle semicolons (which in turn reduced the amount of special casing for for-loops). As a side-effect, we can now apply the bin-packing configuration to the sections of for-loops. llvm-svn: 175973
* Reference the canonical commit (r175462) in the value casting release note.David Blaikie2013-02-231-1/+3
| | | | llvm-svn: 175971
* Document the value casting API changes.David Blaikie2013-02-231-0/+12
| | | | | | | | | | After changing the way several value inheritance hierarchies (TypeLoc, CFGelement, ProgramPoint and SVal) handle casting, this documentation describes how 3rd party code may need to be updated to compile with the new APIs. As suggested by Sean Silva on cfe-dev. llvm-svn: 175970
* Prefer 'and' over '&' in comments.David Blaikie2013-02-231-3/+4
| | | | | | Post commit code review feedback from Matt Beaumont-Gay on r174248. llvm-svn: 175969
* Shrink SmallPtrSet. It gets swapped a lot which copies the whole small part.Benjamin Kramer2013-02-231-2/+2
| | | | | | | Testing shows that it's empty in >99% of the cases and I couldn't find a case where it contained more than 2 elements. llvm-svn: 175967
* Add streamed versions of getQualifiedNameAsString.Benjamin Kramer2013-02-236-26/+45
| | | | | | Move the cold virtual method getNameForDiagnostic out of line. llvm-svn: 175966
* Remove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.Enea Zaffanella2013-02-231-1/+1
| | | | llvm-svn: 175963
* Don't recognize unnamed pointer parameters as casts.Daniel Jasper2013-02-232-5/+13
| | | | | | | | This fixes llvm.org/PR15061. Before: virtual void f(int *)const; After: virtual void f(int *) const; llvm-svn: 175960
* Allow splitting between string literals and identifiers.Daniel Jasper2013-02-232-1/+14
| | | | | | | | | | | | | | | Also don't break in long include directives as that is not desired. We can now format: #include "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" #define LL_FORMAT "ll" printf("aaaaa: %d, bbbbbbbbb: %" LL_FORMAT "d, cccccccc: %" LL_FORMAT "d, ddddddddd: %" LL_FORMAT "d\n"); Before, this led to weird results. llvm-svn: 175959
* Implement __builtin_eh_return_data_regno() for ARM and MIPS.Logan Chien2013-02-233-0/+26
| | | | llvm-svn: 175954
* clang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.NAKAMURA Takumi2013-02-231-0/+1
| | | | llvm-svn: 175952
* ubsan: Emit bounds checks for array indexing, vector indexing, and (in ↵Richard Smith2013-02-237-17/+207
| | | | | | really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information. llvm-svn: 175949
* Test that attribute(availability) doesn't override private_extern.John McCall2013-02-231-0/+7
| | | | | | rdar://12399248 llvm-svn: 175943
* Remove the CFGElement "Invalid" state.David Blaikie2013-02-2319-85/+78
| | | | | | | | | | | | | Use Optional<CFG*> where invalid states were needed previously. In the one case where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy CFGAutomaticObjDtor. Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek and Doug Gregor. Post commit code review feedback on r175796 by Ted Kremenek. llvm-svn: 175938
* Remove the hack that avoided mangling static functions in extern C contexts.Rafael Espindola2013-02-234-24/+9
| | | | | | | | | | | | | | | | | Weather we should give C language linkage to functions and variables with internal linkage probably depends on how much code assumes it. The standard says they should have no language linkage, but gcc and msvc assign them C language linkage. This commit removes the hack that was preventing the mangling on static functions declare in extern C contexts. It is an experiment to see if we can implement the rules in the standard. If it turns out that many users depend on these functions and variables having C language linkage, we should change isExternC instead and try to convince the CWG to change the standard. llvm-svn: 175937
* Revert r175912, "Add support for coldcc to clang" at John's request.Peter Collingbourne2013-02-2315-59/+12
| | | | llvm-svn: 175936
* Propagate the split dwarf file information through into the backendEric Christopher2013-02-224-4/+17
| | | | | | | | | and through to the debug info in the module. In order to make the testcase a bit more efficient allow the filename to go through compilation for compile and not assemble jobs and turn off the extract for cases where we don't create an object. llvm-svn: 175935
* [libclang] Fix assertion hit when code-completing inside a function macro ↵Argyrios Kyrtzidis2013-02-222-4/+12
| | | | | | | | with more arguments than it should accept. llvm-svn: 175925
* objective-C arg: provide fixit support whenFariborz Jahanian2013-02-228-42/+106
| | | | | | | c++'s named cast need be replaced for bridge casting. // rdar://12788838 llvm-svn: 175923
* Update tests so that we don't test for function-only attributes on call sites.Bill Wendling2013-02-225-16/+19
| | | | llvm-svn: 175921
* Driver: Pass down the -march setting down to -cc1as on x86 too.Benjamin Kramer2013-02-223-0/+23
| | | | | | | The assembler historically didn't make use of any target features, but this has changed when support for old CPUs that don't support long nops was added. llvm-svn: 175919
* Make sure we apply attributes to correct places.Bill Wendling2013-02-221-13/+17
| | | | | | | Some attributes make sense only on the function or on the call site, but not both. Make this distinction here. llvm-svn: 175918
* Split out the command handling for split debug info, we're goingEric Christopher2013-02-224-32/+46
| | | | | | | | | to want to propagate some information through the module into the back end and so need to pass it through to codegen. Also make the methods file static so we can use them in other places. llvm-svn: 175916
* [analyzer] Don't canonicalize the RecordDecl used in CXXBaseObjectRegion.Jordan Rose2013-02-222-2/+32
| | | | | | | | | | | This Decl shouldn't be the canonical Decl; it should be the Decl used by the CXXBaseSpecifier in the subclass. Unfortunately, that means continuing to throw getCanonicalDecl() on all comparisons. This fixes MemRegion::getAsOffset's use of ASTRecordLayout when redeclarations are involved. llvm-svn: 175913
* Add support for coldcc to clangPeter Collingbourne2013-02-2215-12/+59
| | | | llvm-svn: 175912
* [preprocessing record] Have the MacroDefinitions map point to the ↵Argyrios Kyrtzidis2013-02-224-13/+21
| | | | | | | | | | MacroDefinition object instead its index in the preprocessed entities vector. This is because the order of the entities in the vector can change in some (uncommon) cases. llvm-svn: 175907
* Replace some typically large vectors with SmallVector.Benjamin Kramer2013-02-223-7/+7
| | | | | | | | This may seem counter-intuitive but the POD-like optimization helps when the vectors grow into multimegabyte buffers. SmallVector calls realloc which knows how to twiddle virtual memory bits and avoids large copies. llvm-svn: 175906
* Make sure pragmas don't attach visibility attributes to auto variables withRafael Espindola2013-02-222-6/+19
| | | | | | internal linkage. llvm-svn: 175903
OpenPOWER on IntegriCloud