summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Do not reset TUScope when we are in incremental processing mode.Vassil Vassilev2016-10-171-2/+4
| | | | | | | | Patch by Axel Naumann! Reviewed by Richard Smith and me. llvm-svn: 284372
* AST: Prefer LLVM_NODISCARD to LLVM_ATTRIBUTE_UNUSED_RESULTJustin Bogner2016-10-171-1/+1
| | | | llvm-svn: 284366
* [CUDA] Fix false-positive in known-emitted handling.Justin Lebar2016-10-171-6/+22
| | | | | | | | | | | | | | | | | Previously: When compiling for host, our constructed call graph went *through* kernel calls. This meant that if we had host calls kernel calls HD we would incorrectly mark the HD function as known-emitted on the host side, and thus perform host-side checks on it. Fixing this exposed another issue, wherein when marking a function as known-emitted, we also need to traverse the callgraph of its template, because non-dependent calls are attached to a function's template, not its instantiation. llvm-svn: 284355
* Revert "Revert "[analyzer] Make MallocChecker more robust against custom ↵Devin Coughlin2016-10-161-0/+4
| | | | | | | | | redeclarations"" This reverts commit r284340 to reapply r284335. The bot breakage was due to an unrelated change in the polybench test suite. llvm-svn: 284351
* AST: Improve a couple of comments and cast unused values to voidJustin Bogner2016-10-161-5/+4
| | | | | | | | Make these comments a bit more explicit that they're initializing the RawText member, and explicitly cast the unused result of getRawText to void for clarity. llvm-svn: 284341
* Revert "[analyzer] Make MallocChecker more robust against custom redeclarations"Devin Coughlin2016-10-161-4/+0
| | | | | | | | | | This reverts commit r284335. It appears to be causing test-suite compile-time and execution-time performance measurements to take longer than expected on several bots. This is surprising, because r284335 is a static-analyzer-only change. llvm-svn: 284340
* P0012R1: Make exception specifications be part of the type system. ThisRichard Smith2016-10-1610-46/+180
| | | | | | | implements the bulk of the change (modifying the type system to include exception specifications), but not all the details just yet. llvm-svn: 284337
* [analyzer] Make MallocChecker more robust against custom redeclarationsDevin Coughlin2016-10-161-0/+4
| | | | | | | | | | | | | Add additional checking to MallocChecker to avoid crashing when memory routines have unexpected numbers of arguments. You wouldn't expect to see much of this in normal code (-Wincompatible-library-redeclaration warns on this), but, for example, CMake tests can generate these. This is PR30616. rdar://problem/28631974 llvm-svn: 284335
* Revert "[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker""Devin Coughlin2016-10-161-35/+3
| | | | | | | | | | | | Revert: r283662: [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker" r283660: [analyzer] Fix build error after r283660 - remove constexpr strings. It was causing an internal build bot to fail. It looks like in some cases adding an extra note can cause scan-build plist output to drop a diagnostic altogether. llvm-svn: 284317
* [Coverage] Support for C++17 if initializersVedant Kumar2016-10-142-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D25572 llvm-svn: 284293
* [Coverage] Support for C++17 switch initializersVedant Kumar2016-10-142-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D25539 llvm-svn: 284292
* Sema: honour dllexport in itanium more faithfullySaleem Abdulrasool2016-10-141-1/+2
| | | | | | | | | Although the itanium environment uses the itanium layout for C++, treat the dllexport semantics more similarly to the MSVC specification. This preserves the existing behaviour for the use of the itanium ABI on non-windows-itanium environments. Export the inline definitions too. llvm-svn: 284288
* Reinstate r284008 reverted in r284081, with two fixes:Richard Smith2016-10-147-71/+176
| | | | | | | | | | | | | | | | | | | 1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach the second case if it's the addition of the initializer itself that converts an existing declaration into a definition). 2) When rebuilding a redeclaration chain for a variable, if we merge two definitions together, mark the definitions as merged so the retained definition is made visible whenever the demoted definition would have been. Original commit message (from r283882): [modules] PR28752: Do not instantiate variable declarations which are not visible. Original patch by Vassil Vassilev! Changes listed above are mine. llvm-svn: 284284
* Define Contiki OS toolchainDavid L Kreitzer2016-10-143-0/+22
| | | | | | | | Patch by Michael LeMay Differential revision: http://reviews.llvm.org/D19854 llvm-svn: 284278
* Implement no_sanitize_address for global varsDouglas Katzman2016-10-142-11/+27
| | | | llvm-svn: 284272
* [Sema] Refactor context checking for availability diagnosticsErik Pilkington2016-10-143-111/+78
| | | | | | | | | This commit combines a couple of redundant functions that do availability attribute context checking into a more correct/simpler one. Differential revision: https://reviews.llvm.org/D25283 llvm-svn: 284265
* Module: emit initializers in submodules when importing the parent module.Manman Ren2016-10-142-3/+31
| | | | | | | | | When importing the parent module, module initializers in submodules should be emitted. rdar://28740482 llvm-svn: 284263
* Revert r284256 due to test failureEd Maste2016-10-141-4/+0
| | | | llvm-svn: 284259
* Link static PIE programs against rcrt0.o on OpenBSDEd Maste2016-10-141-0/+4
| | | | | | | | Patch by Stefan Kempf. Differential Revision: https://reviews.llvm.org/D22130 llvm-svn: 284256
* Implement __stosb intrinsic as a volatile memsetAlbert Gutowski2016-10-142-5/+5
| | | | | | | | | | | | Summary: We need `__stosb` to be an intrinsic, because SecureZeroMemory function uses it without including intrin.h. Implementing it as a volatile memset is not consistent with MSDN specification, but it gives us target-independent IR while keeping the most important properties of `__stosb`. Reviewers: rnk, hans, thakis, majnemer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25334 llvm-svn: 284253
* Fix for PR30632: Name mangling issue.Alexey Bataev2016-10-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in the implementation of captured statements. If it has a lambda expression in it and the same lambda expression is used outside the captured region, clang produced an error: ``` error: definition with same mangled name as another definition ``` Here is an example: ``` struct A { template <typename L> void g(const L&) { } }; template<typename T> void f() { { A().g([](){}); } A().g([](){}); } int main() { f<void>(); } ``` Error report: ``` main.cpp:3:10: error: definition with same mangled name as another definition void g(const L&) { } ^ main.cpp:3:10: note: previous definition is here ``` Patch fixes this bug. llvm-svn: 284229
* Removed duplicate header includeEric Liu2016-10-141-2/+1
| | | | | | | | | | | | Reviewers: ioeric Subscribers: klimek Patch by Krasimir Georgiev! Differential Revision: https://reviews.llvm.org/D25599 llvm-svn: 284228
* Deduplicate sets of replacements by file names.Eric Liu2016-10-142-9/+12
| | | | | | | | | | | | | | | Summary: If there are multiple <File, Replacements> pairs with the same file path after removing dots, we only keep one pair (with path after dots being removed) and discard the rest. Reviewers: djasper Subscribers: klimek, hokein, bkramer, cfe-commits Differential Revision: https://reviews.llvm.org/D25565 llvm-svn: 284219
* Fix bogus assert breaking modules self-host.Richard Smith2016-10-141-4/+6
| | | | llvm-svn: 284187
* Use SubstInitializer instead of SubstExpr when instantiating a defaultRichard Smith2016-10-141-1/+2
| | | | | | argument, in order to correctly instantiate the initializer. llvm-svn: 284184
* Reinstate r281429, reverted in r281452, with a fix for its mishandling ofRichard Smith2016-10-132-20/+61
| | | | | | | | | compiles without -fmodules-local-submodule-visibility. Original commit message: [modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition. llvm-svn: 284176
* Add 64-bit MS _Interlocked functions as builtins againAlbert Gutowski2016-10-132-164/+172
| | | | | | | | | | | | Summary: Previously global 64-bit versions of _Interlocked functions broke buildbots on i386, so now I'm adding them as builtins for x86-64 and ARM only (should they be also on AArch64? I had problems with testing it for AArch64, so I left it) Reviewers: hans, majnemer, mstorsjo, rnk Subscribers: cfe-commits, aemerson Differential Revision: https://reviews.llvm.org/D25576 llvm-svn: 284172
* [analyzer] Remove superquadratic behaviour from DataflowWorklistAlexander Shaposhnikov2016-10-131-18/+9
| | | | | | | | | | | | | | | | | The class DataflowWorklist internally maintains a sorted list of pointers to CFGBlock and the method enqueuePredecessors has to call sortWorklist to maintain the invariant. The implementation based on vector + sort works well for small sizes but gets infeasible for relatively large sizes. In particular the issue takes place for some cryptographic libraries which use code generation. The diff replaces vector + sort with priority queue. For one of the implementations of AES this patch reduces the time for analysis from 204 seconds to 8 seconds. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D25503 llvm-svn: 284166
* Add and use isDiscardableGVALinkage function.Justin Lebar2016-10-132-10/+3
| | | | | | | | | | Reviewers: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25571 llvm-svn: 284159
* [CUDA] Emit deferred diagnostics during Sema rather than during codegen.Justin Lebar2016-10-134-100/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Emitting deferred diagnostics during codegen was a hack. It did work, but usability was poor, both for us as compiler devs and for users. We don't codegen if there are any sema errors, so for users this meant that they wouldn't see deferred errors if there were any non-deferred errors. For devs, this meant that we had to carefully split up our tests so that when we tested deferred errors, we didn't emit any non-deferred errors. This change moves checking for deferred errors into Sema. See the big comment in SemaCUDA.cpp for an overview of the idea. This checking adds overhead to compilation, because we have to maintain a partial call graph. As a result, this change makes deferred errors a CUDA-only concept (whereas before they were a general concept). If anyone else wants to use this framework for something other than CUDA, we can generalize at that time. This patch makes the minimal set of test changes -- after this lands, I'll go back through and do a cleanup of the tests that we no longer have to split up. Reviewers: rnk Subscribers: cfe-commits, rsmith, tra Differential Revision: https://reviews.llvm.org/D25541 llvm-svn: 284158
* CodeGen: ensure that the runtime calling convention matchesSaleem Abdulrasool2016-10-131-12/+8
| | | | | | | | Incorrect specification of the calling convention results in UB which can cause the code path to be eliminated. Simplify the existing code by using the RuntimeCall constructor in `CodeGenFunction`. llvm-svn: 284154
* Swift Calling Convention: Fix out of bounds accessArnold Schwaighofer2016-10-131-1/+1
| | | | | | | | | | Use iterator instead of address of element in vector It is not valid to access one after the last element. rdar://28759508 llvm-svn: 284150
* [CUDA] Allow static variables in __host__ __device__ functions, so long as ↵Justin Lebar2016-10-131-6/+5
| | | | | | | | | | | | they're never codegen'ed for device. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25150 llvm-svn: 284145
* [CUDA] Disallow __shared__ variables in host functions.Justin Lebar2016-10-131-0/+4
| | | | | | | | | | Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25143 llvm-svn: 284144
* [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIf{Device,Host}Code().Justin Lebar2016-10-134-76/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Together these let you easily create diagnostics that - are never emitted for host code - are always emitted for __device__ and __global__ functions, and - are emitted for __host__ __device__ functions iff these functions are codegen'ed. At the moment there are only three diagnostics that need this treatment, but I have more to add, and it's not sustainable to write code for emitting every such diagnostic twice, and from a special wrapper in SemaCUDA.cpp. While we're at it, don't emit the function name in err_cuda_device_exceptions: It's not necessary to print it, and making this work in the new framework in the face of a null value for dyn_cast<FunctionDecl>(CurContext) isn't worth the effort. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25139 llvm-svn: 284143
* Module: emit initializers for C/ObjC after r276159.Manman Ren2016-10-131-1/+7
| | | | | | | | | In r276159, we started to defer emitting initializers for VarDecls, but forgot to add the initializers for non-C++ language. rdar://28740482 llvm-svn: 284142
* Pass -ffunction-sections/-fdata-sections along to gold-pluginTeresa Johnson2016-10-131-5/+22
| | | | | | | | | | | | | | Summary: These options need to be passed to the plugin in order to have an effect on LTO/ThinLTO compiles. Reviewers: mehdi_amini, pcc Subscribers: jfb, dschuff, mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D24644 llvm-svn: 284140
* Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsicsAlbert Gutowski2016-10-132-8/+8
| | | | | | | | | | Reviewers: rnk, thakis, majnemer, hans Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25540 llvm-svn: 284131
* Guard flag –fdenormal-fp-math with –fno-fast-math.Sjoerd Meijer2016-10-131-3/+10
| | | | | | | | This allows disabling the FP options with just one flag (-fno-fast-math). Differential Revision: https://reviews.llvm.org/D25479 llvm-svn: 284121
* [analyzer] Link libStaticAnalyzerCheckers to libASTMatchers.Artem Dergachev2016-10-131-0/+1
| | | | | | | | | | | | | AST matchers are useful for the analyzer's checkers. More patches on particular checkers shall follow. This is the first time clang binary gets linked to ASTMatchers. The binary size increase for the clang executable would be +0.5% in release mode, +2% in debug mode. Differential Revision: https://reviews.llvm.org/D25429 llvm-svn: 284112
* Fix for PR30639: CGDebugInfo Null dereference with OpenMP arrayAlexey Bataev2016-10-131-4/+17
| | | | | | | | | | | | | access, by Erich Keane OpenMP creates a variable array type with a a null size-expr. The Debug generation failed to due to this. This patch corrects the openmp implementation, updates the tests, and adds a new one for this condition. Differential Revision: https://reviews.llvm.org/D25373 llvm-svn: 284110
* [analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOSDevin Coughlin2016-10-121-0/+31
| | | | | | | | | | | | | | | | On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code for an IBOutlet is documented as directly setting the backing ivar without retaining the value -- even if the property is 'retain'. This resulted in false positives from the DeallocChecker for code that did not release such ivars in -dealloc. To avoid these false positives, treat IBOutlet ivars that back a property without a setter as having an unknown release requirement in macOS. rdar://problem/28507353 llvm-svn: 284084
* Revert r284008. This is us to fail to instantiate static data members in someRichard Smith2016-10-127-153/+35
| | | | | | cases. I'm working on reducing a testcase. llvm-svn: 284081
* [NFC] Fixing the description for _mm_store_ps and _mm_store_ps1.Yunzhong Gao2016-10-121-15/+15
| | | | | | | It seems that the doxygen description of these two intrinsics were swapped by mistake. llvm-svn: 284080
* Implement MS _BitScan intrinsicsAlbert Gutowski2016-10-124-28/+82
| | | | | | | | | | | | Summary: _BitScan intrinsics (and some others, for example _Interlocked and _bittest) are supposed to work on both ARM and x86. This is an attempt to isolate them, avoiding repeating their code or writing separate function for each builtin. Reviewers: hans, thakis, rnk, majnemer Subscribers: RKSimon, cfe-commits, aemerson Differential Revision: https://reviews.llvm.org/D25264 llvm-svn: 284060
* [NFC] Trial change to remove a redundant blank line.Yunzhong Gao2016-10-121-1/+0
| | | | llvm-svn: 284033
* Declare WinX86_64ABIInfo to satisfy SwiftABI infoArnold Schwaighofer2016-10-122-2/+9
| | | | | | | | | This is minimal support that allows swift's test cases on non windows platforms to pass. rdar://28738985 llvm-svn: 284032
* Move x86-64 builtins from SemaChecking.cpp to BuiltinsX86_64.defAlbert Gutowski2016-10-122-58/+2
| | | | | | | | | | | | Summary: Follow-up to https://reviews.llvm.org/D24598 (separating builtins for x84-64 and i386). Reviewers: hans, thakis, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25494 llvm-svn: 284026
* Reinstate r283887 and r283882.Vassil Vassilev2016-10-127-35/+153
| | | | | | | | | | | Original message: "[modules] PR28752: Do not instantiate variable declarations which are not visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith!" llvm-svn: 284008
* [CodeCompletion] Show protocol properties that are accessed through qualified idAlex Lorenz2016-10-121-11/+12
| | | | | | | | | | | | This commit improves code completion for properties that are declared in Objective-C protocols by making sure that properties show up in completions when they are accessed through a qualified id. rdar://24426041 Differential Revision: https://reviews.llvm.org/D25436 llvm-svn: 284007
OpenPOWER on IntegriCloud