summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Another attempt to fix "could not find clang-check" lit warning in ↵Nico Weber2019-05-021-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | analyzer-less builds r359717 added clang-check as a dep of check-clang unconditionally because I had missed lit.local.cfg in test/Tooling. Instead, only add clang-check to the tools if the analyzer is enabled, since the build target only exists then, and since all tests using clang-check are skipped when the analyzer is disabled. Differential Revision: https://reviews.llvm.org/D61418 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359820 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Sema] Emit warning for visibility attribute on internal-linkage declarationScott Linder2019-05-025-2/+23
| | | | | | | | | | | | | | | | GCC warns on these cases, but we currently just silently ignore the attribute. Differential Revision: https://reviews.llvm.org/D61097 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359814 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use primary template parameter names for variable template debug infoReid Kleckner2019-05-023-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes PR41677 Consider: template <typename LHS, typename RHS> constexpr bool is_same_v = false; template <typename T> constexpr bool is_same_v<T, T> = true; template constexpr bool is_same_v<int, int>; Before this change, when emitting debug info for the `is_same_v<int, int>` global variable, clang would crash because it would try to use the template parameter list from the partial specialization to give parameter names to template arguments. This doesn't work in general, since a partial specialization can have fewer arguments than the primary template. Therefore, always use the primary template. Hypothetically we could try to use the parameter names from the partial specialization when possible, but it's not clear this really helps debugging in practice. Reviewers: JDevlieghere, aprantl, ormris, dblaikie Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359809 91177308-0d34-0410-b5e6-96231b3b80d8
| * Do not warn on switches over enums that do not use [[maybe_unused]] enumeratorsDavid Blaikie2019-05-022-2/+19
| | | | | | | | | | | | | | | | | | | | PR36231, [dcl.attr.unused]p3 Reviewers: aaron.ballman Differential Revision: https://reviews.llvm.org/D61444 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359800 91177308-0d34-0410-b5e6-96231b3b80d8
| * [OpenCL] Fix initialisation of this via pointer.Anastasia Stulova2019-05-022-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the expression used to initialise 'this' has a pointer type, check the address space of the pointee type instead of the pointer type to decide whether an address space cast is required. It is the pointee type that carries the address space qualifier. Fixing PR41674. Patch by kpet (Kevin Petit)! Differential Revision: https://reviews.llvm.org/D61319 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359798 91177308-0d34-0410-b5e6-96231b3b80d8
| * [OpenCL] Deduce static data members to __global addr space.Anastasia Stulova2019-05-022-2/+16
| | | | | | | | | | | | | | | | | | | | | | Similarly to static variables in OpenCL, static class data members should be deduced to __global addr space. Differential Revision: https://reviews.llvm.org/D61304 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359789 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix typo in test case.Akira Hatanaka2019-05-021-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359761 91177308-0d34-0410-b5e6-96231b3b80d8
| * Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFOStephan Bergmann2019-05-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up after b7692bc3e9ad2691fc07261904b88fb15f30696b "[UBSan] Fix isDerivedFromAtOffset on iOS ARM64" fixed the RTTI comparison in isDerivedFromAtOffset on just one platform and then a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692 "Always compare C++ typeinfo (based on libstdc++ implementation)" extended that fix to more platforms. But there is another RTTI comparison for -fsanitize=function generated in clang's CodeGenFunction::EmitCall as just a pointer comparison. For SANITIZER_NON_UNIQUE_TYPEINFO platforms this needs to be extended to also do string comparison. For that, __ubsan_handle_function_type_mismatch[_abort] takes the two std::type_info pointers as additional parameters now, checks them internally for potential equivalence, and returns without reporting failure if they turn out to be equivalent after all. (NORETURN needed to be dropped from the _abort variant for that.) Also these functions depend on ABI-specific RTTI now, so needed to be moved from plain UBSAN_SOURCES (ubsan_handlers.h/cc) to UBSAN_CXXABI_SOURCES (ubsan_handlers_cxx.h/cc), but as -fsanitize=function is only supported in C++ mode that's not a problem. Differential Revision: https://reviews.llvm.org/D60760 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359759 91177308-0d34-0410-b5e6-96231b3b80d8
| * Replace ad-hoc tracking of pattern for an instantiated class-scopeRichard Smith2019-05-0216-203/+316
| | | | | | | | | | | | | | | | | | | | explicit function specialization with the MemberSpecializationInfo used everywhere else. Not NFC: the ad-hoc pattern tracking was not being serialized / deserialized properly. That's fixed here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359747 91177308-0d34-0410-b5e6-96231b3b80d8
| * Diagnose non-dependent qualified friend function template declarationsRichard Smith2019-05-024-12/+23
| | | | | | | | | | | | | | that don't match any existing declaration. Don't get confused and treat such declarations as template *specializations*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359746 91177308-0d34-0410-b5e6-96231b3b80d8
| * [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABITom Tan2019-05-026-5/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to alignment section in below ARM64 ABI document, MSVC could increase alignment of global data based on its total size. Clang doesn't do this. Compile the same symbol into different alignments by Clang and MSVC could cause link error because some instruction encodings, like 64-bit LDR/STR with immediate, require the target to be 8 bytes aligned, and linker could choose code stream with such LDR/STR instruction from MSVC and 4 bytes aligned data from Clang into final image, which actually cannot be linked together (see https://bugs.llvm.org/show_bug.cgi?id=41506 for more details). https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019#alignment Differential Revision: https://reviews.llvm.org/D61225 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359744 91177308-0d34-0410-b5e6-96231b3b80d8
| * Consume unexpected "template" keywords after "using"Richard Trieu2019-05-013-0/+68
| | | | | | | | | | | | | | | | | | | | | | The parser was dealing with unexpected "template" keywords after "using" keywords too late and putting the parser into the wrong state, which could lead to a crash down the line. This change allows the parser to consume the bad "template" keywords earlier, and continue parsing as if "template" was never there to begin with for better error recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359740 91177308-0d34-0410-b5e6-96231b3b80d8
| * Revert r359717, "Make check-clang depend on the clang-check binary always"Nico Weber2019-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The Tooling tests do have a lit.local.cfg with if not config.root.clang_staticanalyzer: config.unsupported = True so what's wrong isn't the missing dep, but that lit prints a warning for the binary missing. This will need a different kind of fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359739 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer] Fix buildbot failures caused by a forgotten initializationKristof Umann2019-05-011-5/+6
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359727 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make clang/utils/creduce-clang-crash.py executableReid Kleckner2019-05-011-0/+0
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359722 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer] Don't display implementation checkers under ↵Kristof Umann2019-05-0113-40/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -analyzer-checker-help, but do under the new flag -analyzer-checker-help-hidden During my work on analyzer dependencies, I created a great amount of new checkers that emitted no diagnostics at all, and were purely modeling some function or another. However, the user shouldn't really disable/enable these by hand, hence this patch, which hides these by default. I intentionally chose not to hide alpha checkers, because they have a scary enough name, in my opinion, to cause no surprise when they emit false positives or cause crashes. The patch introduces the Hidden bit into the TableGen files (you may remember it before I removed it in D53995), and checkers that are either marked as hidden, or are in a package that is marked hidden won't be displayed under -analyzer-checker-help. -analyzer-checker-help-hidden, a new flag meant for developers only, displays the full list. Differential Revision: https://reviews.llvm.org/D60925 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359720 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make check-clang depend on the clang-check binary alwaysNico Weber2019-05-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check-clang (the target that runs all clang tests) used to only depend on clang-check (a binary like clang-tidy, clang-refactor, etc) if the static analyzer is enabled. However, several lit tests call clang-check unconditionally, so always depend on it. Fixes a "could not find clang-check" lit warning in clean builds with the static analyzer disabled. Also sort the deps in the CMake file and put just one dep on each line. Differential Revision: https://reviews.llvm.org/D61324 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359717 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Parser] Avoid correcting delayed typos in array subscript multiple times.Volodymyr Sapsai2019-05-013-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We correct some typos in `ActOnArraySubscriptExpr` and `ActOnOMPArraySectionExpr`, so when their result is `ExprError`, we can end up correcting delayed typos in the same expressions again. In general it is OK but when `NumTypos` is incorrect, we can hit the assertion > Assertion failed: (Entry != DelayedTypos.end() && "Failed to get the state for a TypoExpr!"), function getTypoExprState, file clang/lib/Sema/SemaLookup.cpp, line 5219. Fix by replacing some subscript `ExprResult` with typo-corrected expressions instead of keeping the original expressions. Thus if original expressions contained `TypoExpr`, we'll use corrected expressions instead of trying to correct them again. rdar://problem/47403222 Reviewers: rsmith, erik.pilkington, majnemer Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D60848 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359713 91177308-0d34-0410-b5e6-96231b3b80d8
| * [clang-format] Fix a bug in AlignConsecutiveDeclarations.Owen Pan2019-05-012-3/+22
| | | | | | | | | | | | | | | | Fixes PR37175 Differential Revision: https://reviews.llvm.org/D61222 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359711 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Driver] Explicitly request platform rtlib in the Driver pic testPetr Hosek2019-05-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This test checks whether crtbegin.o and crtend.o appear on the link line, but names of these files may be affected by the choice of the rtlib, specifically when compiler-rt is used as the default rtlib the names will be clang_rt.crtbegin.o and clang_rt.crtend.o instead of crtbeginS.o and crtendS.o. To avoid the test failure, explicitly request to use the platform rtlib. Differential Revision: https://reviews.llvm.org/D61383 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359706 91177308-0d34-0410-b5e6-96231b3b80d8
| * Bump DIAG_SIZE_SEMA, as we've hit it.Scott Linder2019-05-011-1/+1
| | | | | | | | | | | | | | | | | | $ grep 'DIAG_SIZE_SEMA =' include/clang/Basic/DiagnosticIDs.h DIAG_SIZE_SEMA = 4000, $ grep DIAG $(build)/tools/clang/include/clang/Basic/DiagnosticSemaKinds.inc | wc -l 3499 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359702 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer][tests][NFC] Add EOF newlines, normalize reference expected filesHubert Tong2019-05-013-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Reference expected files not ending with a newline are normalized to have said newlines. Additionally `plist-macros-with-expansion.cpp.plist` is modified to add a line that is ignored by `%diff_plist`, but not by the more sensitive pattern proposed by http://lists.llvm.org/pipermail/cfe-dev/2019-April/061904.html for `%normalize_plist`. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359692 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer][tests] Use diff_plist, correct order of arguments for missed ↵Hubert Tong2019-05-015-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | cases; NFC For various files under `clang/test/Analysis`, D52036 applied `%diff_plist` to replace `diff` invocations with certain options and D56340 swapped the order of the arguments so that the reference file comes first. The tests that used `tail` to filter the test output were not modified accordingly. This patch applies the corresponding update to those tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359691 91177308-0d34-0410-b5e6-96231b3b80d8
| * [clang-format] Fix bug that misses some function-like macro usagesOwen Pan2019-05-012-4/+15
| | | | | | | | | | | | | | | | Fixes PR41483 Differential Revision: https://reviews.llvm.org/D61297 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359687 91177308-0d34-0410-b5e6-96231b3b80d8
| * Change llvm-{objdump,readobj} -long-option to --long-option or well-known ↵Fangrui Song2019-05-016-10/+10
| | | | | | | | | | | | short options in tests. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359662 91177308-0d34-0410-b5e6-96231b3b80d8
| * lib/Header: Fix Visual Studio builds try #2Tom Stellard2019-05-011-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow up to r355253 and a better fix than the first attempt which was r359257. We can't install anything from ${CMAKE_CFG_INTDIR}, because this value is only defined at build time, but we still must make sure to copy the headers into ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include, because the lit tests look for headers there. So for this fix we revert to the old behavior of copying the headers to ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include during the build and then installing them from the source tree. Reviewers: smeenai, vzakhari, phosek Reviewed By: smeenai, vzakhari Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61220 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359654 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix auto-init testJF Bastien2019-04-301-3/+3
| | | | | | | | | | | | r359628 changed the initialization of padding to follow C, but I didn't update the C++ tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359636 91177308-0d34-0410-b5e6-96231b3b80d8
| * [WebAssembly] Use the "wasm32-wasi" triple in testsDan Gohman2019-04-303-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Similar to https://reviews.llvm.org/D61334, update clang tests to use the "wasm32-wasi" triple, removing the "-musl" environment and omitting the "-unknown" vendor. Differential Revision: https://reviews.llvm.org/D61338 Reviewer: sbc100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359630 91177308-0d34-0410-b5e6-96231b3b80d8
| * Variable auto-init: don't initialize aggregate padding of all aggregatesJF Bastien2019-04-302-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: C guarantees that brace-init with fewer initializers than members in the aggregate will initialize the rest of the aggregate as-if it were static initialization. In turn static initialization guarantees that padding is initialized to zero bits. Quoth the Standard: C17 6.7.9 Initialization ❡21 If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration. C17 6.7.9 Initialization ❡10 If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. If an object that has static or thread storage duration is not initialized explicitly, then: * if it has pointer type, it is initialized to a null pointer; * if it has arithmetic type, it is initialized to (positive or unsigned) zero; * if it is an aggregate, every member is initialized (recursively) according to these rules, and any padding is initialized to zero bits; * if it is a union, the first named member is initialized (recursively) according to these rules, and any padding is initialized to zero bits; <rdar://problem/50188861> Reviewers: glider, pcc, kcc, rjmccall, erik.pilkington Subscribers: jkorous, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61280 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359628 91177308-0d34-0410-b5e6-96231b3b80d8
| * Remove two unnecessary wrappers of canPassInRegistersReid Kleckner2019-04-304-19/+5
| | | | | | | | | | | | These extra layers aren't necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359623 91177308-0d34-0410-b5e6-96231b3b80d8
| * Set LoopInterleaved in the PassManagerBuilder.Alina Sbirlea2019-04-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Corresponds to D61030. Subscribers: jlebar, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61142 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359616 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Driver] Support compiler-rt crtbegin.o/crtend.o for LinuxPetr Hosek2019-04-306-85/+111
| | | | | | | | | | | | | | | | | | | | When compiler-rt is selected as the runtime library for Linux targets use its crtbegin.o/crtend.o implemenetation rather than platform one if available. Differential Revision: https://reviews.llvm.org/D59264 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359603 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add requires amdgpu-registered-target for amdgpu-float16.cppYaxun Liu2019-04-301-0/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359598 91177308-0d34-0410-b5e6-96231b3b80d8
| * AMDGPU: Enable _Float16Yaxun Liu2019-04-302-0/+22
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359594 91177308-0d34-0410-b5e6-96231b3b80d8
| * [LibTooling] Fix broken test after r359574.Yitzhak Mandelbaum2019-04-301-3/+5
| | | | | | | | | | | | r359574 changed the way that failures are reported, which broke the test TransformerTest.NodePartNameDeclRefFailure which detects a faiure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359578 91177308-0d34-0410-b5e6-96231b3b80d8
| * [LibTooling] Change Transformer's TextGenerator to a partial function.Yitzhak Mandelbaum2019-04-303-49/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Changes the signature of the TextGenerator std::function to return an Expected<std::string> instead of std::string to allow for (non-fatal) failures. Previously, we expected that any failures would be expressed with assertions. However, that's unfriendly to running the code in servers or other places that don't want their library calls to crash the program. Correspondingly, updates Transformer's handling of failures in TextGenerators and the signature of `ChangeConsumer`. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359574 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix inconsistency in calculating DIAG_START_ values.Russell Gallop2019-04-301-2/+2
| | | | | | | | | | | | | | | | | | This was introduced at r313975. As DIAG_SIZE_CROSSTU and DIAG_SIZE_COMMENT are both 100 this should be NFC. Differential Revision: https://reviews.llvm.org/D61264 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359558 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix gcc "-Wdangling-else" warning. NFCI.Simon Pilgrim2019-04-301-1/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359551 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix gcc "-Wdangling-else" warnings. NFCI.Simon Pilgrim2019-04-301-3/+6
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359550 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer][UninitializedObjectChecker] PR41611: Regard vector types as primitiveKristof Umann2019-04-303-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=41611 Similarly to D61106, the checker ran over an llvm_unreachable for vector types: struct VectorSizeLong { VectorSizeLong() {} __attribute__((__vector_size__(16))) long x; }; void __vector_size__LongTest() { VectorSizeLong v; } Since, according to my short research, "The vector_size attribute is only applicable to integral and float scalars, although arrays, pointers, and function return values are allowed in conjunction with this construct." [src: https://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Vector-Extensions.html#Vector-Extensions] vector types are safe to regard as primitive. Differential Revision: https://reviews.llvm.org/D61246 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359539 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer] Treat functions without run-time branches as "small".Artem Dergachev2019-04-307-33/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we always inline functions that have no branches, i.e. have exactly three CFG blocks: ENTRY, some code, EXIT. This makes sense because when there are no branches, it means that there's no exponential complexity introduced by inlining such function. Such functions also don't trigger various fundamental problems with our inlining mechanism, such as the problem of inlined defensive checks. Sometimes the CFG may contain more blocks, but in practice it still has linear structure because all directions (except, at most, one) of all branches turned out to be unreachable. When this happens, still treat the function as "small". This is useful, in particular, for dealing with C++17 if constexpr. Differential Revision: https://reviews.llvm.org/D61051 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359531 91177308-0d34-0410-b5e6-96231b3b80d8
| * [analyzer] SmartPtrModeling: Fix a null dereference.Artem Dergachev2019-04-302-1/+11
| | | | | | | | | | | | | | | | | | Don't crash when trying to model a call in which the callee is unknown in compile time, eg. a pointer-to-member call. Differential Revision: https://reviews.llvm.org/D61285 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359530 91177308-0d34-0410-b5e6-96231b3b80d8
| * [NFC] typoJF Bastien2019-04-301-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359524 91177308-0d34-0410-b5e6-96231b3b80d8
| * [NFC] typoJF Bastien2019-04-302-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359523 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add __builtin_dcbf support for PPCAhsan Saghir2019-04-293-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for __builtin_dcbf for PPC. __builtin_dcbf copies the contents of a modified block from the data cache to main memory and flushes the copy from the data cache. Differential revision: https://reviews.llvm.org/D59843 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359517 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Diagnostics] Support -Wtype-limits for GCC compatibilityDavid Bolvansky2019-04-295-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GCC's -Wtype-limits (part of -Wextra): Warn if a comparison is always true or always false due to the limited range of the data type Reviewers: rsmith, aaron.ballman, lebedev.ri, thakis Reviewed By: rsmith Subscribers: lebedev.ri, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58841 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359516 91177308-0d34-0410-b5e6-96231b3b80d8
| * Re-land r359250, [COFF] Statically link certain runtime library functionsReid Kleckner2019-04-295-9/+75
| | | | | | | | | | | | | | | | Reverts the revert of r359251, this time with fixed tests. Differential Revision: https://reviews.llvm.org/D55229 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359513 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make test more robust by writing stdout/stderr to different files.Douglas Yung2019-04-291-3/+3
| | | | | | | | | | | | | | | | Our internal build bots were failing this test randomly as the stderr output was emitted to the file in the middle of the stdout output line that the test was checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359512 91177308-0d34-0410-b5e6-96231b3b80d8
| * Simplify exclusion of nested classes from extern template instantiation, NFCReid Kleckner2019-04-291-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This simplifies three checks for MS ABI, Win Itanium, or Win GNU to just "is Windows". The question remains, however, if this is really the correct thing to do. We could, for example, only not consider inner classes to be externally available if the outer class has a dllexport annotation. However, I will leave that as future work. Reviewers: hans, mstorsjo Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61278 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359507 91177308-0d34-0410-b5e6-96231b3b80d8
| * When skipping code at the start of a file during PCH use, Preprocessor::LexMike Rice2019-04-294-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is not used since it consumes all preprocessor directives until it returns a real token. Using the specific Lexer (i.e. CurLexer->Lex) makes it possible to stop skipping after an #include or #pragma hdrstop. Previously the skipping code was only handling CurLexer, now all will be handled correctly. Fixes: llvm.org/PR41585 Differential Revision: https://reviews.llvm.org/D61217 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359506 91177308-0d34-0410-b5e6-96231b3b80d8