summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Add option to disable string literal formatting.Daniel Jasper2016-02-014-2/+17
| | | | llvm-svn: 259352
* clang-format: Fix alignment of trailing multiline columns.Daniel Jasper2016-02-012-10/+22
| | | | llvm-svn: 259351
* clang-format: [JS] Treat "in" as a proper operator.Daniel Jasper2016-02-012-0/+21
| | | | llvm-svn: 259350
* [analyzer] Use a wider integer type for an array index.Artem Dergachev2016-02-012-1/+40
| | | | | | | | | | | | | Avoids unexpected overflows while performing pointer arithmetics in 64-bit code. Moreover, neither PointerDiffType nor 'int' can be used as a common array index type because arrays may have size (and indexes) more than PTRDIFF_MAX but less than SIZE_MAX. Patch by Aleksei Sidorin! Differential Revision: http://reviews.llvm.org/D16063 llvm-svn: 259345
* Mark DR1250 as implementedDavid Majnemer2016-02-013-13/+19
| | | | | | | We implemented this DR back in r258768 but forgot to mark it as implemented. llvm-svn: 259335
* Replace usage of llvm::utostr_32 with just llvm::utostr. While this is less ↵Craig Topper2016-01-311-1/+1
| | | | | | efficient, its unclear that the one place using the _32 version was doing so for efficiency. llvm-svn: 259316
* [Parser] Update CachedTokens while parsing ObjectiveC template argument listBruno Cardoso Lopes2016-01-314-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following ObjC++ snippet: -- @protocol PA; @protocol PB; @class NSArray<ObjectType>; typedef int some_t; id<PA> FA(NSArray<id<PB>> *h, some_t group); -- This would hit an assertion in the parser after generating an annotation token while trying to update the token cache: Assertion failed: (CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token") ... 7 clang::Preprocessor::AnnotatePreviousCachedTokens(clang::Token const&) + 494 8 clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool, bool, clang::CXXScopeSpec&, bool) + 1163 9 clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 361 10 clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*) + 598 ... The cached preprocessor token in this case is: greatergreater '>>' Loc=<testcase.mm:7:24> while the annotation ("NSArray<id<PB>>") ends at "testcase.mm:7:25", hence the assertion. Properly update the CachedTokens during template parsing to contain two greater tokens instead of a greatergreater. Differential Revision: http://reviews.llvm.org/D15173 rdar://problem/23494277 llvm-svn: 259311
* No need to use utostr when putting integers into a raw_ostream. NFCCraig Topper2016-01-311-5/+5
| | | | llvm-svn: 259310
* Convert an unsigned to Twine instead of using utostr since we're already ↵Craig Topper2016-01-311-1/+1
| | | | | | building a Twine. NFC llvm-svn: 259309
* [AST] Pull simple method inline.Benjamin Kramer2016-01-302-5/+3
| | | | llvm-svn: 259304
* assert(false) -> llvm_unreachable().Davide Italiano2016-01-303-3/+3
| | | | llvm-svn: 259302
* [analyzer] Make suppression of macro defensive checks work with ↵Devin Coughlin2016-01-302-15/+46
| | | | | | | | | -analyzer-eagerly-assume. This is the default for the analyzer but the flag is added by the driver so our suppression tests didn't cover this case. llvm-svn: 259288
* [SemaCXX] Fix crash-on-invalid while trying to deduce return type of a lambda.Argyrios Kyrtzidis2016-01-302-4/+16
| | | | | | rdar://22032373 llvm-svn: 259287
* Avoid overly large SmallPtrSet/SmallSetMatthias Braun2016-01-304-10/+4
| | | | | | | | | These sets perform linear searching in small mode so it is never a good idea to use SmallSize/N bigger than 32. Differential Revision: http://reviews.llvm.org/D16705 llvm-svn: 259284
* Remove references to autotools build.Alexey Samsonov2016-01-302-4/+1
| | | | llvm-svn: 259278
* This patch adds doxygen comments for the intrinsincs in the header file ↵Ekaterina Romanova2016-01-291-0/+85
| | | | | | | | | | __wmmintrin_aes.h. The doxygen comments are automatically generated based on Sony's intrinsics document. Differential Revision: http://reviews.llvm.org/D16562 llvm-svn: 259275
* Improve -Wconstant-conversionRichard Trieu2016-01-293-3/+70
| | | | | | | | | | | | | | Switch the evaluation from isIntegerConstantExpr to EvaluateAsInt. EvaluateAsInt will evaluate more types of expressions than isIntegerConstantExpr. Move one case from -Wsign-conversion to -Wconstant-conversion. The case is: 1) Source and target types are signed 2) Source type is wider than the target type 3) The source constant value is positive 4) The conversion will store the value as negative in the target. llvm-svn: 259271
* Class Property: generate metadata for class properties in protocols.Manman Ren2016-01-293-6/+21
| | | | | | | | | | The list of class properties is saved in Old ABI: protocol->ext->class_properties (protocol->ext->size will be updated) New ABI: protocol->class_properties (protocol->size will be updated) rdar://23891898 llvm-svn: 259268
* Class Property: generate metadata for class properties in categories.Manman Ren2016-01-292-4/+45
| | | | | | | | | | | The list of class properties is saved in Old ABI: category->class_properties (category->size will be updated as well) New ABI: category->class_properties (a flag in objc_image_info to indicate whether or not the list of class properties is present) rdar://23891898 llvm-svn: 259267
* [UBSan] Add documentation for runtime issue suppression.Alexey Samsonov2016-01-291-0/+32
| | | | llvm-svn: 259260
* This patch adds doxygen comments for the intrinsincs in the header file ↵Ekaterina Romanova2016-01-291-0/+28
| | | | | | | | __wmmintrin_pclmul.h. The doxygen comments are automatically generated based on Sony's intrinsics document. Differential Revision: http://reviews.llvm.org/D15999 llvm-svn: 259239
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-2926-34/+34
| | | | | | r259192 post commit comment. llvm-svn: 259232
* Class Property: generate metadata for class properties in classes.Manman Ren2016-01-291-28/+57
| | | | | | | | | | The list of class properties is saved in Old ABI: cls->isa->ext->properties New ABI: cls->isa->ro->properties rdar://23891898 llvm-svn: 259229
* Class Property: warn for synthesize on a class property.Manman Ren2016-01-293-2/+7
| | | | | | rdar://23891898 llvm-svn: 259226
* Class Property: parse @dynamic (class).Manman Ren2016-01-292-2/+29
| | | | | | rdar://23891898 llvm-svn: 259224
* [analyzer] Suppress null reports from defensive checks in function-like macros.Devin Coughlin2016-01-292-1/+94
| | | | | | | | | We already do this for case splits introduced as a result of defensive null checks in functions and methods, so do the same for function-like macros. rdar://problem/19640441 llvm-svn: 259222
* [analyzer] Improve Nullability checker diagnosticsAnna Zaks2016-01-296-57/+114
| | | | | | | | | - Include the position of the argument on which the nullability is violated - Differentiate between a 'method' and a 'function' in the message wording - Test for the error message text in the tests - Fix a bug with setting 'IsDirectDereference' which resulted in regular dereferences assumed to have call context. llvm-svn: 259221
* Revert r259210 "Extend hasType narrowing matcher for TypedefDecls, add ↵Hans Wennborg2016-01-295-132/+14
| | | | | | | | functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes." It didn't pass check-clang. llvm-svn: 259218
* Extend hasType narrowing matcher for TypedefDecls, add functionProtoType ↵Aaron Ballman2016-01-295-14/+132
| | | | | | | | matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes. Patch by Richard Thomson llvm-svn: 259210
* Removing unnecessary casts; NFC.Aaron Ballman2016-01-291-2/+2
| | | | llvm-svn: 259194
* Implement TemplateArgument::dump() method for debugging, patterned after ↵Yaron Keren2016-01-292-0/+15
| | | | | | TemplateName::dump(). llvm-svn: 259192
* Add an optional ToolName argument to ↵Benjamin Kramer2016-01-293-12/+19
| | | | | | | | | | runToolOnCodeWithArgs/buildASTFromCodeWithArgs. This can be used as a way to modify argv[0] for a clang tool. Differential Revision: http://reviews.llvm.org/D16718 llvm-svn: 259187
* Add target triple to CodeGenOpenCL/pipe_types.cl test caseUlrich Weigand2016-01-291-1/+1
| | | | | | | | | The test is failing on SystemZ since different IR is being generated due to platform ABI differences. Add a target triple. Fix suggested by Anastasia Stulova. llvm-svn: 259183
* [Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p5 and p6:Nathan Wilson2016-01-294-0/+58
| | | | | | | | | | | Diagnose if the return type of a function concept or declaration type of a variable concept is not bool. Reviewers: hubert.reinterpretcast Differential Revision: http://reviews.llvm.org/D16163 llvm-svn: 259159
* Remove unnecessary forward declaration. NFCCraig Topper2016-01-291-1/+0
| | | | llvm-svn: 259156
* Add the clang debug info test directory to .gitignore as it's managed ↵Eric Christopher2016-01-291-0/+2
| | | | | | separately. llvm-svn: 259138
* Use a consistent spelling for vtables.Eric Christopher2016-01-299-26/+26
| | | | llvm-svn: 259137
* [CUDA] Generate CUDA's printf alloca in its function's entry block.Justin Lebar2016-01-282-72/+41
| | | | | | | | | | | | | | | Summary: This is necessary to prevent llvm from generating stacksave intrinsics around this alloca. NVVM doesn't have a stack, and we don't handle said intrinsics. Reviewers: rnk, echristo Subscribers: cfe-commits, jhen, tra Differential Revision: http://reviews.llvm.org/D16664 llvm-svn: 259122
* Class Property: change PropertyMap to include isClassProperty.Manman Ren2016-01-284-24/+41
| | | | | | | | | | | | | | PropertyMap used to map IdentifierInfo (name of the property) to ObjcPropertyDecl *. Now that a class property can have the same name as an instance property, we change PropertyMap to map a pair <IdentifierInfo *, unsigned> to ObjcPropertyDecl *. Also update a few places from iterating over instance_properties to iterating over all properties. rdar://23891898 llvm-svn: 259119
* [analyzer] NullabilityChecker: Remove unused isReturnSelf() function.Devin Coughlin2016-01-281-16/+0
| | | | | | | Remove the now-unused isReturnSelf() function so we don't get a compiler warning. Apologies for not doing this in r259099. llvm-svn: 259118
* Check for frontend errors after releasing the Builder.Manman Ren2016-01-282-3/+34
| | | | | | | | | | | | | Frontend can emit errors when releaseing the Builder. If there are errors before or when releasing the Builder, we reset the module to stop here before invoking the backend. Before this commit, clang will continue to invoke the backend and backend can crash. Differential Revision: http://reviews.llvm.org/D16564 llvm-svn: 259116
* Update for llvm change.Rafael Espindola2016-01-281-1/+1
| | | | llvm-svn: 259108
* [analyzer] Suppress nullability warnings in copy, mutableCopy, and init ↵Devin Coughlin2016-01-282-13/+62
| | | | | | | | | | | | | | families. There are multiple, common idioms of defensive nil-checks in copy, mutableCopy, and init methods in ObjC. The analyzer doesn't currently have the capability to distinguish these idioms from true positives, so suppress all warnings about returns in those families. This is a pretty blunt suppression that we should improve later. rdar://problem/24395811 llvm-svn: 259099
* Implementation of PS4 ABI, Round 1Sunil Srivastava2016-01-281-1/+10
| | | | | | | | Added a test to safeguard linux ABI. Differential Revision: http://reviews.llvm.org/D16607 llvm-svn: 259095
* Include RecordDecls from anonymous unions in the AST.Nico Weber2016-01-288-34/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For void f() { union { int i; }; } clang used to omit the RecordDecl from the anonymous union from the AST. That's because the code creating it only called PushOnScopeChains(), which adds it to the current DeclContext, which here is the function's DeclContext. But RecursiveASTVisitor doesn't descent into all decls in a FunctionDecl. Instead, for DeclContexts that contain statements, return the RecordDecl so that it can be included in the DeclStmt containing the VarDecl for the union. Interesting bits from the AST before this change: |-FunctionDecl | `-CompoundStmt | |-DeclStmt | | `-VarDecl 0x589cd60 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit After this change: -FunctionDecl | `-CompoundStmt | |-DeclStmt | | |-CXXRecordDecl 0x4612e48 <col:3, col:18> col:3 union definition | | | |-FieldDecl 0x4612f70 <col:11, col:15> col:15 referenced i 'int' | | `-VarDecl 0x4613010 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit This is now closer to how anonymous struct and unions are represented as members of structs. It also enabled deleting some one-off code in the template instantiation code. Finally, it fixes a crash with ASTMatchers, see the included test case (this fixes http://crbug.com/580749). llvm-svn: 259079
* Remove unused parameter.Nico Weber2016-01-281-9/+6
| | | | llvm-svn: 259077
* Class Property: class property and instance property can have the same name.Manman Ren2016-01-2816-61/+154
| | | | | | | | | | | | | | | | | | | Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name of the property: ObjCPropertyDecl::findPropertyDecl, ObjCContainerDecl::FindPropertyDeclaration, ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass, ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl. ObjCPropertyQueryKind currently has 3 values: OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class This extra parameter specifies that we are looking for an instance property with the given name, or a class property with the given name, or any property with the given name (if both exist, the instance property will be returned). rdar://23891898 llvm-svn: 259070
* [PGO] test case cleanupsXinliang David Li2016-01-284-15/+21
| | | | | | | 1. Make test case more focused and robust by focusing on what to be tested (linkage, icall) -- make it easier to validate 2. Testing linkages of data and counter variables instead of names. Counters and data are more relavant to be tested. llvm-svn: 259067
* Fix strange indent.Nico Weber2016-01-281-2/+2
| | | | llvm-svn: 259063
* [Coverage] Use a set to track visited FileIDs (NFC)Vedant Kumar2016-01-281-3/+3
| | | | llvm-svn: 259061
OpenPOWER on IntegriCloud