summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -Wunused-private-field to fire regardless of which implicit special ↵Richard Smith2017-11-012-2/+5
| | | | | | members have been implicitly declared. llvm-svn: 317076
* clang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]NAKAMURA Takumi2017-11-011-2/+2
| | | | llvm-svn: 317075
* Change assertion to quick exit from checking function.Richard Trieu2017-11-011-3/+2
| | | | | | | Remove the assertion that could be triggered by invalid code. Replace it with an early exit from the checking function. llvm-svn: 317073
* [analyzer] Removing unused stored field.George Karpenkov2017-11-011-1/+1
| | | | llvm-svn: 317070
* [X86] Define i586 and pentium preprocessor defines for -march=lakemont to ↵Craig Topper2017-11-011-0/+2
| | | | | | match GCC llvm-svn: 317069
* [c++17] Refine resolution of constructor / conversion function disambiguation.Richard Smith2017-11-011-14/+12
| | | | | | | | | | | | Given a choice between a constructor call and a conversion function in C++17, we prefer the constructor for direct-initialization and the conversion function for copy-initialization, matching the behavior in C++14 and before. The guaranteed copy elision rules were not intended to change the meaning of such code (other than by removing unnecessary copy constructor calls). This tweak will be raised with CWG. llvm-svn: 317066
* [Analyzer] Use value storage for BodyFarmGeorge Karpenkov2017-11-011-8/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D39428 llvm-svn: 317065
* [refactor][extract] code extracted from inline method should be placedAlex Lorenz2017-11-011-2/+7
| | | | | | in a function defined before the outer class llvm-svn: 317062
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-5/+14
| | | | llvm-svn: 317056
* [refactor][selection] code ranges can be selected in objc methodsAlex Lorenz2017-11-011-4/+7
| | | | llvm-svn: 317054
* Make helper function static. NFC.Benjamin Kramer2017-10-311-1/+1
| | | | llvm-svn: 317052
* Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.Wolfgang Pieb2017-10-311-1/+33
| | | | | | | | | The cloning happens before all metadata nodes are resolved. Prevent the value mapper from running into unresolved or temporary MD nodes. Differential Revision: https://reviews.llvm.org/D39396 llvm-svn: 317047
* [CFI] Add CFI-icall pointer type generalizationVlad Tsyrklevich2017-10-315-2/+81
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows generalizing pointers in type signatures used for cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag. This works by 1) emitting an additional generalized type signature metadata node for functions and 2) llvm.type.test()ing for the generalized type for translation units with the flag specified. This flag is incompatible with -fsanitize-cfi-cross-dso because it would require emitting twice as many type hashes which would increase artifact size. Reviewers: pcc, eugenis Reviewed By: pcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D39358 llvm-svn: 317044
* Fix usage of right shift operator in fold expressionsRichard Smith2017-10-311-3/+4
| | | | | | | | The right shift operator was not seen as a valid operator in a fold expression, which is PR32563. Patch by Nicolas Lesser ("Blitz Rakete")! llvm-svn: 317032
* [CodeGen] map sqrt libcalls to llvm.sqrt when errno is not setSanjay Patel2017-10-311-16/+13
| | | | | | | | | | | | | | | | | The LLVM sqrt intrinsic definition changed with: D28797 ...so we don't have to use any relaxed FP settings other than errno handling. This patch sidesteps a question raised in PR27435: https://bugs.llvm.org/show_bug.cgi?id=27435 Is a programmer using __builtin_sqrt() invoking the compiler's intrinsic definition of sqrt or the mathlib definition of sqrt? But we have an answer now: the builtin should match the behavior of the libm function including errno handling. Differential Revision: https://reviews.llvm.org/D39204 llvm-svn: 317031
* [CodeGen] Propagate may-alias'ness of lvalues with TBAA infoIvan A. Kosarev2017-10-3110-112/+173
| | | | | | | | | | | | | This patch fixes various places in clang to propagate may-alias TBAA access descriptors during construction of lvalues, thus eliminating the need for the LValueBaseInfo::MayAlias flag. This is part of D38126 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D39008 llvm-svn: 316988
* [refactor] select the entire DeclStmt if one ifs decls is selectedAlex Lorenz2017-10-311-5/+17
| | | | llvm-svn: 316971
* Typo correct the condition of 'do-while' before exiting its scopeAlex Lorenz2017-10-301-0/+3
| | | | | | rdar://35172419 llvm-svn: 316966
* [modules] Retain multiple using-directives in the same scope even if they ↵Richard Smith2017-10-302-11/+3
| | | | | | | | | | | | name the same namespace. They might have different visibility, and thus discarding all but one of them can result in rejecting valid code. Also fix name lookup to cope with multiple using-directives being found that denote the same namespace, where some are not visible -- don't cache an "already visited" state for a using-directive that we didn't visit because it was hidden. llvm-svn: 316965
* [analyzer] Use the same filename for the header and the implementation of ↵George Karpenkov2017-10-301-1/+1
| | | | | | | | BugReporterVisitor Differential Revision: https://reviews.llvm.org/D37935 llvm-svn: 316963
* [analyzer] Left shifting a negative value is undefinedGabor Horvath2017-10-302-0/+6
| | | | | | | | | | The analyzer did not return an UndefVal in case a negative value was left shifted. I also altered the UndefResultChecker to emit a clear warning in this case. Differential Revision: https://reviews.llvm.org/D39423 llvm-svn: 316924
* [clang-format] Handle CRLF correctly when formatting escaped newlinesKrasimir Georgiev2017-10-301-5/+13
| | | | | | | | | | Subscribers: klimek Differential Revision: https://reviews.llvm.org/D39420 Contributed by @peterbudai! llvm-svn: 316910
* CodeGen: Fix insertion position of addrspace cast for allocaYaxun Liu2017-10-301-1/+5
| | | | | | | | | | | | | | | | | | | | For non-zero alloca addr space, alloca is usually casted to default addr space immediately. For non-vla, alloca is inserted at AllocaInsertPt, therefore the addr space cast should also be insterted at AllocaInsertPt. However, for vla, alloca is inserted at the current insertion point of IRBuilder, therefore the addr space cast should also inserted at the current insertion point of IRBuilder. Currently clang always insert addr space cast at AllocaInsertPt, which causes invalid IR. This patch fixes that. Differential Revision: https://reviews.llvm.org/D39374 llvm-svn: 316909
* Keep MSVC2015 happy after r316903Krasimir Georgiev2017-10-301-2/+2
| | | | llvm-svn: 316906
* [clang-format] Format raw string literalsKrasimir Georgiev2017-10-3021-107/+482
| | | | | | | | | | | | | | | Summary: This patch adds raw string literal formatting. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, mgorny Differential Revision: https://reviews.llvm.org/D35943 llvm-svn: 316903
* [analyzer] Use the signature of the primary template for issue hash calculationGabor Horvath2017-10-301-0/+7
| | | | | | | | | | | | | Now when a template is instantiated more times and there is a bug found in the instantiations the issue hash will be different for each instantiation even if every other property of the bug (path, message, location) is the same. This patch aims to resolve this issue. Note that explicit specializations still generate different hashes but that is intended. Differential Revision: https://reviews.llvm.org/D38728 llvm-svn: 316900
* [analyzer] Make issue hash related tests more conciseGabor Horvath2017-10-302-35/+16
| | | | | | | | | | Extend ExprInspection checker to make it possible to dump the issue hash of arbitrary expressions. This change makes it possible to make issue hash related tests more concise and also makes debugging issue hash related problems easier. Differential Revision: https://reviews.llvm.org/D38844 llvm-svn: 316899
* [CodeGen] Generate TBAA info for reference loadsIvan A. Kosarev2017-10-305-58/+62
| | | | | | Differential Revision: https://reviews.llvm.org/D39177 llvm-svn: 316896
* [refactor] Fix a clang-tidy warning.Haojian Wu2017-10-301-1/+2
| | | | | | NFC llvm-svn: 316895
* [analyzer] lock_guard and unique_lock extension for BlockInCriticalSection ↵Gabor Horvath2017-10-301-11/+43
| | | | | | | | | | checker A patch by zdtorok (Zoltán Dániel Török)! Differential Revision: https://reviews.llvm.org/D33729 llvm-svn: 316892
* [analyzer] Handle ObjC messages conservatively in CallDescriptionGabor Horvath2017-10-301-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D37470 llvm-svn: 316885
* Driver: default to `unsigned int` `wchar_t` for ARMSaleem Abdulrasool2017-10-291-1/+6
| | | | | | | | | | AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an `unsigned int` rather than a `signed int`. Ensure that the driver does not flip the signedness of `wchar_t` for those targets. Add additional tests to ensure that this does not regress. llvm-svn: 316858
* [analyzer] MisusedMovedObjectChecker: More precise warning messagePeter Szecsi2017-10-281-9/+23
| | | | | | | | | | | | Added new enum in order to differentiate the warning messages on "misusing" into 3 categories: function calls, moving an object, copying an object. (At the moment the checker gives the same message in case of copying and moving.) Additional test cases added as well. Differential Revision: https://reviews.llvm.org/D38674 llvm-svn: 316852
* [analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, ↵Peter Szecsi2017-10-281-12/+15
| | | | | | | | | | | | | | | | | | | | handling method calls on base-class sub-objects An earlier solution from Artem r315301 solves the reset problem, however, the reports should be handled the same way in case of method calls. We should not just report the base class of the object where the method was defined but the whole object. Fixed false positive which came from not removing the subobjects in case of a state-resetting function. (Just replaced the State->remove(...) call to removeFromState(..) which was defined exactly for that purpose.) Some minor typos fixed in this patch as well which did not worth a whole new patch in my opinion, so included them here. Differential Revision: https://reviews.llvm.org/D31538 llvm-svn: 316850
* PR35039: Materialize temporary objects before wrapping them in anRichard Smith2017-10-281-0/+10
| | | | | | | | | OpaqueValueExpr in a GNU binary conditional expression. It's not meaningful for a non-materialized temporary object to be used as a common subexpression of multiple expressions. llvm-svn: 316836
* [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)Peter Szecsi2017-10-281-2/+9
| | | | | | | | | | | | | | | The loop unrolling feature aims to track the maximum possible steps a loop can make. In order to implement this, it investigates the initial value of the counter variable and the bound number. (It has to be known.) These numbers are used as llvm::APInts, however, it was not checked if their bitwidths are the same which lead to some crashes. This revision solves this problem by extending the "shorter" one (to the length of the "longer" one). For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943 Differential Revision: https://reviews.llvm.org/D38922 llvm-svn: 316830
* Basic: improve coverage for Darwin targets and fix ABISaleem Abdulrasool2017-10-281-4/+9
| | | | | | | | The existing coverage for the Darwin targets wasn't enough to catch all the variations. Improve the coverage a bit further and fix a few cases for Darwin targets. llvm-svn: 316826
* Never try to instantiate a deduction guide's "definition". Fixes bogus ↵Richard Smith2017-10-281-1/+2
| | | | | | warning when there inevitably isn't one. llvm-svn: 316820
* ARM: centralise SizeType, PtrDiffType, and IntPtrTypeSaleem Abdulrasool2017-10-271-31/+13
| | | | | | | | | Centralise the definitions of these compiler vended types to aid inspection to ensure that they are defined similarly. The one case that stands out is the Darwin case where the types do not match up. This fixes the API conformance for APCS-GNU as well. llvm-svn: 316810
* [MS] Allow access to ambiguous, inaccessible direct basesReid Kleckner2017-10-271-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang typically warns that in the following class hierarchy, 'A' is inaccessible because there is no series of casts that the user can write to access it unambiguously: struct A { }; struct B : A { }; struct C : A, B { }; MSVC allows the user to convert from C* to A*, though, and we've encountered this issue in the latest Windows SDK headers. This patch allows this conversion when -fms-compatibility is set and adds a warning for it under -Wmicrosoft-inaccessible-base. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39389 llvm-svn: 316807
* Replace a few usages of llvm::join with range-version[NFC]Erich Keane2017-10-271-3/+3
| | | | | | | | I noticed a few usages of llvm::join that were using begin/end rather than just the range version. This patch just replaces those. llvm-svn: 316784
* Filter out invalid 'target' items from being passed to LLVMErich Keane2017-10-273-4/+15
| | | | | | | | | | | | | | | | | Craig noticed that CodeGen wasn't properly ignoring the values sent to the target attribute. This patch ignores them. This patch also sets the 'default' for this checking to 'supported', since only X86 has implemented the support for checking valid CPU names and Feature Names. One test was changed to i686, since it uses a lakemont, which would otherwise be prohibited in x86_64. Differential Revision: https://reviews.llvm.org/D39357 llvm-svn: 316783
* Remove x86,x86_32/64 from isValidFeatureNameErich Keane2017-10-271-3/+0
| | | | | | | | | These are not valid values for this, and are pretty non-sensical, since LLVM doesn't understand them. Differential Revision: https://reviews.llvm.org/D39378 llvm-svn: 316781
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-273-146/+126
| | | | | | | | | | | | | | | | | This commit changes the way that the refactoring operation classes are structured: - Users have to call `initiate` instead of constructing an instance of the class. The `initiate` is now supposed to have custom initiation logic, and you don't need to subclass the builtin requirements. - A new `describe` function returns a structure with the id, title and the description of the refactoring operation. The refactoring action classes are now placed into one common place in RefactoringActions.cpp instead of being separate. Differential Revision: https://reviews.llvm.org/D38985 llvm-svn: 316780
* [Sema] Fix an assert-on-invalid by avoiding function template specialisationAlex Lorenz2017-10-271-4/+4
| | | | | | | | | | | | | deduction for invalid functions The fabricated template parameters cause an assertion because their depth is invalid. rdar://34109988 Differential Revision: https://reviews.llvm.org/D37341 llvm-svn: 316778
* [WebAssembly] Add crt1.o with calling lldSam Clegg2017-10-272-8/+9
| | | | | | | | | Also, for OS unknown targets like wasm, don't include 'unknown' in the library path. This is a fix for rL316719. Differential Revision: https://reviews.llvm.org/D39354 llvm-svn: 316777
* [CrossTU] Fix handling of Cross Translation Unit directory pathGabor Horvath2017-10-271-4/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D38842 llvm-svn: 316764
* Test commitIvan Donchevskii2017-10-271-1/+1
| | | | llvm-svn: 316758
* [CodeGen] Add support for IncompleteArrayType in Obj-C ivars.Volodymyr Sapsai2017-10-271-0/+5
| | | | | | | | | | | | | | | | | Fixes an assertion failure when ivar is a struct containing incomplete array. Also completes support for direct flexible array members. rdar://problem/21054495 Reviewers: rjmccall, theraven Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38774 llvm-svn: 316723
* [WebAssembly] Include libclang_rt.builtins in the standard waySam Clegg2017-10-273-11/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D39218 llvm-svn: 316719
OpenPOWER on IntegriCloud