summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* C++ Modules TS: support parsing the 'module' declaration (including extensionsRichard Smith2016-08-193-32/+153
| | | | | | | | from p0273r0 approved by EWG). We'll eventually need to handle this from the lexer as well, in order to disallow preprocessor directives preceding the module declaration and to support macro import. llvm-svn: 279196
* [analyzer] Weaken assertion in trackNullOrUndefValue()Devin Coughlin2016-08-191-1/+1
| | | | | | | | | | | | | | | | | We should ignore paren casts when making sure that the semantic expression in a PseudoObjectExpr for an ObjC getter is a message send. This has no other intended functionality change. Adding a test for this exposed an interesting issue in another test case that only manifests under ARC. trackNullOrUndefValue() is not properly suppressing for nil values that are the result of nil propagation from a nil receiver when the nil is returned from a function. I've added a FIXME for that missing suppression. rdar://problem/27290568 llvm-svn: 279181
* AMDGPU: Add clang builtin for ds_swizzle.Changpeng Fang2016-08-181-0/+3
| | | | | | | | | | | Summary: int __builtin_amdgcn_ds_swizzle (int a, int imm); while imm is a constant. Differential Revision: http://reviews.llvm.org/D23682 llvm-svn: 279165
* PR28794: Don't try to instantiate function templates which are not visible.Vassil Vassilev2016-08-183-69/+87
| | | | | | Reviewed by Richard Smith. llvm-svn: 279164
* C++ Modules TS: Add parsing support for module import declaration.Richard Smith2016-08-184-27/+55
| | | | llvm-svn: 279163
* CodeGen: Rename a variable to better fit LLVM style. NFCJustin Bogner2016-08-181-6/+6
| | | | llvm-svn: 279159
* CodeGen: use range based for loop, NFCSaleem Abdulrasool2016-08-181-3/+2
| | | | llvm-svn: 279154
* [CUDA] Improve handling of math functions.Justin Lebar2016-08-182-3/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A bunch of related changes here to our CUDA math headers. - The second arg to nexttoward is a double (well, technically, long double, but we don't have that), not a float. - Add a forward-declare of llround(float), which is defined in the CUDA headers. We need this for the same reason we need most of the other forward-declares: To prevent a constexpr function in our standard library from becoming host+device. - Add nexttowardf implementation. - Pull "foobarf" functions defined by the CUDA headers in the global namespace into namespace std. This lets you do e.g. std::sinf. - Add overloads for math functions accepting integer types. This lets you do e.g. std::sin(0) without having an ambiguity between the overload that takes a float and the one that takes a double. With these changes, we pass testcases derived from libc++ for cmath and math.h. We can check these testcases in to the test-suite once support for CUDA lands there. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23627 llvm-svn: 279140
* Revert [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-185-25/+9
| | | | | | due to regressions in test/CodeGen/exprs.c on certain platforms. llvm-svn: 279127
* Fix json compilation database syntax on non-Windows.Zachary Turner2016-08-181-4/+2
| | | | llvm-svn: 279122
* [OpenCL] AMDGCN: Fix size_t typeYaxun Liu2016-08-185-9/+25
| | | | | | | | Pointers of certain GPUs in AMDGCN target in private address space is 32 bit but pointers in other address spaces are 64 bit. size_t type should be defined as 64 bit for these GPUs so that it could hold pointers in all address spaces. Also fixed issues in pointer arithmetic codegen by using pointer specific intptr type. Differential Revision: https://reviews.llvm.org/D23361 llvm-svn: 279121
* Resubmit "[Tooling] Parse compilation database command lines on Windows."Zachary Turner2016-08-181-12/+42
| | | | | | | | | | | | | | | | | | This patch introduced the ability to decide at runtime whether to parse JSON compilation database command lines using Gnu syntax or Windows syntax. However, there were many existing unit tests written that hardcoded Gnu-specific paths. These tests were now failing because the auto-detection logic was choosing to parse them using Windows rules. This resubmission of the patch fixes this by introducing an enum which defines the syntax mode, which defaults to auto-detect, but for which the unit tests force Gnu style parsing. Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D23628 llvm-svn: 279120
* [MS] Silence -Wextern-init on const selectany variablesReid Kleckner2016-08-181-3/+10
| | | | | | | | | | | | In C, 'extern' is typically used to avoid tentative definitions when declaring variables in headers, but adding an intializer makes it a defintion. This is somewhat confusing, so GCC and Clang both warn on it. In C++, 'extern' is often used to give implictly static 'const' variables external linkage, so don't warn in that case. If selectany is present, this might be header code intended for C and C++ inclusion, so apply the C++ rules. llvm-svn: 279116
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-189-32/+113
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* [analyzer] Teach CloneDetector to find clones that look like copy-paste errors.Artem Dergachev2016-08-182-22/+193
| | | | | | | | | | | | | | | | | | | The original clone checker tries to find copy-pasted code that is exactly identical to the original code, up to minor details. As an example, if the copy-pasted code has all references to variable 'a' replaced with references to variable 'b', it is still considered to be an exact clone. The new check finds copy-pasted code in which exactly one variable seems out of place compared to the original code, which likely indicates a copy-paste error (a variable was forgotten to be renamed in one place). Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D23314 llvm-svn: 279056
* Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus2016-08-1813-323/+9
| | | | | | | | | | | | | | | | | This reverts commit r279003 as it breaks some of our buildbots (e.g. clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules). The error is in OpenMP/teams_distribute_simd_ast_print.cpp: clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>; KeyT = clang::Stmt*; ValueT = long unsigned int; KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>; BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed. llvm-svn: 279045
* revert [analyzer] Added valist related checkers.Gabor Horvath2016-08-182-374/+0
| | | | llvm-svn: 279043
* test commitGuy Blank2016-08-181-1/+1
| | | | llvm-svn: 279042
* [analyzer] Added valist related checkers.Gabor Horvath2016-08-182-0/+374
| | | | | | Differential Revision: https://reviews.llvm.org/D15227 llvm-svn: 279041
* [analyzer] Small cleanups when checkers retrieving statements from explodedGabor Horvath2016-08-186-50/+9
| | | | | | | | nodes. Differential Revision: https://reviews.llvm.org/D23550 llvm-svn: 279037
* PR28438: Update the information on an identifier with local definitions beforeRichard Smith2016-08-181-1/+6
| | | | | | | | trying to write out its macro graph, in case we imported a module that added another module macro between the most recent local definition and the end of the module. llvm-svn: 279024
* Print the module format in clang -module-file-info.Adrian Prantl2016-08-171-2/+7
| | | | llvm-svn: 279005
* Support object-file-wrapped modules in clang -module-file-info.Adrian Prantl2016-08-172-13/+25
| | | | | | rdar://problem/24504815 llvm-svn: 279004
* [OpenMP] Sema and parsing for 'teams distribute simd’ pragmaKelvin Li2016-08-1713-9/+323
| | | | | | | | | | This patch is to implement sema and parsing for 'teams distribute simd’ pragma. This patch is originated by Carlo Bertolli. Differential Revision: https://reviews.llvm.org/D23528 llvm-svn: 279003
* [Darwin] Stop linking libclang_rt.eprintf.aChris Bieneman2016-08-171-8/+13
| | | | | | | | | | | | | | | | | Summary: The eprintf library was added before the general OS X builtins library existed as a place to store one builtin function. Since we have for several years had an actual mandated builtin library for OS X > 10.5, we should just merge eprintf into the main library. This change will resolve PR28855. As a follow up I'll also patch compiler-rt to not generate the eprintf library anymore. Reviewers: ddunbar, bob.wilson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23531 llvm-svn: 278988
* PR18417: Increase -ftemplate-depth to the value 1024 recommended by the C++Richard Smith2016-08-171-1/+1
| | | | | | | | standard's Annex B. We now attempt to increase the process's stack rlimit to 8MiB on startup, which appears to be enough to allow this to work reliably. (And if it turns out not to be, we can investigate increasing it further.) llvm-svn: 278983
* Revert "[Tooling] Parse compilation database command lines on Windows."Zachary Turner2016-08-171-18/+0
| | | | | | | | | | This reverts commit 27a874790fc79f6391ad3703d7c790f51ac6ae1f. After the introduction of windows command line parsing, some unit tests began failing that expect to test gnu style command line quirks. The fix is mechanical but time consuming, so revert this for now. llvm-svn: 278976
* [OpenCL] AMDGPU: add support of cl_khr_subgroupsYaxun Liu2016-08-171-0/+1
| | | | | | | | Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D23573 llvm-svn: 278972
* [Tooling] Parse compilation database command lines on Windows.Zachary Turner2016-08-171-0/+18
| | | | | | | | | | | | | When a compilation database is used on Windows, the command lines cannot be parsed using the standard GNU style syntax. LLVM provides functions for parsing Windows style command lines, so use them where appropriate. After this patch, clang-tidy runs correctly on Windows. Reviewed by: alexfh Differential Revision: https://reviews.llvm.org/D23455 llvm-svn: 278964
* [GraphWriter] Change GraphWriter to use NodeRef in GraphTraitsTim Shen2016-08-171-0/+1
| | | | | | | | | | | | Summary: Corresponding LLVM patch: D23580 Reviewers: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23581 llvm-svn: 278963
* [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
OpenPOWER on IntegriCloud