summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Address Jordan's code review of r175857.Anna Zaks2013-02-252-20/+31
| | | | llvm-svn: 176043
* [analyzer] Handle reference parameters with default values.Jordan Rose2013-02-254-4/+23
| | | | | | | | | | | | r175026 added support for default values, but didn't take reference parameters into account, which expect the default argument to be an lvalue. Use createTemporaryRegionIfNeeded if we can evaluate the default expr as an rvalue but the expected result is an lvalue. Fixes the most recent report of PR12915. The original report predates default argument support, so that can't be it. llvm-svn: 176042
* Add a front-end test case for r176036.Chad Rosier2013-02-251-0/+8
| | | | llvm-svn: 176038
* Fix empty declaration printing.Michael Han2013-02-252-1/+1
| | | | | | | Don't print the semicolon when visiting an empty declaration because the semicolon will be printed as a terminator later. llvm-svn: 176035
* [analyzer] Base regions may be invalid when layered on symbolic regions.Jordan Rose2013-02-252-0/+54
| | | | | | | | | | | | | | | | While RegionStore checks to make sure casts on TypedValueRegions are valid, it does not do the same for SymbolicRegions, which do not have perfect type info anyway. Additionally, MemRegion::getAsOffset does not take a ProgramState, so it can't use dynamic type info to determine a better type for the regions. (This could also be dangerous if the type of a super-region changes!) Account for this by checking that a base object region is valid on top of a symbolic region, and falling back to "symbolic offset" mode if not. Fixes PR15345. llvm-svn: 176034
* Add forgotten testcase.Eric Christopher2013-02-251-0/+7
| | | | llvm-svn: 176032
* Re-add hack that caused regression.Daniel Jasper2013-02-252-1/+7
| | | | | | | | | | | | | | | | | | | This fixes llvm.org/PR15350. Before: Constructor(int Parameter = 0) : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa), aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {} After: Constructor(int Parameter = 0) : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa), aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {} I think the correct solution is to put the VariablePos into ParenState, not LineState. Added FIXME. llvm-svn: 176027
* 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
OpenPOWER on IntegriCloud