summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [ThinLTO] Support opt remarks options with distributed ThinLTO backendsTeresa Johnson2018-05-054-5/+56
| | | | | | | | | | | | | | | | | Summary: Passes down the necessary code ge options to the LTO Config to enable -fdiagnostics-show-hotness and -fsave-optimization-record in the ThinLTO backend for a distributed build. Also, remove warning about not having PGO when the input is IR. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D46464 llvm-svn: 331592
* Fix a couple places that immediately called operator-> on the result of ↵Craig Topper2018-05-052-2/+2
| | | | | | | | dyn_cast. It looks like it safe to just use cast for both cases. llvm-svn: 331578
* Add warning flag -Wordered-compare-function-pointers.Eli Friedman2018-05-052-3/+3
| | | | | | | | | | The C standard doesn't allow comparisons like "f1 < f2" (where f1 and f2 are function pointers), but we allow them as an extension. Add a warning flag to control this warning. Differential Revision: https://reviews.llvm.org/D46155 llvm-svn: 331570
* [analyzer] Remove untested code in evalLoad.Artem Dergachev2018-05-041-37/+0
| | | | | | No functional change intended. llvm-svn: 331565
* [analyzer] Invalidate union regions properly. Don't hesitate to load later.Artem Dergachev2018-05-042-8/+19
| | | | | | | | | | | | | | | | | | | We weren't invalidating our unions correctly. The previous behavior in invalidateRegionsWorker::VisitCluster() was to direct-bind an UnknownVal to the union (at offset 0). For that reason we were never actually loading default bindings from our unions, because there never was any default binding to load, and the value that is presumed when there's no default binding to load is usually completely incorrect (eg. UndefinedVal for stack unions). The new behavior is to default-bind a conjured symbol (of irrelevant type) to the union that's being invalidated, similarly to what we do for structures and classes. Then it becomes safe to load the value properly. Differential Revision: https://reviews.llvm.org/D45241 llvm-svn: 331563
* [analyzer] pr36458: Fix retrieved value cast for symbolic void pointers.Artem Dergachev2018-05-042-0/+36
| | | | | | | | | | | | | C allows us to write any bytes into any memory region. When loading weird bytes from memory regions of known types, the analyzer is required to make sure that the loaded value makes sense by casting it to an appropriate type. Fix such cast for loading values that represent void pointers from non-void pointer type places. Differential Revision: https://reviews.llvm.org/D46415 llvm-svn: 331562
* [analyzer] pr18953: Split C++ zero-initialization from default initialization.Artem Dergachev2018-05-049-41/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | The bindDefault() API of the ProgramState allows setting a default value for reads from memory regions that were not preceded by writes. It was used for implementing C++ zeroing constructors (i.e. default constructors that boil down to setting all fields of the object to 0). Because differences between zeroing consturctors and other forms of default initialization have been piling up (in particular, zeroing constructors can be called multiple times over the same object, probably even at the same offset, requiring a careful and potentially slow cleanup of previous bindings in the RegionStore), we split the API in two: bindDefaultInitial() for modeling initial values and bindDefaultZero() for modeling zeroing constructors. This fixes a few assertion failures from which the investigation originated. The imperfect protection from both inability of the RegionStore to support binding extents and lack of information in ASTRecordLayout has been loosened because it's, well, imperfect, and it is unclear if it fixing more than it was breaking. Differential Revision: https://reviews.llvm.org/D46368 llvm-svn: 331561
* [X86] Correct the attributes on the incssp and rdssp builtins to only have ↵Craig Topper2018-05-042-4/+4
| | | | | | 'nothrow' llvm-svn: 331560
* [X86] Fix some inconsistent formatting in the first line of our intrinsics ↵Craig Topper2018-05-0413-15/+13
| | | | | | | | headers. Some were too long and some were too short. llvm-svn: 331559
* [analyzer] pr37209: Fix casts of glvalues to references.Artem Dergachev2018-05-042-0/+21
| | | | | | | | | | | | | | | Many glvalue expressions aren't of their respective reference type - they are simply glvalues of their value type. This was causing problems when we were trying to obtain type of the original expression while evaluating certain glvalue bit-casts. Fixed by artificially forging a reference type to provide to the casting procedure. Differential Revision: https://reviews.llvm.org/D46224 llvm-svn: 331558
* [analyzer] Treat more const variables and fields as known contants.Artem Dergachev2018-05-043-3/+163
| | | | | | | | | | | | | | | | When loading from a variable or a field that is declared as constant, the analyzer will try to inspect its initializer and constant-fold it. Upon success, the analyzer would skip normal load and return the respective constant. The new behavior also applies to fields/elements of brace-initialized structures and arrays. Patch by Rafael Stahl! Differential Revision: https://reviews.llvm.org/D45774 llvm-svn: 331556
* Allow modifying the PrintingPolicy for fully qualified names.Sterling Augustine2018-05-043-8/+29
| | | | | Author: mikhail.ramalho@gmail.com llvm-svn: 331552
* [clang-format] Refactor #include insertion/deletion functionality into a class.Eric Liu2018-05-042-114/+326
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The class will be moved into libToolingCore as followup. The new behaviors in this patch: - New #include is inserted in the right position in a #include block to preserver sorted #includes. This is best effort - only works when the block is already sorted. - When inserting multiple #includes to the end of a file which doesn't end with a "\n" character, a "\n" will be prepended to each #include. This is a special and rare case that was previously handled. This is now relaxed to avoid complexity as it's rare in practice. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: klimek, cfe-commits, djasper Differential Revision: https://reviews.llvm.org/D46180 llvm-svn: 331544
* [NFC]Convert Class to use member initialization instead of inline.Erich Keane2018-05-041-9/+5
| | | | llvm-svn: 331536
* [clang-cl] Print /showIncludes to stderr, if used in combination with /E, ↵Erich Keane2018-05-047-24/+54
| | | | | | | | | | | | | | | | | /EP or /P This replicates 'cl.exe' behavior and allows for both preprocessor output and dependency information to be extraced with a single compiler invocation. This is especially useful for compiler caching with tools like Mozilla's sccache. See: https://github.com/mozilla/sccache/issues/246 Patch By: fxb Differential Revision: https://reviews.llvm.org/D46394 llvm-svn: 331533
* Remove explicit cfg-temporary-dtors=trueAlexander Kornienko2018-05-047-13/+12
| | | | | | | | | | | | | | | | Summary: Remove explicit -analyzer-config cfg-temporary-dtors=true in analyzer tests, since this option defaults to true since r326461. Reviewers: NoQ Reviewed By: NoQ Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46393 llvm-svn: 331520
* [Coroutines] Catch exceptions in await_resumeBrian Gesiak2018-05-043-3/+130
| | | | | | | | | | | | | | | | | | | | | Summary: http://wg21.link/P0664r2 section "Evolution/Core Issues 24" describes a proposed change to Coroutines TS that would have any exceptions thrown after the initial suspend point of a coroutine be caught by the handler specified by the promise type's 'unhandled_exception' member function. This commit provides a sample implementation of the specified behavior. Test Plan: `check-clang` Reviewers: GorNishanov, EricWF Reviewed By: GorNishanov Subscribers: cfe-commits, lewissbaker, eric_niebler Differential Revision: https://reviews.llvm.org/D45860 llvm-svn: 331519
* [Driver] Don't warn about unused inputs in config filesMartin Storsjo2018-05-043-4/+10
| | | | | | | | | This avoids warnings about unused linker parameters, just like other flags are ignored if they're from config files. Differential Revision: https://reviews.llvm.org/D46286 llvm-svn: 331504
* [analyzer] NFC: Remove unused parameteer of StoreManager::CastRetrievedVal().Artem Dergachev2018-05-043-19/+7
| | | | llvm-svn: 331496
* [X86] Make __builtin_ia32_directstore_u32 and __builtin_ia32_movdir64b 'nothrow'Craig Topper2018-05-031-2/+2
| | | | | | These builtins snuck in while I was in the middle of adding nothrow to the other builtins in my local clone and I guess I missed them. llvm-svn: 331483
* [CodeGenFunction] Use the StringRef::split function that takes a char ↵Craig Topper2018-05-031-2/+2
| | | | | | | | separator instead of StringRef separator. NFC The char separator version should be a little better optimized. llvm-svn: 331482
* [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAGJoel E. Denny2018-05-038-72/+72
| | | | | | | | Reviewed by: ABataev Differential Revision: https://reviews.llvm.org/D46370 llvm-svn: 331469
* Revert r331466: [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAG"Joel E. Denny2018-05-038-72/+72
| | | | | | Sorry, forgot to add commit log attributes. llvm-svn: 331468
* [OPENMP] Fix test typos: CHECK-DAG-N -> CHECK-N-DAGJoel E. Denny2018-05-038-72/+72
| | | | llvm-svn: 331466
* Allow writing calling convention attributes on function types.Aaron Ballman2018-05-036-23/+43
| | | | | | Calling convention attributes notionally appertain to the function type -- they modify the mangling of the function, change the behavior of assignment operations, etc. This commit allows the calling convention attributes to be written in the type position as well as the declaration position. llvm-svn: 331459
* Rename invariant.group.barrier to launder.invariant.groupPiotr Padlewski2018-05-035-37/+37
| | | | | | | | | | | | | | Summary: This is one of the initial commit of "RFC: Devirtualization v2" proposal: https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing Reviewers: rsmith, amharc, kuhar, sanjoy Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45111 llvm-svn: 331448
* Enable -fsanitize=function on FreeBSD.Fangrui Song2018-05-031-0/+1
| | | | llvm-svn: 331440
* Fix -Wunused-variable warning in Clang.cppKarl-Johan Karlsson2018-05-031-1/+1
| | | | llvm-svn: 331438
* Track the result of evaluating a computed noexcept specification on theRichard Smith2018-05-0333-378/+320
| | | | | | | | | | | | | | FunctionProtoType. We previously re-evaluated the expression each time we wanted to know whether the type is noexcept or not. We now evaluate the expression exactly once. This is not quite "no functional change": it fixes a crasher bug during AST deserialization where we would try to evaluate the noexcept specification in a situation where we have not deserialized sufficient portions of the AST to permit such evaluation. llvm-svn: 331428
* [CMake][Cache] Stop pretending that Fuchsia is UNIXPetr Hosek2018-05-031-1/+0
| | | | | | | | | This changes some aspects of the build that are not relevant or useful for Fuchsia like setting the RPATH/RUNPATH. Differential Revision: https://reviews.llvm.org/D46361 llvm-svn: 331425
* [Sema] Do not match function type with const T in template argument deductionLei Liu2018-05-034-16/+49
| | | | | | | | | | | From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584, function type should not match cv-qualified type in template argument deduction. This also matches what GCC and EDG do in template argument deduction. Differential Revision: https://reviews.llvm.org/D45755 llvm-svn: 331424
* [ObjC] Supress the 'implementing unavailable method' warning whenAlex Lorenz2018-05-034-6/+48
| | | | | | | | | | | | | the method declaration is unavailable for an app extension platform Rationale: Classes are often shared between an app extension code and non-app extension code. There's no way to remove the implementation using preprocessor when building the app extension, so we should not warn here. rdar://38150617 llvm-svn: 331421
* [gcov] Make the CLang side coverage test work with the newChandler Carruth2018-05-021-7/+15
| | | | | | | | | instrumentation codegeneration strategy of using a data structure and a loop. Required some finesse to get the critical things being tested to surface in a nice way for FileCheck but I think this preserves the original intent of the test. llvm-svn: 331411
* [ObjC] The absence of ownership qualifiers on an ambiguous property leadsAlex Lorenz2018-05-022-4/+49
| | | | | | | | | to synthesis of a valid property even when the selected protocol property has ownership qualifiers rdar://39024725 llvm-svn: 331409
* [analyzer] Revert r331096 "CStringChecker: Add support for BSD strlcpy()...".Artem Dergachev2018-05-021-39/+2
| | | | | | | | | The return values of the newly supported functions were not handled correctly: strlcpy()/strlcat() return string sizes rather than pointers. Differential Revision: https://reviews.llvm.org/D45177 llvm-svn: 331401
* [X86] Mark all x86 specific builtins as nothrow.Craig Topper2018-05-022-1763/+1763
| | | | | | | | | | | | I believe all of the x86 builtins should be considered nothrow. I've left the incssp builtins alone because I think its current attributes are wrong and I'm following up with the contributor for that. I plan to start adding const as well, but that requires more careful auditing. Differential Revision: https://reviews.llvm.org/D46328 llvm-svn: 331399
* [OPENMP] Add support for reductions on simd directives in targetAlexey Bataev2018-05-022-19/+73
| | | | | | | | regions. Added codegen for `simd reduction()` constructs in target directives. llvm-svn: 331393
* Revert "Emit an error when mixing <stdatomic.h> and <atomic>"Volodymyr Sapsai2018-05-022-14/+0
| | | | | | | | | | | | | It reverts r331378 as it caused test failures ThreadSanitizer-x86_64 :: Darwin/gcd-groups-destructor.mm ThreadSanitizer-x86_64 :: Darwin/libcxx-shared-ptr-stress.mm ThreadSanitizer-x86_64 :: Darwin/xpc-race.mm Only clang part of the change is reverted, libc++ part remains as is because it emits error less aggressively. llvm-svn: 331392
* [Driver] Infer Android sysroot location.Dan Albert2018-05-021-0/+9
| | | | | | | | | | | | | | | | Summary: Android toolchains include their headers and libraries in a self-contained directory within the toolchain. Reviewers: srhines Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45291 llvm-svn: 331390
* [Driver] Obey computed sysroot when finding libc++ headers.Dan Albert2018-05-021-2/+3
| | | | | | | | | | | | | | | | Summary: A handful of targets will try some default paths if --sysroot is not provided. If that is the case, it should be used for the libc++ header paths. Reviewers: srhines, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45292 llvm-svn: 331389
* [OPENMP] Analyze the type of the mapped entity instead of its base.Alexey Bataev2018-05-022-2/+17
| | | | | | | If the mapped entity is a data member, we erroneously checked the type of its base rather than the type of the mapped entity itself. llvm-svn: 331385
* Emit an error when mixing <stdatomic.h> and <atomic>Volodymyr Sapsai2018-05-022-0/+14
| | | | | | | | | | | | | | | | | | | | | Atomics in C and C++ are incompatible at the moment and mixing the headers can result in confusing error messages. Emit an error explicitly telling about the incompatibility. Introduce the macro `__ALLOW_STDC_ATOMICS_IN_CXX__` that allows to choose in C++ between C atomics and C++ atomics. rdar://problem/27435938 Reviewers: rsmith, EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D45470 llvm-svn: 331378
* [OPENMP] Do not emit warning for implicitly declared target functions.Alexey Bataev2018-05-022-16/+18
| | | | | | | Since upcoming OpenMP 5.0 functions can be mapped implicitly as declare target and we should not emit warnings for such functions. llvm-svn: 331377
* [OPENMP] Enable c++ exceptions outside of the target constructs iff they areAlexey Bataev2018-05-025-2/+83
| | | | | | | | | | enabled for the host. If the compilation for the host enables C++ exceptions, but they are not supported by the device, we still need to allow the code with the exception handling constructs outside of the target regions. llvm-svn: 331372
* Add -foutline option to enable the MachineOutliner in AArch64Jessica Paquette2018-05-023-0/+11
| | | | | | | | | | | | | Since we've been working on productizing the MachineOutliner in AArch64, it makes sense to provide a more user-friendly way to enable it. This allows users of AArch64 to enable the outliner using -foutline instead of -mllvm -enable-machine-outliner. Other, less mature implementations (e.g, x86-64) can still enable the pass using the -mllvm option. Also add a test to make sure it works. llvm-svn: 331370
* [OPENMP] Support C++ member functions in the device constructs.Alexey Bataev2018-05-024-14/+18
| | | | | | | Added correct emission of the C++ member functions for the device function when they are used in the device constructs. llvm-svn: 331365
* [analyzer] Fix filename in cross-file HTML reportMalcolm Parsons2018-05-022-1/+5
| | | | | | | | | | | | | | | | | Summary: The filename is currently taken from the start of the path, while the line and column are taken from the end of the path. This didn't matter until cross-file path reporting was added. Reviewers: george.karpenkov, dcoughlin, vlad.tsyrklevich Reviewed By: george.karpenkov, vlad.tsyrklevich Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D45611 llvm-svn: 331361
* [OPENMP] Emit names of the globals depending on target.Alexey Bataev2018-05-024-75/+141
| | | | | | | | Some symbols are not allowed to be used as names on some targets. Patch ries to unify the emission of the names of LLVM globals so they could be used on different targets. llvm-svn: 331358
* [analyzer] Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero and VLASize.Henry Wong2018-05-024-26/+55
| | | | | | | | | | | | | | Summary: Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero, VLASize to be able to indicate where the taint information originated from. Reviewers: NoQ, george.karpenkov, xazax.hun, a.sidorin Reviewed By: NoQ Subscribers: szepet, rnkovacs, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D46007 llvm-svn: 331345
* [ASTImporter] Fix isa cast assertPeter Szecsi2018-05-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | Do early return if we can't import the found decl for a member expr. This follows the pre-existing scheme, e.g with E->getMemberDecl(). E->getFoundDecl().getDecl() can be null when a member expression does not involve lookup. It may involve a lookup in case of a using directive which refers to a member function in a base class template. We faced this assert during the CTU analysis of google::protobuf v3.5.2. We tried hard to synthesize a minimal test example both by hand and by executing creduce on multiple files. Unfortunately, we were unable to reduce to such a minimal example, yet. Nevertheless, this fix solved the problem in protobuf. To reproduce the error one must execute the analyzer with -Xclang -analyzer-config -Xclang experimental-enable-naive-ctu-analysis=true -Xclang -analyzer-config -Xclang ctu-dir=/path/to/ctu_dir Patch by Gabor Marton! Differential Revision: https://reviews.llvm.org/D46019 llvm-svn: 331344
OpenPOWER on IntegriCloud