summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis2017-04-217-45/+207
| | | | | | | | | purposes - Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing llvm-svn: 300949
* [index] For 'transparent' tag typedefs, ignore their tag referenceArgyrios Kyrtzidis2017-04-212-3/+5
| | | | llvm-svn: 300948
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-216-40/+80
| | | | | | | | | | | | | | | merged template. When looking for the template instantiation pattern of a templated entity, consistently select the definition of the pattern if there is one. This means we'll pick the same owning module when we start instantiating a template that we'll later pick when determining which modules are visible during that instantiation. This reinstates r300650, reverted in r300659, with a fix for a regression reported by Chandler after commit. llvm-svn: 300938
* [analyzer] Fix assert in ExprEngine::processSwitchAlexander Shaposhnikov2017-04-212-2/+15
| | | | | | | | | | | | | | | This diff replaces getTypeSize(CondE->getType())) with getIntWidth(CondE->getType())) in ExprEngine::processSwitch. These calls are not equivalent for bool, see ASTContext.cpp Add a test case. Test plan: make check-clang-analysis make check-clang Differential revision: https://reviews.llvm.org/D32328 llvm-svn: 300936
* Use __CLANG_ATOMIC_TYPE_LOCK_FREE macros in `stdatomic.h`Eric Fiselier2017-04-202-10/+11
| | | | | | | | | | | | | | Summary: This patch makes the header `stdatomic.h` work when `-fms-compatibility` is specified. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32322 llvm-svn: 300919
* [CMake] Enable ARM target in Fuchsia toolchainPetr Hosek2017-04-201-1/+3
| | | | | | | | | This is still used by some users of Fuchsia toolchain. Also include llc and opt which is useful for development and testing. Differential Revision: https://reviews.llvm.org/D32231 llvm-svn: 300917
* Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.Eric Fiselier2017-04-203-7/+75
| | | | | | | | | | | | | | | | | Summary: Libc++ currently implements the `ATOMIC_<TYPE>_LOCK_FREE` macros using the `__GCC_ATOMIC_<TYPE>_LOCK_FREE` macros. However these are not available when MSVC compatibility is enabled even though C11 `_Atomic` is. This prevents libc++ from correctly implementing `ATOMIC_<TYPE>_LOCK_FREE`. This patch adds an alternative spelling `__CLANG_ATOMIC_<TYPE>_LOCK_FREE` that is enabled with `-fms-compatibility`. Reviewers: rsmith, aaron.ballman, majnemer, zturner, compnerd, jfb, rnk Reviewed By: rsmith Subscribers: BillyONeal, smeenai, jfb, cfe-commits, dschuff Differential Revision: https://reviews.llvm.org/D32265 llvm-svn: 300914
* Sema: protect against ObjC++ typo-correction failureSaleem Abdulrasool2017-04-202-0/+12
| | | | | | | | | ObjC++ has two different types of "pointer" types (ObjCClassPointerType and PointerType). Both can be indirected through. However, the former is not a member expression. Ensure that we do not try to rebuild the MRE in that case. llvm-svn: 300909
* Parse: cleanup some bleeding whitespaceSaleem Abdulrasool2017-04-201-2/+3
| | | | | | Clean up some bleeding whitespace that I noticed. NFC llvm-svn: 300908
* Fix Python 2 vs 3 incompatability with dict.items() vs iteritems()Eric Fiselier2017-04-201-1/+6
| | | | llvm-svn: 300895
* Enable leak sanitizer builds for darwinFrancis Ricci2017-04-203-0/+33
| | | | | | | | | | | | | | Summary: Support for leak sanitizer on darwin has been added to compiler-rt, this patch adds compiler support. Reviewers: dexonsmith, compnerd Subscribers: alekseyshl, kubamracek, cfe-commits Differential Revision: https://reviews.llvm.org/D32192 llvm-svn: 300894
* Begin making git-clang-format python3 compatible.Eric Fiselier2017-04-201-21/+25
| | | | | | | | | | | | | | | | | | | | | | This patch fixes most of the python3 incompatabilities within git-clang-format while keeping the script python2 compatible. There is still one remaining incompatability that prevents using Python3 which is the `str` vs `byte` type change. I plan to put those fixes up for review separately. This patch contains fixes for the following incompatabilities: 1) Use the new style Python3 `print` function. This requires importing __future__.print_function. 2) Fix incompatability between the Python3 octal prefix and the octal prefix Git uses. 3) Replace use of dict.iteritems() with dict.viewitems() because iteritems() has been removed in Python3. viewitems() reviews python 2.7 but that is also what the script is documented as requiring. llvm-svn: 300891
* [Driver] Add a missing -no-canonical-prefixes to test.Benjamin Kramer2017-04-201-1/+1
| | | | llvm-svn: 300873
* Don't pass FPOpFusion::Strict to the backendAdam Nemet2017-04-202-1/+21
| | | | | | | | | | | | | | | This restores the behavior prior to D31167 where the code-gen default was FPC_On which mapped to FPOpFusion::Standard. After merging the FE state (on/off) and the code-gen state (on/fast/off), the default became off to match the front-end. In other words, the front-end controls when to fuse along the language standards and the backend shouldn't override this by splitting fused intrinsics as FPOpFusion::Strict would imply. Differential Revision: https://reviews.llvm.org/D32301 llvm-svn: 300858
* Delete unused IncompleteFormat variable, NFCi.Krasimir Georgiev2017-04-201-3/+1
| | | | llvm-svn: 300841
* [index] Record class template specializations using a new 'SpecializationOf'Alex Lorenz2017-04-207-6/+42
| | | | | | | | | | relationship rdar://31603531 Differential Revision: https://reviews.llvm.org/D32010 llvm-svn: 300832
* Add Python 3 support to clang.cindexJonathan Coe2017-04-203-35/+92
| | | | | | | | | | | | | | | | | | | | | Summary: Introduce an interop string to convert from unicode to c-strings where needed. Add missing conversions from _CXString to strings in function registrations. Explicitly evaluate lists where Python 3's lazy iterators would not otherwise do so. This is an improvement upon the reverted change proposed in https://reviews.llvm.org/D26082 Reviewers: compnerd, skalinichev, modocache, MathieuDuponchelle Reviewed By: compnerd Subscribers: cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D31568 llvm-svn: 300829
* Add #pragma clang attribute support to the availability attributeAlex Lorenz2017-04-205-9/+8
| | | | | | rdar://31707804 llvm-svn: 300826
* PR19260: Teach doxygen to spell correctly the include paths.Vassil Vassilev2017-04-201-4/+4
| | | | | | | | | | Currently we have #include <Sema.h> in the doxygen page documenting Sema. The patch changes it ot #include "clang/Sema/Sema.h" which is what we would spell if we need to include it in a real codebase. Patch by Yuka Takahashi (D32113)! llvm-svn: 300825
* [AVR] Add -mmcu option to the driverLeslie Zhai2017-04-203-0/+12
| | | | | | | | | | | | | | A patch by Peter Wu! Reviewers: jroelofs, xiangzhai Reviewed By: jroelofs, dylanmckay, xiangzhai Subscribers: dlj, dylanmckay, cfe-commits Differential Revision: https://reviews.llvm.org/D29827 llvm-svn: 300818
* [ODRHash] clean up test and add new examples. NFCRichard Trieu2017-04-201-124/+67
| | | | | | | | | Use a macro to generate the struct with all decls. Previously, four identical changes would be needed to update this test. This macro reduces that to one location. Added two other tests for issues that triggered false positives during testing. llvm-svn: 300814
* PR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes ↵Richard Smith2017-04-203-6/+56
| | | | | | | | | when forming implicit deduction guides. Doing so thwarts template type deduction. Instead, substitute the pack directly by picking "slice 0" of the resulting expansion. llvm-svn: 300805
* [Sema] Use MSVC inner class behavior on ItaniumShoaib Meenai2017-04-202-3/+29
| | | | | | | | | | | | | | Windows Itanium aims to use MSVC export and import semantics. Inner class members shouldn't be exported on a dllexport explicit instantiation definition of the outer class, and they shouldn't be imported on a dllimport explicit instantiation declaration of the outer class (instead a local copy should be emitted). We were doing the first but not the second, and this mismatch can lead to link errors. Fix the behavior and add tests for both. Differential Revision: https://reviews.llvm.org/D32213 llvm-svn: 300804
* Add a triple to codegen test.Richard Smith2017-04-201-1/+1
| | | | llvm-svn: 300803
* [OpenMP] Prepare sema to support combined constructs with omp distribute and ↵Carlo Bertolli2017-04-208-112/+442
| | | | | | | | | | omp for https://reviews.llvm.org/D32237 This patch prepares sema with additional fields to support all those composite and combined constructs of OpenMP that include pragma 'distribute' and 'for', such as 'distribute parallel for'. It also extends the regression tests for 'distribute parallel for' and adds a new one. llvm-svn: 300802
* [sanitizer-coverage] trim down the docsKostya Serebryany2017-04-191-170/+0
| | | | llvm-svn: 300776
* [sanitizer-coverage] deprecate -fsanitize-coverage=trace-bbKostya Serebryany2017-04-192-8/+8
| | | | llvm-svn: 300767
* Corrrect warn_unused_result attribute Erich Keane2017-04-193-7/+48
| | | | | | | | | | | | The original idea was that if the attribute on an operator, that the return-value unused-ness wouldn't matter. However, all of the operators except postfix inc/dec return references! References don't result in this warning anyway, so those are already excluded. Differential Revision: https://reviews.llvm.org/D32207 llvm-svn: 300764
* Fix assertion failure in codegen on non-template deduction guide.Richard Smith2017-04-192-0/+25
| | | | llvm-svn: 300762
* [CodeGen] Use preincrement version of APInt::operator++ instead of ↵Craig Topper2017-04-191-1/+1
| | | | | | | | postincrement to avoid creating and immediately discarding a temporary APInt. This is preparation for a clang change to improve the [[nodiscard]] warning to not be ignored on methods that return a class marked [[nodiscard]] that are defined in the class itself. See D32207. llvm-svn: 300756
* Fix a leak in tools/driver/cc1as_main.cppKostya Serebryany2017-04-191-2/+2
| | | | | | | | | | | | | | Summary: For some reason, the asan bot has recently started reporting this leak even though it existed for ages. Reviewers: pcc Reviewed By: pcc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32243 llvm-svn: 300755
* [sanitizer-coverage] deprecate -fsanitize-coverage=8bit-countersKostya Serebryany2017-04-192-8/+6
| | | | llvm-svn: 300744
* Parse backend options during thinlto backend compile actionsDavid Blaikie2017-04-192-6/+18
| | | | llvm-svn: 300741
* [sanitizer-coverage] deprecate some of the stale coverage variantsKostya Serebryany2017-04-193-58/+7
| | | | llvm-svn: 300738
* [Coverage] Don't emit mappings for functions in dependent contexts (fixes ↵Vedant Kumar2017-04-192-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR32679) The coverage implementation marks functions which won't be emitted as 'deferred', so that it can emit empty coverage regions for them later (once their linkages are known). Functions in dependent contexts are an exception: if there isn't a full instantiation of a function, it shouldn't be marked 'deferred'. We've been breaking that rule without much consequence because we just ended up with useless, extra, empty coverage mappings. With PR32679, this behavior finally caused a crash, because clang marked a partial template specialization as 'deferred', causing the MS mangler to choke in its delayed-template-parsing mode: error: cannot mangle this template type parameter type yet (http://bugs.llvm.org/show_bug.cgi?id=32679) Fix this by checking if a decl's context is a dependent context before marking it 'deferred'. Based on a patch by Adam Folwarczny! Differential Revision: https://reviews.llvm.org/D32144 llvm-svn: 300723
* [Sema][ObjC] Disallow jumping into ObjC fast enumeration loops.Akira Hatanaka2017-04-194-0/+36
| | | | | | | | rdar://problem/31635406 Differential Revision: https://reviews.llvm.org/D32187 llvm-svn: 300722
* Prefer addAttr(Attribute::AttrKind) over the AttributeList overloadReid Kleckner2017-04-192-17/+7
| | | | | | | | This should simplify the call sites, which typically want to tweak one attribute at a time. It should also avoid creating ephemeral AttributeLists that live forever. llvm-svn: 300718
* Add #pragma clang attribute support to the external_source_symbol attributeAlex Lorenz2017-04-195-43/+136
| | | | | | | | | | | | | | | | | | | Prior to this commit the external_source_symbol attribute wasn't supported by #pragma clang attribute for the following two reasons: - The Named attribute subject hasn't been supported by TableGen. - There was no way to specify a subject match rule for #pragma clang attribute that could operate on a set of attribute subjects (e.g. the ones that derive from NamedDecl). This commit fixes the two issues and thus adds external_source_symbol support to #pragma clang attribute. rdar://31169028 Differential Revision: https://reviews.llvm.org/D32176 llvm-svn: 300712
* Remove unnecessary condition as suggested by clang-tidy. NFCGabor Horvath2017-04-191-4/+2
| | | | | | | | Patch by: Gergely Angeli! Differential Revision: https://reviews.llvm.org/D31938 llvm-svn: 300703
* [Driver] Unify linking of OpenMP runtime. NFCI.Jonas Hahnfeld2017-04-194-38/+33
| | | | | | | | While at it, extend test for FreeBSD and check for -lrt iff on Linux. Differential Revision: https://reviews.llvm.org/D30087 llvm-svn: 300689
* Avoid assert when a non-static member function is qualified with __unalignedRoger Ferrer Ibanez2017-04-192-1/+23
| | | | | | | | | | | | | | | Under -fms-extensions __unaligned is a type-qualifier that can be applied to a non-static member function declaration. This causes an assertion when mangling the name under Itanium, where that qualifier is not mangled. This patch justs makes the minimal change to avoid the crash and avoid mangling __unaligned, as it currently happens with non-member functions. Differential Revision: https://reviews.llvm.org/D31976 llvm-svn: 300686
* Add support for editor placeholders to ClangAlex Lorenz2017-04-1916-5/+172
| | | | | | | | | | | | | | | | | | | | | This commit teaches Clang to recognize editor placeholders that are produced when an IDE like Xcode inserts a code-completion result that includes a placeholder. Now when the lexer sees a placeholder token, it emits an 'editor placeholder in source file' error and creates an identifier token that represents the placeholder. The parser/sema can now recognize the placeholders and can suppress the diagnostics related to the placeholders. This ensures that live issues in an IDE like Xcode won't get spurious diagnostics related to placeholders. This commit also adds a new compiler option named '-fallow-editor-placeholders' that silences the 'editor placeholder in source file' error. This is useful for an IDE like Xcode as we don't want to display those errors in live issues. rdar://31581400 Differential Revision: https://reviews.llvm.org/D32081 llvm-svn: 300667
* clang-format: Properly match parens of macro parameter lists.Daniel Jasper2017-04-191-3/+4
| | | | | | | No tests yet, but this will be tested by the upcoming: https://reviews.llvm.org/D28462 llvm-svn: 300661
* Revert r300653 and r300650. The underlying commit fixes one issue withChandler Carruth2017-04-195-67/+46
| | | | | | | | | | modules but exposes much more widespread issues. Example and more information is on the review thread for r300650. Original commit summary: [modules] Properly look up the owning module for an instantiation of a merged template. llvm-svn: 300659
* [CodeGen] Use APInt::lshrInPlace instead of APInt::lshr. NFCCraig Topper2017-04-191-3/+3
| | | | llvm-svn: 300658
* Fix member function call with null 'this' pointer.Richard Smith2017-04-191-3/+7
| | | | llvm-svn: 300653
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-195-44/+61
| | | | | | | | | | | | merged template. When looking for the template instantiation pattern of a templated entity, consistently select the definition of the pattern if there is one. This means we'll pick the same owning module when we start instantiating a template that we'll later pick when determining which modules are visible during that instantiation. llvm-svn: 300650
* Use less temporary AttributeLists NFCReid Kleckner2017-04-185-51/+33
| | | | llvm-svn: 300628
* [modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.Richard Smith2017-04-183-5/+19
| | | | | | | | | | | | | The driver needs to know whether it's building a module interface or implementation unit because it affects which outputs it produces and how it builds the command pipeline. But the frontend doesn't need to know and should not care: all it needs to know is what action it is being asked to perform on the input. (This is in preparation for permitting -emit-obj to be used on a module interface unit to produce object code without going via a "full" PCM file.) llvm-svn: 300611
* Do not warn about whitespace between ??/ trigraph and newline in line ↵Richard Smith2017-04-182-5/+12
| | | | | | comments if trigraphs are disabled in the current language. llvm-svn: 300609
OpenPOWER on IntegriCloud