summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* P0217R3: serialization/deserialization support for c++17 decomposition ↵Richard Smith2016-08-127-5/+81
| | | | | | declarations. llvm-svn: 278460
* Revert "[VFS] Skip non existent files from the VFS tree"Bruno Cardoso Lopes2016-08-127-88/+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-1211-38/+93
| | | | llvm-svn: 278458
* [VFS] Skip non existent files from the VFS treeBruno Cardoso Lopes2016-08-127-8/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-125-2/+34
| | | | | | | | | | | | | | | | | | 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-125-28/+10
| | | | llvm-svn: 278448
* P0217R3: Constant expression evaluation for decomposition declarations.Richard Smith2016-08-1210-17/+152
| | | | llvm-svn: 278447
* [Basic] Add const qualifier to SM.isInSystemMacro (NFC)Vedant Kumar2016-08-121-1/+1
| | | | | | | | | | | The member function is a predicate, and doesn't apply any changes on the object. Patch by Visoiu Mistrih Francis! Differential Revision: https://reviews.llvm.org/D23433 llvm-svn: 278444
* P0217R3: Perform semantic checks and initialization for the bindings in aRichard Smith2016-08-1126-239/+1416
| | | | | | | decomposition declaration for arrays, aggregate-like structs, tuple-like types, and (as an extension) for complex and vector types. llvm-svn: 278435
* Don't enable PIE on i686-unknown-cloudabi.Ed Schouten2016-08-115-11/+37
| | | | | | | | We're only going to provide support for using PIE on architectures that provide PC-relative addressing. i686 is not one of those, so add the necessary bits for only passing in -pie -zrelro conditionally. llvm-svn: 278395
* Pass in frame pointer omitting compiler flags for CloudABI as well.Ed Schouten2016-08-112-1/+10
| | | | | | | | | On Linux we pass in -fomit-frame-pointer flags (and similar) automatically if optimization is enabled. Let's do the same thing on CloudABI. Without this, Clang seems to run out of registers quite quickly while trying to build code with inline assembly. llvm-svn: 278393
* [analyzer] Teach RetainCountChecker about CVFooRetainDevin Coughlin2016-08-112-4/+26
| | | | | | | | | | | | Change the retain count checker to treat CoreFoundation-style "CV"-prefixed reference types from CoreVideo similarly to CoreGraphics types. With this change, we treat CVFooRetain() on a CVFooRef type as a retain. CVFooRelease() APIs are annotated as consuming their parameter, so this change prevents false positives about incorrect decrements of reference counts. <rdar://problem/27116090> llvm-svn: 278382
* [Sema] Add more strict check for sizeof diagnostics for bzeroBruno Cardoso Lopes2016-08-111-0/+7
| | | | | | | | | | Follow-up from r278264 after Joerg's feedback. Since bzero is not standard, be more strict: also check if the first argument is a pointer, which harden the check for when it does not come originally from a builtin. llvm-svn: 278379
* bindings: expose diagnostic formatting to PythonSaleem Abdulrasool2016-08-111-0/+33
| | | | | | | | | This makes it easier for tools using the Python libclang bindings to display diagnostics in a manner consistent with clang. Patch by Omar Sandoval! llvm-svn: 278315
* [Order Files] Don't use empty order filesChris Bieneman2016-08-111-2/+9
| | | | | | | | LD64 does optimization on symbol layouts that gets disabled whenever an order file is passed (even if it is empty). This change prevents disabling that optimization, and still enables iterative generation and usage of order files. If the order file is empty it does not setup the order file flags, instead it sets the empty order file as a configuration dependency. When the order file changes it will then trigger a re-configuration that adds the linker flag. llvm-svn: 278306
* Reapply [Sema] Add sizeof diagnostics for bzeroBruno Cardoso Lopes2016-08-103-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | | Reapply r277787. For memset (and others) we can get diagnostics like: struct stat { int x; }; void foo(struct stat *stamps) { bzero(stamps, sizeof(stamps)); memset(stamps, 0, sizeof(stamps)); } t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess] memset(stamps, 0, sizeof(stamps)); ~~~~~~ ^~~~~~ t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(stamps, 0, sizeof(stamps)); ^~~~~~ This patch implements the same class of warnings for bzero. Differential Revision: https://reviews.llvm.org/D22525 rdar://problem/18963514 llvm-svn: 278264
* [analyzer] Fix a crash in CloneDetector when calling functions by pointers.Artem Dergachev2016-08-102-2/+17
| | | | | | | | | | | CallExpr may have a null direct callee when the callee function is not known in compile-time. Do not try to take callee name in this case. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23320 llvm-svn: 278238
* [OpenCL] Fix typo in test that I accidentally introduced in my previous commit.Joey Gouly2016-08-101-1/+1
| | | | llvm-svn: 278235
* [OpenCL] Change block descriptor address space to constant.Joey Gouly2016-08-102-9/+17
| | | | | | | The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be in the private address space. llvm-svn: 278234
* [ASTMatchers] Extend documentation for match()Martin Bohme2016-08-101-0/+4
| | | | | | | Summary: Adds an explanation of how to use findAll() to find all matches in a subtree. llvm-svn: 278213
* [X86][AVX512] lower __mm512_andnot_ps/__mm512_andnot_pd to IRLama Saba2016-08-102-12/+6
| | | | | | | Differential revision: https://reviews.llvm.org/D23262 llvm-svn: 278209
* [X86][AVX] Ensure we only match against 1-byte alignmentSimon Pilgrim2016-08-101-2/+2
| | | | llvm-svn: 278208
* Make clang-format remove duplicate headers when sorting #includes.Eric Liu2016-08-104-35/+162
| | | | | | | | | | | | Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23274 llvm-svn: 278206
* [x86] Fix a really nasty bug introduced in r276417 where alignmentChandler Carruth2016-08-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | constraints were added to _mm256_broadcast_{pd,ps} intel intrinsics. The spec for these intrinics is ... pretty much silent on alignment. This is especially frustrating considering the amount of discussion of alignment in the load and store instrinsics. So I was forced to rely on the specification for the VBROADCASTF128 instruction. That instruction's spec is *also* completely silent on alignment. Fortunately, when it comes to the instruction's spec, silence is enough. There is no #GP fault option for an underaligned address so this instruction, and by inference the intrinsic, can read any alignment. As it happens, the old code worked exactly this way and in fact we have plenty of code that hands pointers with less than 16-byte alignment to these intrinsics. This code broke pretty spectacularly with this commit. Fortunately, the fix is super simple! Change a 16 to a 1, and ta da! Anyways, a lot of debugging for a really boring fix. =] llvm-svn: 278202
* [CUDA] Reject calls to __device__ functions from host variable global ↵Justin Lebar2016-08-103-28/+82
| | | | | | | | | | | | initializers. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23335 llvm-svn: 278196
* [CUDA] Print a "previous-decl" note when calling an illegal member fn.Justin Lebar2016-08-102-3/+4
| | | | | | | | | | | | | | | Summary: When we emit err_ref_bad_target, we should emit a "'method' declared here" note. We already do so in most places, just not in BuildCallToMemberFunction. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23240 llvm-svn: 278195
* [CUDA] Add __device__ overloads for placement new and delete.Justin Lebar2016-08-101-0/+18
| | | | | | | | | | | | | | | Summary: Previously these sort of worked because they didn't end up resulting in calls at the ptx layer. But I'm adding stricter checks that break placement new without these changes. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23239 llvm-svn: 278194
* [CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFCJustin Lebar2016-08-103-8/+12
| | | | | | | | | | | | | | Summary: I want to reuse "CheckCUDAFoo" in a later patch. Also, I think IsAllowedCUDACall gets the point across more clearly. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23238 llvm-svn: 278193
* [Diag] Fix idiom in comment: "on the lam", not "on the lamb".Justin Lebar2016-08-101-3/+3
| | | | llvm-svn: 278192
* [CUDA] Fix out-of-date comment.Justin Lebar2016-08-101-2/+1
| | | | | | | LangOpts.CUDADisableTargetCallChecks no longer exists (it's effectively always true now). llvm-svn: 278184
* [CUDA] Minor comment nits.Justin Lebar2016-08-101-2/+2
| | | | llvm-svn: 278183
* [ADT] Change iterator_adaptor_base's default template arguments to forward ↵Tim Shen2016-08-091-2/+3
| | | | | | | | | | | | | | | | | | | | | more underlying typedefs Summary: The corresponding LLVM change: D23217. LazyVector::iterator breaks, because int isn't an iterator type. Since iterator_adaptor_base shouldn't be blamed to break at the call to iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator. The perfect solution is to model "relative pointer", but it's beyond the goal of this patch. Reviewers: chandlerc, bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23218 llvm-svn: 278156
* [OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrtYaxun Liu2016-08-098-6/+36
| | | | | | | | Let the driver pass the option to frontend. Do not set precision metadata for division instructions when this option is set. Set function attribute "correctly-rounded-divide-sqrt-fp-math" based on this option. Differential Revision: https://reviews.llvm.org/D22940 llvm-svn: 278155
* [OpenCL][AMDGPU] Add support for -cl-denorms-are-zeroYaxun Liu2016-08-096-3/+46
| | | | | | | | | | | | Adjust target features for amdgcn target when -cl-denorms-are-zero is set. Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them. A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option. Differential Revision: https://reviews.llvm.org/D22815 llvm-svn: 278151
* Add a missing -no-canonical-prefixes.Benjamin Kramer2016-08-091-1/+1
| | | | llvm-svn: 278148
* [CUDA] Regression test to make sure C++ include path are forwarded to host ↵Samuel Antao2016-08-091-0/+10
| | | | | | | | | | | | | | and device frontends. Summary: Add test to detect the C++ include paths are passed to both CUDA host and device frontends. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22946 llvm-svn: 278140
* [clang-cl] Make -gline-tables-only imply -gcodeviewReid Kleckner2016-08-092-4/+9
| | | | | | | | | It's surprising that you have to pass /Z7 in addition to -gcodeview to get debug info. The sanitizer runtime, for example, expects that if the compiler supports the -gline-tables-only flag, then it will emit debug info. llvm-svn: 278139
* [ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()Martin Bohme2016-08-094-0/+106
| | | | | | | | | | | | Summary: Required for D22220 Reviewers: sbenza, klimek, aaron.ballman, alexfh Subscribers: alexfh, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D23004 llvm-svn: 278123
* clang-format: Add SpaceAfterTemplateSylvestre Ledru2016-08-095-2/+20
| | | | | | | | | | | | | | | | Summary: This is required for compliance with the Mozilla style guide. This is a rebase+minor change of Birunthan Mohanathas's patch Reviewers: djasper Subscribers: klimek, cfe-commits, opilarium Differential Revision: https://reviews.llvm.org/D23317 llvm-svn: 278121
* [analyzer] Try to fix coverity CID 1360469.Vassil Vassilev2016-08-091-1/+1
| | | | | | Patch by Raphael Isemann! llvm-svn: 278110
* Revert "[Attr] Add support for the `ms_hook_prologue` attribute."Charles Davis2016-08-087-74/+11
| | | | | | | This reverts commit r278050. It depends on r278048, which will be reverted. llvm-svn: 278052
* [Driver] Enable CFI for WebAssemblyDerek Schuff2016-08-081-1/+3
| | | | | | | | | | | Since CFI support has landed in the WebAssembly backend, enable it in the frontend driver. Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D23244 llvm-svn: 278051
* [Attr] Add support for the `ms_hook_prologue` attribute.Charles Davis2016-08-087-11/+74
| | | | | | | | | | | | | | | | | | | | | | | Summary: Based on a patch by Michael Mueller. This attribute specifies that a function can be hooked or patched. This mechanism was originally devised by Microsoft for hotpatching their binaries (which they're constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but it's now commonly abused by Windows programs that want to hook API functions. It is for this reason that this attribute was added to GCC--hence the name, `ms_hook_prologue`. Depends on D19908. Reviewers: rnk, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D19909 llvm-svn: 278050
* [analyzer] Change -analyze-function to accept qualified names.Artem Dergachev2016-08-085-49/+121
| | | | | | | | | | | | | | | Both -analyze-function and -analyzer-display-progress now share the same convention for naming functions, which allows discriminating between methods with the same name in different classes, C++ overloads, and also presents Objective-C instance and class methods in the convenient notation. This also allows looking up the name for the particular function you're trying to restrict analysis to in the -analyzer-display-progress output, in case it was not instantly obvious. Differential Revision: https://reviews.llvm.org/D22856 llvm-svn: 278018
* [ARM] Command-line options for embedded position-independent codeOliver Stannard2016-08-085-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (with the corresponding ARM backend patch) adds support for some new relocation models: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. * Read-write position independence (RWPI): Read-write data is accessed relative to a static base register. The offsets between all writeable data sections are known at static link time. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. These modes are intended for bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting the static base register to an appropriate value for RWPI code. There is one C construct not currently supported by these modes: global variables initialised to the address of another global variable or function, where that address is not known at static-link time. There are a few possible ways to solve this: * Disallow this, and require the user to write their own initialisation function if they need variables like this. * Emit dynamic initialisers for these variables in the compiler, called from the .init_array section (as is currently done for C++ dynamic initialisers). We have a patch to do this, described in my original RFC email (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the feedback from that RFC thread was that this is not something that belongs in clang. * Use a small dynamic loader to fix up these variables, by adding the difference between the load and execution address of the relevant section. This would require linker co-operation to generate a table of addresses that need fixing up. Differential Revision: https://reviews.llvm.org/D23196 llvm-svn: 278016
* [analyzer] Command line option to show enabled checker list.Gabor Horvath2016-08-089-6/+76
| | | | | | | | | | | | This patch adds a command line option to list the checkers that were enabled by analyzer-checker and not disabled by -analyzer-disable-checker. It can be very useful to debug long command lines when it is not immediately apparent which checkers are turned on and which checkers are turned off. Differential Revision: https://reviews.llvm.org/D23060 llvm-svn: 278006
* Fixes calculateRangesAfterReplacements crash when Replacements is empty.Eric Liu2016-08-082-0/+9
| | | | | | | | | | Reviewers: klimek, djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D23264 llvm-svn: 278004
* [analyzer] Model base to derived casts more precisely.Gabor Horvath2016-08-085-6/+46
| | | | | | | | | | | | | | Dynamic casts are handled relatively well by the static analyzer. BaseToDerived casts however are treated conservatively. This can cause some false positives with the NewDeleteLeaks checker. This patch alters the behavior of BaseToDerived casts. In case a dynamic cast would succeed use the same semantics. Otherwise fall back to the conservative approach. Differential Revision: https://reviews.llvm.org/D23014 llvm-svn: 277989
* Fix two bugs for musl-libc on ARMDiana Picus2016-08-082-2/+23
| | | | | | | | | | | | | | | Bug 1: triples like armv7-pc-linux-musl use the wrong linker name ld-musl-armv7.so.1; the right name should be ld-musl-arm.so.1, disregarding the subarch field. Bug 2: when compiler option -mhard-float is used, we should use the "hardfloat" linker, no matter whether the triple itself mentions "hardfloat". Patch by Lei Zhang! Differential Revision: https://reviews.llvm.org/D22904 llvm-svn: 277985
* Pass information in a record instead of stack. NFCSerge Pavlov2016-08-085-106/+105
| | | | | | | | | Functions of Sema that work with building of nested name specifiers have too many parameters (BuildCXXNestedNameSpecifier already expects 10 arguments). With this change the information about identifier and its context is packed into a structure, which is then passes to the semantic functions. llvm-svn: 277976
OpenPOWER on IntegriCloud