summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo in OpenCL type mangling. This is still bogus (we should either use theRichard Smith2016-02-031-1/+1
| | | | | | | | | | actual source name of the typedef or a vendor mangling) but at least it stands a chance of demangling now. We would also benefit from some test coverage of this (OpenCL + __attribute__((overloadable)) is probably required to reach this). llvm-svn: 259618
* Fix Itanium RTTI emission so that we emit fundamental type information into theRichard Smith2016-02-031-2/+11
| | | | | | | | | | | | | | | | C++ ABI library for the same set of types for which we expect the C++ ABI library to provide the RTTI. Specifically: 1) __int128 and unsigned __int128 are now emitted into the ABI library. We always expected them to be there but never actually made sure to emit them. 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library. Neither libc++abi nor libstdc++ puts them there when built with either GCC or Clang. This matches GCC's behavior. llvm-svn: 259616
* PR24989: Stop trying to use the C++11 rules for lambda return type inference inRichard Smith2016-02-022-14/+20
| | | | | | | | C++14 generic lambdas. It conflicts with the C++14 return type deduction mechanism, and results in us failing to actually deduce the lambda's return type in some cases. llvm-svn: 259609
* Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.Richard Smith2016-02-021-1/+1
| | | | llvm-svn: 259604
* Work around build failure due to GCC 4.8.1 bug. We don't completely understandRichard Smith2016-02-021-14/+6
| | | | | | | | | | the details of the bug, but avoiding overloading llvm::cast with another function template sidesteps it. See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more backgound on how it manifested in Clang. Patch by Igor Sugak! llvm-svn: 259598
* [CUDA] Do not allow dynamic initialization of global device side variables.Artem Belevich2016-02-024-11/+84
| | | | | | | | | | | | | | In general CUDA does not allow dynamic initialization of global device-side variables. One exception is that CUDA allows records with empty constructors as described in section E2.2.1 of CUDA 7.5 Programming guide. This patch applies initializer checks for all device-side variables. Empty constructors are accepted, but no code is generated for them. Differential Revision: http://reviews.llvm.org/D15305 llvm-svn: 259592
* ObjCXX: fix a crash during typo correction.Manman Ren2016-02-021-2/+7
| | | | | | | | | | | | | For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion and SubExpr being BlockExpr. Specifically one can return BlockExpr from BuildCXXMemberCallExpr and the result can be used to build a CastExpr. Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only be CXXMemberCallExpr. rdar://problem/24364077 llvm-svn: 259591
* PR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid ↵Denis Zobnin2016-02-022-1/+7
| | | | | | | | | | | for-range expression. Fix the issue discovered by fuzzing (PR23057, comment 18) by handling nullptr in Sema::ActOnCXXForRangeDecl and correct delayed typos in for-range expression before calling Sema::ActOnCXXForRangeStmt. Also fixes PR26288. Differential Revision: http://reviews.llvm.org/D16630 llvm-svn: 259532
* Make CodeGen headers self-contained.Benjamin Kramer2016-02-021-1/+1
| | | | llvm-svn: 259518
* Make the remaining headers self-contained.Benjamin Kramer2016-02-022-8/+5
| | | | llvm-svn: 259507
* Add backend dignostic printer for unsupported featuresOliver Stannard2016-02-021-11/+64
| | | | | | | | | | | | | | Re-commit of r258950 after fixing layering violation. The related LLVM patch adds a backend diagnostic type for reporting unsupported features, this adds a printer for them to clang. In the case where debug location information is not available, I've changed the printer to report the location as the first line of the function, rather than the closing brace, as the latter does not give the user any information. This also affects optimisation remarks. llvm-svn: 259499
* Fix for PR8901: attribute "mode" rejected for enums and dependent types.Denis Zobnin2016-02-022-35/+83
| | | | | | | | | Allow "mode" attribute for enum types, except for vector modes, for compatibility with GCC. Support "mode" attribute with dependent types. Differential Revision: http://reviews.llvm.org/D16219 llvm-svn: 259497
* [OpenCL] Eliminate warning when declaring OpenCL builtin functions.Anastasia Stulova2016-02-021-3/+3
| | | | | | | | | | | | | | OpenCL builtin functions are usually declared in header files. Currently clang emits warning for OpenCL builtin functions which have the same name as standard C library functions. This commit eliminates such warnings by not adding the C standard includes following the restriction from OpenCL v1.2 s6.9.f. Patch by Liu Yaxun (Sam)! Review: http://reviews.llvm.org/D16692 llvm-svn: 259491
* Make headers self-contained.Benjamin Kramer2016-02-021-1/+1
| | | | llvm-svn: 259490
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-0213-90/+85
| | | | | | from Driver to Frontend. llvm-svn: 259489
* clang-format: Make AlignAfterOpenBracket also affect angle brackets.Daniel Jasper2016-02-021-1/+2
| | | | | | Patch by Matthew Whitehead, thank you. llvm-svn: 259487
* [OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.Alexey Bataev2016-02-021-5/+6
| | | | llvm-svn: 259465
* [OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob2016-02-022-15/+44
| | | | | | | | | | | | | | | | | | regions. Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259464
* [asan] Add iOS support for Address SanitizerAnna Zaks2016-02-022-6/+26
| | | | | | Differential Revision: http://reviews.llvm.org/D15624 llvm-svn: 259453
* Template Type Diffing changeRichard Trieu2016-02-021-3/+9
| | | | | | | When all the arguments of a template are elided, print "A<...>" instead of "A<[2 * ...]>". Also remove comment fragment that means nothing. llvm-svn: 259445
* Always build a new TypeSourceInfo for function templates with parametersNico Weber2016-02-011-16/+6
| | | | | | | | | | | | | | | | | | | | | RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and `DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's ParmVarDecls. For a function template that doesn't have parameters that explicitly depend on the template parameter, we used to be clever and not build a new TypeSourceInfo. That meant that when an instantiation of such a template is visited, its TypeSourceInfo would point to the ParmVarDecls of the template, not of the instantiation, which then confused clients of RecursiveASTVisitor. So don't be clever for function templates that have parameters, even if none of the parameters depend on the type. Fixes PR26257. http://reviews.llvm.org/D16478 llvm-svn: 259428
* Undoing commit r259366 to debug buildbot failure.Arpith Chacko Jacob2016-02-012-46/+15
| | | | | | > http://reviews.llvm.org/D16758 llvm-svn: 259418
* Code clean up; NFC.Aaron Ballman2016-02-011-4/+4
| | | | | | Patch by Alexander Riccio. llvm-svn: 259409
* Fix attribute((mode([word|unwind_word]))) for x32Reid Kleckner2016-02-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by H.J. Lu ``` typedef unsigned int gcc_word __attribute__((mode(word))); ``` and ``` typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word))); ``` define the largest unsigned integer types which can be stored in a general purpose register, which may not be the pointer type. For x32, they aren't pointer nor unsigned long. We should 1. Make getUnwindWordWidth and getRegisterWidth virtual, 2. Override them for x32, similar to hasInt128Type. 3. Use getRegisterWidth for __attribute__((mode(word))); This fixes PR 24706. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D16779 llvm-svn: 259383
* Move LocInfoType from Sema to AST.Benjamin Kramer2016-02-014-4/+2
| | | | | | | While transient and only used during parsing, LocInfoTypes are still used from ASTDumper and are part of the AST. llvm-svn: 259376
* [OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob2016-02-012-15/+46
| | | | | | | | | | | | | | | | | | regions. Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259366
* Reapply r259210 with a fix for RegistryTest.cpp.Aaron Ballman2016-02-011-0/+1
| | | | | | Patch by Richard Thomson. llvm-svn: 259359
* Remove the egregious PCHContainer layering hack that doesn't seem to be ↵Benjamin Kramer2016-02-012-5/+3
| | | | | | necessary anymore. llvm-svn: 259355
* clang-format: Fix incorrect pointer detection in lambdas in constructorDaniel Jasper2016-02-011-2/+2
| | | | | | | | | | | | initializers. Before: Constructor() : member([](A *a, B * b) {}) {} After: Constructor() : member([](A *a, B *b) {}) {} llvm-svn: 259353
* clang-format: Add option to disable string literal formatting.Daniel Jasper2016-02-012-2/+7
| | | | llvm-svn: 259352
* clang-format: Fix alignment of trailing multiline columns.Daniel Jasper2016-02-011-10/+14
| | | | llvm-svn: 259351
* clang-format: [JS] Treat "in" as a proper operator.Daniel Jasper2016-02-011-0/+10
| | | | llvm-svn: 259350
* 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-312-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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-301-4/+0
| | | | 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-301-8/+29
| | | | | | | | | -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-301-4/+5
| | | | | | 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
* 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-291-1/+37
| | | | | | | | | | | | | | 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-291-5/+16
| | | | | | | | | | 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-291-4/+21
| | | | | | | | | | | 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
* 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-291-0/+4
| | | | | | rdar://23891898 llvm-svn: 259226
* Class Property: parse @dynamic (class).Manman Ren2016-01-291-0/+26
| | | | | | rdar://23891898 llvm-svn: 259224
* [analyzer] Suppress null reports from defensive checks in function-like macros.Devin Coughlin2016-01-291-1/+26
| | | | | | | | | 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
OpenPOWER on IntegriCloud