summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [CodeGen][ObjC] Fix infinite recursion in getObjCEncodingForTypeImpl.Akira Hatanaka2016-08-171-12/+14
| | | | | | | | | | Check that ExpandStructures is true before visiting the list of ivars. rdar://problem/27135221 Differential revision: https://reviews.llvm.org/D22929 llvm-svn: 278956
* Module debug info: Fix a bug in handling record decls without fields.Adrian Prantl2016-08-171-5/+8
| | | | | | | | | | | The previous condition would erroneously mark all CXXRecordDecls that didn't have any fields as being defined in a clang module. This patch fixes the condition to only apply to explicit template instantiations. <rdar://problem/27771823> llvm-svn: 278952
* Simplify condition. (NFC)Adrian Prantl2016-08-171-7/+8
| | | | llvm-svn: 278946
* Debug info: Mark noreturn functions with DIFlagNoReturn.Adrian Prantl2016-08-172-3/+10
| | | | | | | | | | | This affects functions with the C++11 [[ noreturn ]] and C11 _Noreturn specifiers. Patch by Victor Leschuk! https://reviews.llvm.org/D23168 llvm-svn: 278942
* [analyzer] Add a checker for loss of sign or precision in integral casts.Artem Dergachev2016-08-172-0/+193
| | | | | | | | | | | | | | | This new checker tries to find execution paths on which implicit integral casts cause definite loss of information: a certainly-negative integer is converted to an unsigned integer, or an integer is definitely truncated to fit into a smaller type. Being implicit, such casts are likely to produce unexpected results. Patch by Daniel Marjamäki! Differential Revision: https://reviews.llvm.org/D13126 llvm-svn: 278941
* [analyzer] Add LocationContext information to SymbolMetadata.Artem Dergachev2016-08-173-4/+7
| | | | | | | | | | | | | | | | | | | | | Like SymbolConjured, SymbolMetadata also needs to be uniquely identified by the moment of its birth. Such moments are coded by the (Statement, LocationContext, Block count) triples. Each such triple represents the moment of analyzing a statement with a certain call backtrace, with corresponding CFG block having been entered a given amount of times during analysis of the current code body. The LocationContext information was accidentally omitted for SymbolMetadata, which leads to reincarnation of SymbolMetadata upon re-entering a code body with a different backtrace; the new symbol is incorrectly unified with the old symbol, which leads to unsound assumptions. Patch by Alexey Sidorin! Differential Revision: https://reviews.llvm.org/D21978 llvm-svn: 278937
* Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().Martin Bohme2016-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: rL277342 made RecursiveASTVisitor visit lambda capture initialization expressions (these are the Exprs in LambdaExpr::capture_inits()). jdennett identified two issues with rL277342 (see comments there for details): - It visits initialization expressions for implicit lambda captures, even if shouldVisitImplicitCode() returns false. - It visits initialization expressions for init captures twice (because these were already traveresed in TraverseLambdaCapture() before rL277342) This patch fixes these issues and moves the code for traversing initialization expressions into TraverseLambdaCapture(). This patch also makes two changes required for the tests: - It adds Lang_CXX14 to the Language enum in TestVisitor. - It adds a parameter to ExpectedLocationVisitor::ExpectMatch() that specifies the number of times a match is expected to be seen. Reviewers: klimek, jdennett, alexfh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23204 llvm-svn: 278933
* Add an AST matcher for external formal linkage.Aaron Ballman2016-08-171-0/+1
| | | | | | Patch by Visoiu Mistrih llvm-svn: 278926
* [ThinLTO] Adapt backend invocation to llvm API changes.Mehdi Amini2016-08-171-4/+18
| | | | | | | | | | Reviewers: tejohnson Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23579 llvm-svn: 278906
* CodeGen: Avoid dereferencing end() in ↵Duncan P. N. Exon Smith2016-08-171-3/+2
| | | | | | | | | | ScalarExprEmitter::EmitOverflowCheckedBinOp Use BB.getNextNode(), which returns nullptr on end(), instead of &*BB.getIterator(), which is UB on end(). CodeGenFunction::createBasicBlock expects nullptr in this case already. llvm-svn: 278898
* [PM] Update Clang for LLVM's r278896 which re-organized a header.Chandler Carruth2016-08-171-2/+3
| | | | | | (sorry this didn't get landed closer in time...) llvm-svn: 278897
* Some missing usage of TargetParser. NFC.Zijiao Ma2016-08-172-3/+6
| | | | llvm-svn: 278890
* Emit debug info for dynamic classes if they are imported from a DLL.Adrian McCarthy2016-08-161-1/+6
| | | | | | | | | | With -debug-info-kind=limited, we omit debug info for dynamic classes that live in other TUs. This reduces duplicate type information. When statically linked, the type information comes together. But if your binary has a class derived from a base in a DLL, the base class info is not available to the debugger. The decision is made in shouldOmitDefinition (CGDebugInfo.cpp). Per a suggestion from rnk, I've tweaked the decision so that we do include definitions for classes marked as DLL imports. This should be a relatively small number of classes, so we don't pay a large price for duplication of the type info, yet it should cover most cases on Windows. Essentially this makes debug info for DLLs independent, but we still assume that all TUs within the same DLL will be consistently built with (or without) debug info and the debugger will be able to search across the debug info within that scope to resolve any declarations into definitions, etc. llvm-svn: 278861
* [OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2Yaxun Liu2016-08-162-0/+192
| | | | | | Differential Revision: https://reviews.llvm.org/D23322 llvm-svn: 278851
* [ObjC] Warn on unguarded use of partial declarationErik Pilkington2016-08-167-16/+168
| | | | | | | | | | | | | | This commit adds a traversal of the AST after Sema of a function that diagnoses unguarded references to declarations that are partially available (based on availability attributes). This traversal is only done when we would otherwise emit -Wpartial-availability. This commit is part of a feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential revision: https://reviews.llvm.org/D23003 llvm-svn: 278826
* Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows ↵Reid Kleckner2016-08-163-18/+11
| | | | | | | | platforms" This reverts commit r278783. It breaks usage of _xgetbv on Windows. llvm-svn: 278814
* Left shifts of negative values are defined if -fwrapv is setJames Molloy2016-08-162-2/+3
| | | | | | | This means we shouldn't emit ubsan detection code or warn. Fixes PR25552. llvm-svn: 278786
* [X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platformsMarina Yatsina2016-08-163-11/+18
| | | | | | | | commit on behalf of guyblank Differential Revision: https://reviews.llvm.org/D21959 llvm-svn: 278783
* [CUDA] Fix "declared here" note on deferred wrong-side errors.Justin Lebar2016-08-161-5/+10
| | | | | | | Previously we weren't deferring these "declared here" notes, which is obviously wrong. llvm-svn: 278767
* PR28978: If we need overload resolution for the move constructor of anRichard Smith2016-08-161-0/+11
| | | | | | | | anonymous union member of a class, we need overload resolution for the move constructor of the class itself too; we can't rely on Sema to do the right thing for us for anonymous union types. llvm-svn: 278763
* [CUDA] Raise an error if a wrong-side call is codegen'ed.Justin Lebar2016-08-154-80/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some function calls in CUDA are allowed to appear in semantically-correct programs but are an error if they're ever codegen'ed. Specifically, a host+device function may call a host function, but it's an error if such a function is ever codegen'ed in device mode (and vice versa). Previously, clang made no attempt to catch these errors. For the most part, they would be caught by ptxas, and reported as "call to unknown function 'foo'". Now we catch these errors and report them the same as we report other illegal calls (e.g. a call from a host function to a device function). This has a small change in error-message behavior for calls that were previously disallowed (e.g. calls from a host to a device function). Previously, we'd catch disallowed calls fairly early, before doing additional semantic checking e.g. of the call's arguments. Now we catch these illegal calls at the very end of our semantic checks, so we'll only emit a "illegal CUDA call" error if the call is otherwise well-formed. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23242 llvm-svn: 278759
* Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.Manman Ren2016-08-151-3/+11
| | | | | | | | | | | | For the following example: typedef __attribute__((NSObject)) CGColorRef ColorAttrRef; @property (strong, nullable) ColorAttrRef color; The property type should be ObjC NSObject type and the compiler should not emit error: property with 'retain (or strong)' attribute must be of object type rdar://problem/27747154 llvm-svn: 278742
* Add the notion of deferred diagnostics.Justin Lebar2016-08-153-0/+55
| | | | | | | | | | | | | | | | | | | Summary: This patch lets you create diagnostics that are emitted if and only if a particular FunctionDecl is codegen'ed. This is necessary for CUDA, where some constructs -- e.g. calls from host+device functions to host functions when compiling for device -- are allowed to appear in semantically-correct programs, but only if they're never codegen'ed. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D23241 llvm-svn: 278735
* [CUDA] Include CUDA headers before anything else.Justin Lebar2016-08-151-4/+7
| | | | | | | | | | | | | | | Summary: There's no point to --cuda-path if we then go and include /usr/include first. And if you install the right packages, Ubuntu will install (very old) CUDA headers there. Reviewers: tra Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D23341 llvm-svn: 278734
* [CUDA] Fix CUDA install version parsing.Justin Lebar2016-08-151-2/+2
| | | | | | | | | | | | | | | | Summary: getAsInteger returns true on error. Oops. No test because the behavior at the moment is identical with or without this change. Reviewers: tra Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D23340 llvm-svn: 278733
* StaticAnalyzer: Report found fields order in PaddingCheckerSaleem Abdulrasool2016-08-151-22/+36
| | | | | | | | Report the found fields order in PaddingChecker. Patch by Alexander Shaposhnikov! llvm-svn: 278730
* [CodeGen] Ignore unnamed bitfields before handling vector fieldsDavid Majnemer2016-08-151-4/+5
| | | | | | | | | | | | We processed unnamed bitfields after our logic for non-vector field elements in records larger than 128 bits. The vector logic would determine that the bit-field disqualifies the record from occupying a register despite the unnamed bit-field not participating in the record size nor its alignment. N.B. This behavior matches GCC and ICC. llvm-svn: 278656
* [CodeGen] Correctly implement the AVX512 psABI rulesDavid Majnemer2016-08-151-7/+10
| | | | | | | | | | | | | | An __m512 vector type wrapped in a structure should be passed in a vector register. Our prior implementation was based on a draft version of the psABI. This fixes PR28975. N.B. The update to the ABI was made here: https://github.com/hjl-tools/x86-psABI/commit/30f9c9 llvm-svn: 278655
* Disable lambda-capture of decomposition declaration bindings for now, until CWGRichard Smith2016-08-151-15/+20
| | | | | | agrees on how they're supposed to work. llvm-svn: 278648
* P0217R3: code generation support for decomposition declarations.Richard Smith2016-08-157-17/+60
| | | | llvm-svn: 278642
* Explicitly generate a reference variable to hold the initializer for aRichard Smith2016-08-143-87/+72
| | | | | | | | tuple-like decomposition declaration. This significantly simplifies the semantics of BindingDecls for AST consumers (they can now always be evalated at the point of use). llvm-svn: 278640
* Fix build broken after llvm/ADT/DenseMap.h replacement of climits with limits.Eugene Zelenko2016-08-131-1/+6
| | | | llvm-svn: 278586
* [CUDA] Place GPU binary into .nv_fatbin section and align it by 8.Artem Belevich2016-08-121-1/+10
| | | | | | | | | This matches the way nvcc encapsulates GPU binaries into host object file. Now cuobjdump can deal with clang-compiled object files. Differential Revision: https://reviews.llvm.org/D23429 llvm-svn: 278549
* Reapply [VFS] Skip non existent files from the VFS treeBruno Cardoso Lopes2016-08-121-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply r278457 with test fixed to not abouse fs case sensitivity. When the VFS uses a YAML file, the real file path for a virtual file is described in the "external-contents" field. Example: ... { 'type': 'file', 'name': 'a.h', 'external-contents': '/a/b/c/a.h' } Currently, when parsing umbrella directories, we use vfs::recursive_directory_iterator to gather the header files to generate the equivalent modules for. If the external contents for a header does not exist, we currently are unable to build a module, since the VFS vfs::recursive_directory_iterator will fail when it finds an entry without a reliable real path. Since the YAML file could be prepared ahead of time and shared among different compiler invocations, an entry might not yet have a reliable path in 'external-contents', breaking the iteration. Give the VFS the capability to skip such entries whenever 'ignore-non-existent-contents' property is set in the YAML file. rdar://problem/27531549 llvm-svn: 278543
* CodeGen: Replace ThinLTO backend implementation with a client of LTO/Resolution.Teresa Johnson2016-08-122-33/+65
| | | | | | | | | | | | | | | | Summary: This changes clang to use the llvm::lto::thinBackend function instead of its own less comprehensive ThinLTO backend implementation. Patch by Peter Collingbourne Reviewers: tejohnson, mehdi_amini Subscribers: cfe-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D21545 llvm-svn: 278541
* [Driver] Set the default driver mode based on the executable.Zachary Turner2016-08-121-18/+26
| | | | | | | | | | | | | | | | | | Currently, if --driver-mode is not passed at all, it will default to GCC style driver. This is never an issue for clang because it manually constructs a --driver-mode option and passes it. However, we should still try to do as good as we can even if no --driver-mode is passed. LibTooling, for example, does not pass a --driver-mode option and while it could, it seems like we should still fallback to the best possible default we can. This is one of two steps necessary to get clang-tidy working on Windows. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D23454 llvm-svn: 278535
* Revert test commitAlexander Droste2016-08-121-1/+0
| | | | llvm-svn: 278534
* Test commit - first LLVM repo commitAlexander Droste2016-08-121-0/+1
| | | | llvm-svn: 278533
* [ASTMatchers] Add templateTypeParmDecl() to Registry.cppMartin Bohme2016-08-121-0/+1
| | | | | | | | | | | | | | Summary: This appears to have been forgotten when templateTypeParmDecl() was initially added. Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, klimek, aemerson, rengolin, samparker, cfe-commits Differential Revision: https://reviews.llvm.org/D23448 llvm-svn: 278507
* Fix Wdocumentation unknown parameter warningSimon Pilgrim2016-08-121-116/+114
| | | | llvm-svn: 278503
* Fix For pr28288 - Error message in shift of vector valuesAndrey Bokhanko2016-08-121-11/+5
| | | | | | | | | | This fixes an error in type checking of shift of vector values. Patch by Vladimir Yakovlev. Differential Revision: https://reviews.llvm.org/D21678 llvm-svn: 278501
* This patch implements PR#22821.Roger Ferrer Ibanez2016-08-124-1/+79
| | | | | | | | | | | | | | | | | | Taking the address of a packed member is dangerous since the reduced alignment of the pointee is lost. This can lead to memory alignment faults in some architectures if the pointer value is dereferenced. This change adds a new warning to clang emitted when taking the address of a packed member. A packed member is either a field/data member declared as attribute((packed)) or belonging to a struct/class declared as such. The associated flag is -Waddress-of-packed-member. Conversions (either implicit or via a valid casting) to pointer types with lower or equal alignment requirements (e.g. void* or char*) will silence the warning. Differential Revision: https://reviews.llvm.org/D20561 llvm-svn: 278483
* [Sema] Fix the wording of a comment. NFC.George Burgess IV2016-08-121-1/+1
| | | | llvm-svn: 278472
* [Sema] Fix a crash on variadic enable_if functions.George Burgess IV2016-08-121-1/+5
| | | | | | | | | | | | | Currently, when trying to evaluate an enable_if condition, we try to evaluate all arguments a user passes to a function. Given that we can't use variadic arguments from said condition anyway, not converting them is a reasonable thing to do. So, this patch makes us ignore any varargs when attempting to check an enable_if condition. We'd crash because, in order to convert an argument, we need its ParmVarDecl. Variadic arguments don't have ParmVarDecls. llvm-svn: 278471
* P0217R3: serialization/deserialization support for c++17 decomposition ↵Richard Smith2016-08-123-4/+42
| | | | | | declarations. llvm-svn: 278460
* Revert "[VFS] Skip non existent files from the VFS tree"Bruno Cardoso Lopes2016-08-121-26/+8
| | | | | | | | | Breaking bots: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/27281/ This reverts commit r278457. llvm-svn: 278459
* P0217R3: template instantiation support for decomposition declarations.Richard Smith2016-08-125-27/+46
| | | | llvm-svn: 278458
* [VFS] Skip non existent files from the VFS treeBruno Cardoso Lopes2016-08-121-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the VFS uses a YAML file, the real file path for a virtual file is described in the "external-contents" field. Example: ... { 'type': 'file', 'name': 'a.h', 'external-contents': '/a/b/c/a.h' } Currently, when parsing umbrella directories, we use vfs::recursive_directory_iterator to gather the header files to generate the equivalent modules for. If the external contents for a header does not exist, we currently are unable to build a module, since the VFS vfs::recursive_directory_iterator will fail when it finds an entry without a reliable real path. Since the YAML file could be prepared ahead of time and shared among different compiler invocations, an entry might not yet have a reliable path in 'external-contents', breaking the iteration. Give the VFS the capability to skip such entries whenever 'ignore-non-existent-contents' property is set in the YAML file. rdar://problem/27531549 llvm-svn: 278457
* [VFS] Add 'ignore-non-existent-contents' field to YAML filesBruno Cardoso Lopes2016-08-122-2/+28
| | | | | | | | | | | | | | | | | | Add 'ignore-non-existent-contents' to tell the VFS whether an invalid path obtained via 'external-contents' should cause iteration on the VFS to stop. If 'true', the VFS should ignore the entry and continue with the next. Allows YAML files to be shared across multiple compiler invocations regardless of prior existent paths in 'external-contents'. This global value is overridable on a per-file basis. This adds the parsing and write test part, but use by VFS comes next. Differential Revision: https://reviews.llvm.org/D23422 rdar://problem/27531549 llvm-svn: 278456
* Remove unused and undesirable reference from BindingDecl to DecompositionDecl.Richard Smith2016-08-124-17/+7
| | | | llvm-svn: 278448
OpenPOWER on IntegriCloud