summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [DepInfo] Use isl++ in Dependences::isValidSchedule. NFC.Michael Kruse2018-08-103-41/+29
| | | | | | | Also change StatementToIslMapTy to hold isl::map, because it is used as a parameter. llvm-svn: 339484
* [clangd] Avoid duplicates in findDefinitions responseSimon Marchi2018-08-107-32/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When compile_commands.json contains some source files expressed as relative paths, we can get duplicate responses to findDefinitions. The responses only differ by the URI, which are different versions of the same file: "result": [ { ... "uri": "file:///home/emaisin/src/ls-interact/cpp-test/build/../src/first.h" }, { ... "uri": "file:///home/emaisin/src/ls-interact/cpp-test/src/first.h" } ] In getAbsoluteFilePath, we try to obtain the realpath of the FileEntry by calling tryGetRealPathName. However, this can fail and return an empty string. It may be bug a bug in clang, but in any case we should fall back to computing it ourselves if it happens. I changed getAbsoluteFilePath so that if tryGetRealPathName succeeds, we return right away (a real path is always absolute). Otherwise, we try to build an absolute path, as we did before, but we also call VFS->getRealPath to make sure to get the canonical path (e.g. without any ".." in it). Reviewers: malaperle Subscribers: hokein, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48687 llvm-svn: 339483
* [analyzer] Record nullability implications on getting items from NSDictionaryGeorge Karpenkov2018-08-103-15/+328
| | | | | | | | | | | | | | | | | | | | If we get an item from a dictionary, we know that the item is non-null if and only if the key is non-null. This patch is a rather hacky way to record this implication, because some logic needs to be duplicated from the solver. And yet, it's pretty simple, performant, and works. Other possible approaches: - Record the implication, in future rely on Z3 to pick it up. - Generalize the current code and move it to the constraint manager. rdar://34990742 Differential Revision: https://reviews.llvm.org/D50124 llvm-svn: 339482
* [LICM] Hoist assumes out of loopsPhilip Reames2018-08-102-1/+10
| | | | | | | | If we have an assume which is known to execute and whose operand is invariant, we can lift that into the pre-header. So long as we don't change which paths the assume executes on, this is a legal transformation. It's likely to be a useful canonicalization as other transforms only look for dominating assumes. Differential Revision: https://reviews.llvm.org/D50364 llvm-svn: 339481
* Revert "[NFC] More ConstantMerge refactoring"JF Bastien2018-08-101-25/+22
| | | | | | Sanitizers seem unhappy. llvm-svn: 339480
* Fix unused lambda capture warning from r339472.Eli Friedman2018-08-101-1/+1
| | | | llvm-svn: 339479
* [NFC] More ConstantMerge refactoringJF Bastien2018-08-101-22/+25
| | | | | | This makes my upcoming patch much easier to read. llvm-svn: 339478
* [ELF][HEXAGON] Add R_HEX_8_X relocationSid Manning2018-08-102-0/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D50577 llvm-svn: 339477
* [analyzer] Fix tracking expressions through negation operatorGeorge Karpenkov2018-08-102-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D50537 llvm-svn: 339476
* [analyzer] [NFC] [tests] Move plist-based diagnostics tests to separate ↵George Karpenkov2018-08-1052-63183/+67351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files, use diff instead of a FileCheck Some of the analyzer tests check the exact plist output, in order to verify that the diagnostics produced is correct. Current testing setup has many issues: plist output clobbers tests, making them harder to read it is impossible to debug test failures given error messages from FileCheck. The only recourse is manually creating the files and using the diff again, it is impossible to update the tests given the error message: the only process is a tedious manual one, going from a separate plist file to CHECK directives. This patch offers a much better approach of using "diff" directly in place of FileCheck, and moving tests to separate files. Generated using the following script: ``` import os import glob import re import subprocess diagnostics_key = "// CHECK: <key>diagnostics</key>" def process_file(f, data): idx = data.index(diagnostics_key) plist_out_f = 'ExpectedOutputs/plists/%s.plist' % f plist_out_folder = os.path.join('ExpectedOutputs/plists/', os.path.dirname(f)) plist_data = data[idx:] plist_data = plist_data.replace('// CHECK: ', '') plist_data = plist_data.replace('// CHECK-NEXT: ', '') plist_data += "</dict>\n</plist>\n" data = data[:idx] ptn = re.compile("FileCheck --?input-file(=| )(%t|%t\.plist) %s") if not ptn.findall(data): print "none found =/ skipping..." return data = ptn.sub(lambda m: "tail -n +11 %s | diff -u -w - %%S/../%s" % (m.group(2), plist_out_f), data) with open(f, 'w') as out_f: out_f.write(data) subprocess.check_call(["mkdir", "-p", plist_out_folder]) with open(plist_out_f, 'w') as out_f: out_f.write(plist_data) def main(): files = glob.glob("**/*.*") for f in files: with open(f) as f_handler: data = f_handler.read() if diagnostics_key in data: print "Converting %s" %f process_file(f, data) if __name__ == "__main__": main() ``` Differential Revision: https://reviews.llvm.org/D50545 llvm-svn: 339475
* [WebAssembly] Added default stack-only instruction mode for MC.Wouter van Oortmerssen2018-08-1092-426/+852
| | | | | | | | | | | | | | | | | | | | | | | Summary: Moved Explicit Locals pass to last. Made that pass obligatory. Made it convert from register to stack based instructions, and removed the registers. Fixes to related code that was expecting register based instructions. Added the correct testing flag to all tests, depending on what the format they were expecting so far. Translated one test to stack format as example: reg-stackify-stack.ll tested: llvm-lit -v `find test -name WebAssembly` unittests/MC/* Reviewers: dschuff, sunfish Subscribers: jfb, llvm-commits, aheejin, eraman, jgravelle-google, sbc100 Differential Revision: https://reviews.llvm.org/D50568 llvm-svn: 339474
* Remove copy-pasted and unrelated comment [NFC]Raphael Isemann2018-08-101-2/+0
| | | | | | | | | That comment was copied from the CombineConsecutiveEntriesWithEqualData() implementation below, and doesn't actually describe what's happening in the current function. llvm-svn: 339473
* [ARM] Adjust AND immediates to make them cheaper to select.Eli Friedman2018-08-1010-28/+172
| | | | | | | | | | | | | | | | | | | | | | | LLVM normally prefers to minimize the number of bits set in an AND immediate, but that doesn't always match the available ARM instructions. In Thumb1 mode, prefer uxtb or uxth where possible; otherwise, prefer a two-instruction sequence movs+ands or movs+bics. Some potential improvements outlined in ARMTargetLowering::targetShrinkDemandedConstant, but seems to work pretty well already. The ARMISelDAGToDAG fix ensures we don't generate an invalid UBFX instruction due to a larger-than-expected mask. (It's orthogonal, in some sense, but as far as I can tell it's either impossible or nearly impossible to reproduce the bug without this change.) According to my testing, this seems to consistently improve codesize by a small amount by forming bic more often for ISD::AND with an immediate. Differential Revision: https://reviews.llvm.org/D50030 llvm-svn: 339472
* [MS Demangler] Support extern "C" functions.Zachary Turner2018-08-102-34/+56
| | | | | | | | | | | | | | There are two cases we need to support with extern "C" functions. The first is the case of a '9' indicating that the function has no prototype. This occurs when we mangle a symbol inside of an extern "C" function, but not the function itself. The second case is when we have an overloaded extern "C" functions. In this case we emit $$J0 to indicate this. This patch adds support for both of these cases. llvm-svn: 339471
* [InstCombine] add tests for fsub factorization; NFCSanjay Patel2018-08-101-10/+84
| | | | | | | | The tests show that; 1. The fold doesn't fire for vectors, but it should. 2. The fold fires regardless of uses, but it shouldn't. llvm-svn: 339470
* [InstCombine] rearrange code for foldSelectBinOpIdentity; NFCISanjay Patel2018-08-101-21/+25
| | | | | | | | | | | | | This is a retry of rL339439 with a fix for the problem that caused the original commit to be reverted at rL339446. That problem was that the compare can be integer while the binop is FP or vice-versa, so we need to use the binop type when we ask for the identity constant. A test to guard against the problem was added at rL339453. llvm-svn: 339469
* [llvm-mca] Make InstrBuilder::getOrCreateInstrDesc private. NFC.Matt Davis2018-08-101-1/+2
| | | | llvm-svn: 339468
* [InstCombine] add tests to show disabling of libcall/intrinsic shrinking; NFCSanjay Patel2018-08-101-5/+44
| | | | llvm-svn: 339467
* Resubmit r339450 - [MS Demangler] Add conversion operator testsZachary Turner2018-08-101-1/+31
| | | | | | | | | This was broken because of a malformed check line. Incidentally, this exposed a case where we crash when we should just be returning an error, so we should fix that. The demangler shouldn't crash due to user input. llvm-svn: 339466
* [MS Demangler] Demangle cv qualifiers on template args.Zachary Turner2018-08-102-14/+18
| | | | | | | | | | | | | Before we wouldn't properly demangle something like Foo<const int>. Template args have a special escape sequence '$$C' that is optional, but if it is present contains qualifiers. So we need to check for this and only if it present, demangle qualifiers before demangling the type. With this fix, we re-enable some tests that were previously marked FIXME. llvm-svn: 339465
* AMDGPU: More canonicalized operationsMatt Arsenault2018-08-103-1/+40
| | | | llvm-svn: 339464
* revert r339450 - [MS Demangler] Add conversion operator testsSanjay Patel2018-08-101-31/+1
| | | | | | | | Something here causes an assertion failure that killed a bunch of bots. Example: http://lab.llvm.org:8011/builders/reverse-iteration/builds/7021/steps/check_all/logs/stdio llvm-svn: 339463
* AMDGPU: Combine and of seto/setuo and fp_classMatt Arsenault2018-08-103-6/+104
| | | | | | Clear the nan (or non-nan) test bits from the mask. llvm-svn: 339462
* AMDGPU: Turn class x, p_zero|n_zero into fcmp oeq x, 0Matt Arsenault2018-08-102-0/+16
| | | | | | The library does use this for some reason. llvm-svn: 339461
* AMDGPU: Match isfinite pattern to class instructionsMatt Arsenault2018-08-102-7/+35
| | | | llvm-svn: 339460
* Invalidate static locals when escaping lambdasGeorge Karpenkov2018-08-102-0/+57
| | | | | | | | | | Lambdas can affect static locals even without an explicit capture. rdar://39537031 Differential Revision: https://reviews.llvm.org/D50368 llvm-svn: 339459
* AMDGPU: Add LLVM_FALLTHROUGHMatt Arsenault2018-08-101-0/+2
| | | | llvm-svn: 339458
* [tests, libstdcxx] Add missing test category on the ↵Stella Stamenova2018-08-101-0/+1
| | | | | | | | TestDataFormatterStdUniquePtr tests Each test needs to be marked with the add_test_categories decorator individually. llvm-svn: 339457
* Allow relockable scopes with thread safety attributes.Aaron Ballman2018-08-102-14/+216
| | | | | | Patch by Aaron Puchert llvm-svn: 339456
* Update the coding standards and developer policy documentation surrounding ↵Aaron Ballman2018-08-103-3/+16
| | | | | | | | whitespace. Clarify that you should not introduce trailing whitespace when making a commit and that you should not remove trailing whitespace that's unrelated to code you are changing or are about to change. Then clarified the developer policy around what is considered an obvious whitespace commit. llvm-svn: 339455
* [clangd] extend the publishDiagnostics response to send back fixits to theAlex Lorenz2018-08-105-1/+50
| | | | | | | | | | | | | | client if the client supports this extension This commit extends the 'textDocument/publishDiagnostics' notification sent from Clangd to the client. When it's enabled, Clangd sends out the fixits associated with the appropriate diagnostic in the body of the 'publishDiagnostics' notification. The client can enable this extension by setting 'clangdFixSupport' to true in the textDocument capabilities during initialization. Differential Revision: https://reviews.llvm.org/D50415 llvm-svn: 339454
* [InstCombine] add/update tests for selectBinOpIdentity; NFCSanjay Patel2018-08-101-18/+37
| | | | | | | | | This includes a test that would have exposed the bug in rL339439 which was reverted at rL339446. The compare can be integer while the binop is FP or vice-versa, so we need to use the binop type when we ask for the identity constant. llvm-svn: 339453
* Make changes to the check strings so that the test I modified in r339438Akira Hatanaka2018-08-101-3/+3
| | | | | | passes on 32-bit targets. llvm-svn: 339452
* [libcxx] Mark charconv tests as failing for previous libcxx versions.Volodymyr Sapsai2018-08-102-0/+18
| | | | | | | | | | | | | | | <charconv> was added in r338479. Previous libcxx versions don't have this functionality and corresponding tests should be failing. Reviewers: mclow.lists, ldionne, EricWF Reviewed By: ldionne Subscribers: christof, dexonsmith, lichray, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D50543 llvm-svn: 339451
* [MS Demangler] Add conversion operator tests.Zachary Turner2018-08-101-1/+31
| | | | | | | | The mangled names were added in the original commit, but the demangled equivalents weren't, so nothing was actually being checked. llvm-svn: 339450
* [hwasan] Remove liblog dependency.Evgeniy Stepanov2018-08-101-1/+0
| | | | | | | | | | | | | | | | HWASan will not run on older Android releases where we use __android_log_write for logging. This dependency is also harmful in the case when libc itself depends on hwasan, because it creates a loop of libc -> hwasan -> liblog -> libc which makes liblog vs libc initialization order undetermined. Without liblog the loop is just libc -> hwasan -> libc and any init order issues can be solved in hwasan. llvm-svn: 339449
* [llvm-objcopy] NFC: consistently use typename ELFT::<X> definitions in headersJordan Rupprecht2018-08-102-6/+6
| | | | llvm-svn: 339448
* [hwasan] Add -hwasan-with-ifunc flag.Evgeniy Stepanov2018-08-102-6/+49
| | | | | | | | | | | | Summary: Similar to asan's flag, it can be used to disable the use of ifunc to access hwasan shadow address. Reviewers: vitalybuka, kcc Subscribers: srhines, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D50544 llvm-svn: 339447
* [InstCombine] revert r339439 - rearrange code for foldSelectBinOpIdentitySanjay Patel2018-08-101-25/+21
| | | | | | | That was supposed to be NFC, but it exposed a logic hole somewhere that caused bots to fail. llvm-svn: 339446
* [InstCombine][NFC] Added tests for select with binop foldDavid Bolvansky2018-08-101-39/+272
| | | | llvm-svn: 339441
* RichManglingContext: Make m_ipd_str_len a local variable and simplify ↵Stefan Granitz2018-08-104-42/+39
| | | | | | processIPDStrResult + polishing in test and Mangled llvm-svn: 339440
* [InstCombine] rearrange code for foldSelectBinOpIdentity; NFCISanjay Patel2018-08-101-21/+25
| | | | | | | This should make it easier to folow and to add the planned enhancements such as D50190. llvm-svn: 339439
* [CodeGen] Merge equivalent block copy/helper functions.Akira Hatanaka2018-08-1027-241/+560
| | | | | | | | | | | | | | | | | | | | | | | Clang generates copy and dispose helper functions for each block literal on the stack. Often these functions are equivalent for different blocks. This commit makes changes to merge equivalent copy and dispose helper functions and reduce code size. To enable merging equivalent copy/dispose functions, the captured object infomation is encoded into the helper function name. This allows IRGen to check whether an equivalent helper function has already been emitted and reuse the function instead of generating a new helper function whenever a block is defined. In addition, the helper functions are marked as linkonce_odr to enable merging helper functions that have the same name across translation units and marked as unnamed_addr to enable the linker's deduplication pass to merge functions that have different names but the same content. rdar://problem/42640608 Differential Revision: https://reviews.llvm.org/D50152 llvm-svn: 339438
* [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefixRoman Lebedev2018-08-103-28/+48
| | | | | | | | | | | | | | | | | | | | Summary: Currently, there is two configured prefixes: `CHECK-FIXES` and `CHECK-MESSAGES` `CHECK-MESSAGES` checks that there are no test output lines with `warning:|error:`, which are not explicitly handled in lit tests. However there does not seem to be a nice way to enforce for all the `note:` to be checked. This was useful for me when developing D36836. Reviewers: alexfh, klimek, aaron.ballman, hokein Reviewed By: alexfh, aaron.ballman Subscribers: JonasToth, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D36892 llvm-svn: 339437
* [MS Demangler] Properly demangle conversion operators.Zachary Turner2018-08-102-20/+65
| | | | | | | These were completely broken before. We need to handle the 'B' operator tag. llvm-svn: 339436
* [MS Demangler] Disable a couple of tests.Zachary Turner2018-08-101-6/+6
| | | | | | | The check lines are marked FIXME but not the mangled names. This is causing an error. llvm-svn: 339435
* [MS Demangler] Fix several issues related to templates.Zachary Turner2018-08-102-34/+285
| | | | | | | | | | | | These were uncovered when porting the mangling tests in ms-templates.cpp from clang/CodeGenCXX over to demangling tests. The main issues fixed here are surrounding integer literal signed and unsignedness, empty array dimensions, and pointer and reference non-type template parameters. Differential Revision: https://reviews.llvm.org/D50512 llvm-svn: 339434
* [clang-tidy: modernize] modernize-redundant-void-arg crashes when a function ↵Alexander Kornienko2018-08-102-4/+50
| | | | | | | | | | | | body is in a macro Fixes https://bugs.llvm.org/show_bug.cgi?id=28406 Patch by IdrissRio. Differential revision: https://reviews.llvm.org/D49800 llvm-svn: 339433
* [ARM] Disallow zexts in ARMCodeGenPrepareSam Parker2018-08-105-446/+452
| | | | | | | | | | | | | | | | | | | Enabling ARMCodeGenPrepare by default caused a whole load of failures. This is due to zexts and truncs not being handled properly. ZExts are messy so it's just easier to disable for now and truncs are allowed only as 'sinks'. I still need to figure out why allowing them as 'sources' causes so many failures. The other main changes are that we are explicit in the types that we converting to, it's now always 'TypeSize'. Type support is also now performed while checking for valid opcodes as it unnecessarily complicated having the checks are different stages. I've moved the tests around too, so we have the zext and truncs in their own file as well as the overflowing opcode tests. Differential Revision: https://reviews.llvm.org/D50518 llvm-svn: 339432
* [libc++] Enable aligned allocation based on feature test macro, irrespective ↵Louis Dionne2018-08-103-7/+30
| | | | | | | | | | | | | | | | | | | | | of standard Summary: The current code enables aligned allocation functions when compiling in C++17 and later. This is a problem because aligned allocation functions might not be supported on the target platform, which leads to an error at link time. Since r338934, Clang knows not to define __cpp_aligned_new when it's not available on the target platform -- this commit takes advantage of that to only use aligned allocation functions when they are available. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, EricWF, mclow.lists Differential Revision: https://reviews.llvm.org/D50344 llvm-svn: 339431
OpenPOWER on IntegriCloud