summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselvesKristof Umann2018-10-112-25/+60
| | | | | | | | | | | I've added a new functionality, the checker is now able to detect and report fields pointing to themselves. I figured this would fit well into the checker as there's no reason for a pointer to point to itself instead of being nullptr. Differential Revision: https://reviews.llvm.org/D51305 llvm-svn: 344242
* [tests] Include Python binding tests in CMake rulesMichal Gorny2018-10-112-0/+8
| | | | | | | | | Add a new CMake rule check-clang-python to run the Python bindings' test suite, and include it in check-all. Differential Revision: https://reviews.llvm.org/D52840 llvm-svn: 344241
* [python] [tests] Support overriding library path via environmentMichal Gorny2018-10-1118-2/+86
| | | | | | | | | | | | | | | | | Support a new CLANG_LIBRARY_PATH environment variable for the Python binding tests. This variable can be used to force the bindings to load libclang.* from a specific directory. I plan to use this when integrating Python binding tests with the CMake build system. Currently, those tests load libclang.so from default search paths, so I would have to rely on platform-specific mechanics such as LD_LIBRARY_PATH. Instead of copying the whole logic necessary to handle platform differences into yet another place, it's easier to just add a dedicated variable for this purpose. Differential Revision: https://reviews.llvm.org/D52806 llvm-svn: 344240
* [InstCombine] Demand bits of UMinDavid Green2018-10-112-9/+13
| | | | | | | | | | This is the umin alternative to the umax code from rL344237. We use DeMorgans law on the umax case to bring us to the same thing on umin, but using countLeadingOnes, not countLeadingZeros. Differential Revision: https://reviews.llvm.org/D53036 llvm-svn: 344239
* [RISCV] Re-generate test/CodeGen/RISCV/vararg.ll after r344142Alex Bradbury2018-10-111-34/+32
| | | | | | The improved load-store forwarding committed in r344142 broke this test. llvm-svn: 344238
* [InstCombine] Demand bits of UMaxDavid Green2018-10-112-25/+23
| | | | | | | | | Use the demanded bits of umax(A,C) to prove we can just use A so long as the lowest non-zero bit of DemandMask is higher than the highest non-zero bit of C Differential Revision: https://reviews.llvm.org/D53033 llvm-svn: 344237
* [InstCombine] Add tests for demand bits of min/max. NFC.David Green2018-10-111-0/+256
| | | | llvm-svn: 344236
* [tblgen][CodeGenSchedule] Add a check for invalid RegisterFile definitions ↵Andrea Di Biagio2018-10-112-6/+9
| | | | | | with zero physical registers. llvm-svn: 344235
* clang-cl: Add /showFilenames option (PR31957)Hans Wennborg2018-10-115-0/+42
| | | | | | | | | | | Add a /showFilenames option for users who want clang to echo the currently compiled filename. MSVC does this echoing by default, and it's useful for showing progress in build systems that doesn't otherwise provide any progress report, such as MSBuild. Differential Revision: https://reviews.llvm.org/D52773 llvm-svn: 344234
* [LV] Use SmallVector instead of DenseMap in calculateRegisterUsage (NFC).Florian Hahn2018-10-111-5/+4
| | | | | | | | | | | | | | We assign indices sequentially for seen instructions, so we can just use a vector and push back the seen instructions. No need for using a DenseMap. Reviewers: hsaito, rengolin, nadav, dcaballe Reviewed By: rengolin Differential Revision: https://reviews.llvm.org/D53089 llvm-svn: 344233
* [LV] Ignore more debug info.Florian Hahn2018-10-111-2/+2
| | | | | | | | | | | | | | | We can avoid doing some unnecessary work by skipping debug instructions in a few loops. It also helps to ensure debug instructions do not prevent vectorization, although I do not have any concrete test cases for that. Reviewers: rengolin, hsaito, dcaballe, aprantl, vsk Reviewed By: rengolin, dcaballe Differential Revision: https://reviews.llvm.org/D53091 llvm-svn: 344232
* [compiler-rt][ubsan] Split Implicit Integer Truncation Sanitizer into ↵Roman Lebedev2018-10-1117-44/+849
| | | | | | | | | | | | | | | | unsigned and signed checks Summary: This is compiler-rt part. clang part is D50901. Reviewers: rsmith, vsk, filcab, Sanitizers Reviewed by: filcab Differential Revision: https://reviews.llvm.org/D50902 llvm-svn: 344231
* [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and ↵Roman Lebedev2018-10-1113-65/+445
| | | | | | | | | | | | | | | | | | | | signed checks Summary: As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`: * A check when both of the types are unsigned. * Another check for the other cases (either one of the types is signed, or both of the types is signed). This is clang part. Compiler-rt part is D50902. Reviewers: rsmith, vsk, Sanitizers Reviewed by: rsmith Differential Revision: https://reviews.llvm.org/D50901 llvm-svn: 344230
* [profile] Fix the gcov tests after the patch in D49853 landed.Calixte Denizet2018-10-1114-19/+19
| | | | | | | | | | | | | | | | Summary: The goal of the patch in D49853 is to display counter on the line of function definition. So some tests need to be fixed. Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: sylvestre.ledru, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49854 llvm-svn: 344229
* [gcov] Display the hit counter for the line of a function definitionCalixte Denizet2018-10-111-0/+6
| | | | | | | | | | | | | | | | | Summary: Right now there is no hit counter on the line of function. So the idea is add the line of the function to all the lines covered by the entry block. Tests in compiler-rt/profile will be fixed in another patch: https://reviews.llvm.org/D49854 Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: sylvestre.ledru, llvm-commits Differential Revision: https://reviews.llvm.org/D49853 llvm-svn: 344228
* [NFC] Factor out getOrCreateAddRecExpr methodMax Kazantsev2018-10-112-18/+28
| | | | llvm-svn: 344227
* [ELF] - Set sh_info and sh_link for .rela.plt sections.George Rimar2018-10-115-10/+18
| | | | | | | | | | | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=37538, Currently, LLD may set both sh_link and sh_info for .rela.plt section to zero when we have only .rela.iplt section part used. ELF spec (https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html) says that for SHT_REL and SHT_RELA, sh_link references the associated symbol table and sh_info the "section to which the relocation applies." When we set the sh_link field, for the regular case we use the .dynsym index. For .rela.iplt sections, it is unclear what is the associated symbol table, because R_*_RELATIVE relocations do not use symbol names and we might have no .dynsym section at all so this patch uses .symtab section index. Differential revision: https://reviews.llvm.org/D52830 llvm-svn: 344226
* Fix the qualification of `IntrusiveRefCntPtr` to use `llvm::`.Chandler Carruth2018-10-111-2/+4
| | | | | | | | Without this, the code only compiled if the header was included after something introduced the alias from `clang::` to `llvm::` for this type. Any modules build would fail here. llvm-svn: 344225
* [X86][BMI1]: X86DAGToDAGISel: select BEXTR from x & ~(-1 << nbits) patternRoman Lebedev2018-10-113-161/+164
| | | | | | | | | | | | | | | | | | Summary: As discussed in D48491, we can't really do this in the TableGen, since we need to produce *two* instructions. This only implements one single pattern. The other 3 patterns will be in follow-ups. I'm not sure yet if we want to also fuse shift into here (i.e `(x >> start) & ...`) Reviewers: RKSimon, craig.topper, spatel Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D52304 llvm-svn: 344224
* [IndVars] Drop "exact" flag from lshr and udiv when substituting their argsMax Kazantsev2018-10-112-0/+108
| | | | | | | | | | | | There is a transform that may replace `lshr (x+1), 1` with `lshr x, 1` in case if it can prove that the result will be the same. However the initial instruction might have an `exact` flag set, and it now should be dropped unless we prove that it may hold. Incorrectly set `exact` attribute may then produce poison. Differential Revision: https://reviews.llvm.org/D53061 Reviewed By: sanjoy llvm-svn: 344223
* [llvm-nm] Include the text "@FILE" in the output of --helpMartin Storsjo2018-10-113-0/+11
| | | | | | | | | | libtool requires this text to be present, in order to conclude that the tool supports response files. Also add an explicit test of using response files with llvm-nm. Differential Revision: https://reviews.llvm.org/D53064 llvm-svn: 344222
* Add a test that shows what happens with throwing destructors. NFC.Marshall Clow2018-10-111-0/+11
| | | | llvm-svn: 344220
* [CMake] Temporarily remove the LLVM_ENABLE_IDE optionChris Bieneman2018-10-111-6/+10
| | | | | | All uses of this option have been removed, and the intent is to change the purpose and default value of this option. To prevent it from having impacts on users, this patch temporarily removes the option and purges it from CMake caches. In a few days, once this has propagated to contributors I will re-introduce the option with the new default value. llvm-svn: 344219
* [CMake] Unconditionally add .h and .td files to target sourcesChris Bieneman2018-10-111-9/+8
| | | | | | | | Previously adding header and table gen files was conditional on using an IDE. Since these files have the `HEADER_FILE_ONLY` attribute applied they are ignored as sources by all non-IDE generators, so there is really no reason not to include them. Additionally having the CMake always include these files allows the CMake-server to include them in the sources list for targets, which is valuable to anyone using CMake-server integrated tools. llvm-svn: 344218
* [Coverage] Apply filtered paths to summaryChris Bieneman2018-10-111-1/+2
| | | | | | | | | | | | | | | Summary: The script to generate code coverage reports supports passing filter paths to llvm-cov when generating the HTML reports, but doesn't pass those paths to the summary generation as well. This results in a summary report that doesn't match the HTML report. This patch addresses the problem by also passing the filter paths to the summary report generation. Reviewers: vsk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53110 llvm-svn: 344217
* Use fully qualified namespace name.Zachary Turner2018-10-111-5/+6
| | | | | | | | | | llvm::detail is not the only namespace named detail. So if someone has done a `using namespace llvm::support`, for example, this will fail with an ambiguous namespace name. Granted people generally shouldn't be using large namespaces like that, but it's common at local function scopes. llvm-svn: 344216
* Use C++03 friendly version of alignofEric Fiselier2018-10-111-1/+1
| | | | llvm-svn: 344215
* Fix use of removed _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETEEric Fiselier2018-10-111-1/+1
| | | | | | | It was replaced with the better named _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE. llvm-svn: 344214
* [hwasan] extend the stack-uar testKostya Serebryany2018-10-111-6/+20
| | | | llvm-svn: 344213
* Eliminate dependency to formatv(). NFC.Fangrui Song2018-10-111-3/+3
| | | | llvm-svn: 344212
* [WebAssembly][NFC] Use intrinsic dag nodes directlyThomas Lively2018-10-113-70/+14
| | | | | | | | | | | | Summary: Instead of custom lowering to WebAssemblyISD nodes first. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D53119 llvm-svn: 344211
* [hwasan] more compact printing for 'Previosly allocated frames'Kostya Serebryany2018-10-111-4/+11
| | | | llvm-svn: 344210
* Upstreaming the BridgeOS device support and the Jason Molenda2018-10-1119-35/+714
| | | | | | | | | | | | | | | LC_BUILD_VERSION load command handling - this commit is a combination of patches by Adrian Prantl and myself. llvm::Triple::BridgeOS isn't defined yet, so all references to that are currently commented out. Also update Xcode project file to build the NativePDB etc plugins. <rdar://problem/43353615> llvm-svn: 344209
* Update libc++abi's detection of aligned allocation after r344207.Eric Fiselier2018-10-112-4/+4
| | | | llvm-svn: 344208
* Distinguish between library and language support for aligned allocation.Eric Fiselier2018-10-114-29/+33
| | | | | | | | | | | | | | | | | | | | There are two cases: 1. The library has all it needs to provide align_val_t and the new/delete overloads needed to support aligned allocation. 2. The compiler has actually turned the language feature on. There are times where libc++ needs to distinguish between the two. This patch adds the additional macro _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION which denotes when case (1) does not hold. _LIBCPP_HAS_NO_ALIGNED_ALLOCATION is defined whenever _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION is defined, or when the compiler has not enabled the language feature. Additionally this patch cleans up a number of other macros related to detection of aligned allocation machinery. llvm-svn: 344207
* [MC][ELF] Fix section_mergeable_size.llFangrui Song2018-10-111-1/+1
| | | | | | | | Some targets use %progbits instead of @progbits. Updating that check with a {{[@%]}}progbits regex to make those bots happy. llvm-svn: 344206
* [WebAssembly] Saturating float-to-int builtinsThomas Lively2018-10-113-0/+111
| | | | | | | | | | | | Summary: Depends on D53007 and D53004. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D53009 llvm-svn: 344205
* [WebAssembly] Saturating float to int intrinsicsThomas Lively2018-10-115-0/+175
| | | | | | | | | | | | | | | | Summary: Although the saturating float to int instructions are already emitted from normal IR, the fpto{s,u}i instructions produce poison values if the argument cannot fit in the result type. These intrinsics are therefore necessary to get guaranteed defined saturating behavior. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D53004 llvm-svn: 344204
* [hwasan] simplify a testKostya Serebryany2018-10-101-5/+5
| | | | llvm-svn: 344203
* llvm-c: Add C APIs to access DebugLoc infoSaleem Abdulrasool2018-10-102-0/+111
| | | | | | | Add thin shims to C interface to provide access to DebugLoc info for Instructions, GlobalVariables and Functions. Patch by Josh Berdine! llvm-svn: 344202
* Update documentation to indicate that profile remapping support is onlyRichard Smith2018-10-101-0/+6
| | | | | | implemented for the new pass manager so far. llvm-svn: 344201
* Add a flag to remap manglings when reading profile data information.Richard Smith2018-10-1016-32/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to preserve profiling information across codebase changes that have widespread impact on mangled names, but across which most profiling data should still be usable. For example, when switching from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI, or even from a 32-bit to a 64-bit build. The user can provide a remapping file specifying parts of mangled names that should be treated as equivalent (eg, std::__1 should be treated as equivalent to std::__cxx11), and profile data will be treated as applying to a particular function if its name is equivalent to the name of a function in the profile data under the provided equivalences. See the documentation change for a description of how this is configured. Remapping is supported for both sample-based profiling and instruction profiling. We do not support remapping indirect branch target information, but all other profile data should be remapped appropriately. Support is only added for the new pass manager. If someone wants to also add support for this for the old pass manager, doing so should be straightforward. This is the LLVM side of Clang r344199. Reviewers: davidxl, tejohnson, dlj, erik.pilkington Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D51249 llvm-svn: 344200
* Add a flag to remap manglings when reading profile data information.Richard Smith2018-10-1013-6/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to preserve profiling information across codebase changes that have widespread impact on mangled names, but across which most profiling data should still be usable. For example, when switching from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI, or even from a 32-bit to a 64-bit build. The user can provide a remapping file specifying parts of mangled names that should be treated as equivalent (eg, std::__1 should be treated as equivalent to std::__cxx11), and profile data will be treated as applying to a particular function if its name is equivalent to the name of a function in the profile data under the provided equivalences. See the documentation change for a description of how this is configured. Remapping is supported for both sample-based profiling and instruction profiling. We do not support remapping indirect branch target information, but all other profile data should be remapped appropriately. Support is only added for the new pass manager. If someone wants to also add support for this for the old pass manager, doing so should be straightforward. llvm-svn: 344199
* [LTO] Account for overriding lib calls via the alias attributeWarren Ristow2018-10-102-5/+80
| | | | | | | | | | | | | Given a library call that is represented as an llvm intrinsic call, but later transformed to an actual call, if an overriding definition of that library routine is provided indirectly via an alias, prevent LTO from eliminating the definition. This is a fix for PR38547. Differential Revision: https://reviews.llvm.org/D52836 llvm-svn: 344198
* [MC][ELF] compute entity size for explicit sectionsNick Desaulniers2018-10-102-25/+28
| | | | | | | | | | | | | | | | | | | | Summary: Global variables might declare themselves to be in explicit sections. Calculate the entity size always to prevent assembler warnings "entity size for SHF_MERGE not specified" when sections are to be marked merge-able. Fixes PR31828. Reviewers: rnk, echristo Reviewed By: rnk Subscribers: llvm-commits, pirama, srhines Differential Revision: https://reviews.llvm.org/D53056 llvm-svn: 344197
* Make a member function private and rename it to avoid function overloading.Rui Ueyama2018-10-102-5/+6
| | | | llvm-svn: 344196
* [ELF] Don't warn on undefined symbols if UnresolvedPolicy::Ignore is usedFangrui Song2018-10-103-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a condition UnresolvedPolicy::Ignore to elf::warnUnorderedSymbol to suppress Sym->isUndefined() warnings from both 1) --symbol-ordering-file= 2) .llvm.call-graph-profile If --unresolved-symbols=ignore-all is used, no "undefined symbol" error/warning is emitted. It makes sense to not warn unorderable symbols. Otherwise, If an executable is linked, the default policy UnresolvedPolicy::ErrorOrWarn will issue a "undefined symbol" error. The unorderable symbol warning is redundant. If a shared object is linked, it is possible that only part of object files are used and some symbols are left undefined. The warning is not very necessary. In particular for .llvm.call-graph-profile, when linking a shared object, a call graph profile may contain undefined symbols. This case generated a warning before but it will be suppressed by this patch. Reviewers: ruiu, davidxl, espindola Reviewed By: ruiu Subscribers: grimar, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D53044 llvm-svn: 344195
* Use TEST_STD_VER instead of __cplusplus [NFC]Aaron Puchert2018-10-1024-24/+49
| | | | | | | | While __cplusplus was only used a few dozen times, TEST_STD_VAR is used more than 2000 times. So we replace the former by the latter for consistency in the tests. There should be no functional change. llvm-svn: 344194
* [hwasan] when reporting a bug, print some very basic information about the ↵Kostya Serebryany2018-10-105-8/+45
| | | | | | heap chunk (in addition to the more detailed info that we may fail to show) llvm-svn: 344193
* Use std::scoped_lock only for C++17 and newerAaron Puchert2018-10-101-0/+2
| | | | | | This fixes a test failure caused by D53049. llvm-svn: 344192
OpenPOWER on IntegriCloud