summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Remove redundant checkGeorge Karpenkov2018-02-271-2/+0
| | | | | | | | There is no point in assigning void just to crash on it in the next line Differential Revision: https://reviews.llvm.org/D43802 llvm-svn: 326234
* [analyzer] Only attempt to get the value of locations of known typeGeorge Karpenkov2018-02-272-1/+9
| | | | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=36474 In general, getSVal API should be changed so that it does not crash on some non-obvious conditions. It should either be updated to require a type, or to return Optional<SVal>. Differential Revision: https://reviews.llvm.org/D43801 llvm-svn: 326233
* [analyzer] Quickfix: don't crash when runtime definition is not available.George Karpenkov2018-02-271-3/+5
| | | | llvm-svn: 326230
* [analyzer] Logging test quickfix #2.George Karpenkov2018-02-271-3/+2
| | | | llvm-svn: 326229
* [clang-format] Format operator key in protosKrasimir Georgiev2018-02-273-0/+27
| | | | | | | | | | Summary: This fixes a glitch where ``operator: value`` in a text proto would mess up the underlying formatting since it gets parsed as a kw_operator instead of an identifier. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43830 llvm-svn: 326227
* Handle the NetBSD case in ToolChain::getOSLibName()Kamil Rytarowski2018-02-271-0/+2
| | | | | | | | | Return a new CompilerRT Path on NetBSD: "netbsd", instead of getOS(), which returns a string like "netbsd8.9.12". Sponsored by <The NetBSD Foundation> llvm-svn: 326219
* [OPENMP] Allow multiple mappings for member expressions for pointers.Alexey Bataev2018-02-274-11/+33
| | | | | | | If several member expressions are mapped and they reference the same address as a base, but access different members, this must be allowed. llvm-svn: 326212
* [clang-format] Tidy up new API guessLanguage()Ben Hamilton2018-02-272-32/+13
| | | | | | | | | | | | | | | | | | Summary: This fixes a few issues djasper@ brought up in his review of D43522. Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43598 llvm-svn: 326205
* Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return ↵Roman Lebedev2018-02-2714-120/+108
| | | | | | | | | | | | std::unique_ptr<>" This reverts commit rL326201 This broke gcc4.8 builds, compiler just segfaults:¬ http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/14909¬ http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/22673¬ llvm-svn: 326204
* [Tooling] [0/1] Refactor FrontendActionFactory::create() to return ↵Roman Lebedev2018-02-2714-108/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | std::unique_ptr<> Summary: Noticed during review of D41102. I'm not sure whether there are any principal reasons why it returns raw owning pointer, or it is just a old code that was not updated post-C++11. I'm not too sure what testing i should do, because `check-all` is not error clean here for some reason, but it does not //appear// asif those failures are related to these changes. This is clang part. Clang-tools-extra part is D43780. Reviewers: klimek, bkramer, alexfh, pcc Reviewed By: alexfh Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D43779 llvm-svn: 326201
* AttrDocs.td: fix some bad code-blocksHans Wennborg2018-02-271-20/+20
| | | | llvm-svn: 326195
* AttrDocs.td: fix bad bullet listHans Wennborg2018-02-271-5/+5
| | | | llvm-svn: 326194
* AttrDocs.td: fix bad indent and code blockHans Wennborg2018-02-271-6/+7
| | | | llvm-svn: 326193
* clang-format: use AfterControlStatement to format ObjC control blocksFrancois Ferrand2018-02-274-5/+17
| | | | | | | | | | | | | | | | | | ObjC defines `@autoreleasepool` and `@synchronized` control blocks. These used to be formatted according to the `AfterObjCDeclaration` brace- wrapping flag, which is not very consistent. This patch changes the behavior to use the `AfterControlStatement` flag instead. This should not affect the behavior unless a custom brace wrapping mode is used. Reviewers: krasimir, djasper, klimek, benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43232 llvm-svn: 326192
* clang-format: fix formatting of ObjC @synchronized blocksFrancois Ferrand2018-02-272-0/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: The blocks used to be formatted using the "default" behavior, and would thus be mistaken for function calls followed by blocks: this could lead to unexpected inlining of the block and extra line-break before the opening brace. They are now formatted similarly to `@autoreleasepool` blocks, as expected: @synchronized(self) { f(); } Reviewers: krasimir, djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43114 llvm-svn: 326191
* [test] Extend the Driver/mingw-msvcrt.c test with a -SAME check. NFC.Martin Storsjo2018-02-271-1/+2
| | | | llvm-svn: 326180
* [RecordLayout] Don't align to non-power-of-2 sizes when using -mms-bitfieldsMartin Storsjo2018-02-272-1/+8
| | | | | | | | | | | | | | | | | | | | When targeting GNU/MinGW for i386, the size of the "long double" data type is 12 bytes (while it is 8 bytes in MSVC). When building with -mms-bitfields to have struct layouts match MSVC, data types are laid out in a struct with alignment according to their size. However, this doesn't make sense for the long double type, since it doesn't match MSVC at all, and aligning to a non-power-of-2 size triggers other asserts later. This matches what GCC does, aligning a long double to 4 bytes in structs on i386 even when -mms-bitfields is specified. This fixes asserts when using the max_align_t data type when building for MinGW/i386 with the -mms-bitfields flag. Differential Revision: https://reviews.llvm.org/D43734 llvm-svn: 326173
* [Driver] Fix codeview-column-info on macOSShoaib Meenai2018-02-271-2/+1
| | | | | | | | | | | macOS home directory paths begin with /Users, and clang-cl interprets the /U portion as a macro undefine rather than a path, causing test failures on macOS. Use a -- to explicitly treat the input file as a path and fix the test. This effectively reverts r326168 and adds an alternative fix. llvm-svn: 326171
* Attempt to fix greendragon bot after r326141Adam Nemet2018-02-271-0/+1
| | | | llvm-svn: 326168
* [analyzer] Fix an uninitialized field.Artem Dergachev2018-02-271-0/+1
| | | | | | Found by the analyzer! llvm-svn: 326165
* [Driver] Allow using a canonical form of '-fuse-ld=' when cross-compiling on ↵Igor Kudrin2018-02-273-2/+27
| | | | | | | | | | Windows. clang used to require adding an ".exe" suffix when targeting ELF systems on Windows. Differential Revision: https://reviews.llvm.org/D43621 llvm-svn: 326164
* [analyzer] Switch the default exploration strategy to priority queue based ↵George Karpenkov2018-02-275-6/+11
| | | | | | | | | | on coverage After the investigation it seems safe to flip the switch. Differential Revision: https://reviews.llvm.org/D43782 llvm-svn: 326157
* [analyzer] Logging test typo quickfix.George Karpenkov2018-02-271-1/+1
| | | | llvm-svn: 326156
* [analyzer] Logging test quickfix.George Karpenkov2018-02-271-2/+1
| | | | llvm-svn: 326155
* Revert "Revert "[analyzer] Quickfix: do not overflow in calculating offset ↵George Karpenkov2018-02-273-1/+61
| | | | | | | | | | in RegionManager"" This reverts commit c4cc41166d93178a3ddd4b2b5a685cf74a459247. Revert and fix uninitialized read. llvm-svn: 326152
* [Driver] Add SafeStack to a map of incompatible sanitizersPetr Hosek2018-02-272-6/+5
| | | | | | | | | This allows reporting an error when user tries to use SafeStack with incompatible sanitizers. Differential Revision: https://reviews.llvm.org/D43606 llvm-svn: 326151
* [StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2018-02-265-330/+366
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 326146
* Fix which Darwin versions have ObjC runtime with full subscripting support.Volodymyr Sapsai2018-02-262-5/+5
| | | | | | | | | | | | | | | | | Update min deployment target in some tests so that they don't try to link against libarclite and don't fail when it's not available. rdar://problem/29253617 Reviewers: vsk, kubamracek Reviewed By: vsk Subscribers: jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43787 llvm-svn: 326145
* Fix codeview-column-info.c test with a tripleReid Kleckner2018-02-261-3/+3
| | | | llvm-svn: 326144
* Re-land "Emit proper CodeView when -gcodeview is passed without the cl driver."Reid Kleckner2018-02-262-1/+16
| | | | | | | Reverts r326116 and re-lands r326113 with a fix to ASan so that it enables column info in its test suite. llvm-svn: 326141
* [analyzer] Exploration strategy prioritizing unexplored nodes firstGeorge Karpenkov2018-02-265-0/+69
| | | | | | | | | | | | | | See D42775 for discussion. Turns out, just exploring nodes which weren't explored first is not quite enough, as e.g. the first quick traversal resulting in a report can mark everything as "visited", and then subsequent traversals of the same region will get all the pitfalls of DFS. Priority queue-based approach in comparison shows much greater increase in coverage and even performance, without sacrificing memory. Differential Revision: https://reviews.llvm.org/D43354 llvm-svn: 326136
* [analyzer] Do not analyze bison-generated filesGeorge Karpenkov2018-02-262-37/+74
| | | | | | | | | | | | | | | | | | | | | Bison/YACC generated files result in a very large number of (presumably) false positives from the analyzer. These false positives are "true" in a sense of the information analyzer sees: assuming that the lexer can return any token at any point a number of uninitialized reads does occur. (naturally, the analyzer can not capture a complex invariant that certain tokens can only occur under certain conditions). Current fix simply stops analysis on those files. I have examined a very large number of such auto-generated files, and they do all start with such a comment. Conversely, user code is very unlikely to contain such a comment. rdar://33608161 Differential Revision: https://reviews.llvm.org/D43421 llvm-svn: 326135
* Revert "[analyzer] Quickfix: do not overflow in calculating offset in ↵George Karpenkov2018-02-263-60/+1
| | | | | | | | | | RegionManager" This reverts commit df306c4c5ab4a6b8d3c47432346d1f9b90c328b4. Reverting until I can figured out the reasons for failures. llvm-svn: 326131
* [analyzer] Quickfix: do not overflow in calculating offset in RegionManagerGeorge Karpenkov2018-02-263-1/+60
| | | | | | | | | | | | | | Addresses https://bugs.llvm.org/show_bug.cgi?id=36206 rdar://37159026 A proper fix would be much harder, and would involve changing the appropriate code in ExprEngine to be aware of the size limitations of the type used for addressing. Differential Revision: https://reviews.llvm.org/D43218 llvm-svn: 326122
* Revert "Emit proper CodeView when -gcodeview is passed without the cl driver."Zachary Turner2018-02-262-16/+1
| | | | | | | | | | This reverts commit e17911006548518634fad66bb8648bcad49a1d64. This is failing on ASAN bots because asan expects column info, and it's also failing on some linux bots for unknown reasons which i need to investigate. llvm-svn: 326116
* Emit proper CodeView when -gcodeview is passed without the cl driver.Zachary Turner2018-02-262-1/+16
| | | | | | | | | | | Windows debuggers don't work properly when column info is emitted with lines. We handled this by checking if the driver mode was cl, but it's possible to cause the gcc driver to emit codeview as well, and in that path we were emitting column info with codeview. Differential Revision: https://reviews.llvm.org/D43700 llvm-svn: 326113
* Fix for LLVM r326109David Zarzycki2018-02-261-2/+4
| | | | llvm-svn: 326110
* [Driver] Forward opt-remark hotness threshold to LTOAdam Nemet2018-02-262-1/+14
| | | | llvm-svn: 326108
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-2612-7/+70
| | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. This vendor extension to DWARF v5 allows source text to be embedded directly in the line tables of the debug line section. Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates that source should be passed through to LLVM during CodeGen. Differential Revision: https://reviews.llvm.org/D42766 llvm-svn: 326102
* [CodeGen][DebugInfo] Refactor duplicated code, NFCScott Linder2018-02-261-6/+2
| | | | llvm-svn: 326099
* Re-land: "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-267-185/+186
| | | | | | | | | | | | | | | | | | | | | This patch removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h. This change is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its default seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching and is used by the DWARF accelerator tables. Because some test were implicitly relying on the hash order, I've reverted to using zero as a seed for the following two files: lld/include/lld/Core/SymbolTable.h llvm/lib/Support/StringMap.cpp Differential revision: https://reviews.llvm.org/D43615 llvm-svn: 326091
* Re-commit r324991 "Fix for PR32992. Static const classes not exported."Hans Wennborg2018-02-262-3/+41
| | | | | | | | | | | | | Fix for PR32992. Static const classes not exported. Patch by zahiraam! (This re-lands the commit, but using S.MarkVariableReferenced instead of S.PendingInstantiations.push_back, and with an additional test.) Differential Revision: https://reviews.llvm.org/D42968 llvm-svn: 326089
* Resolve build bot problems in unittests/Format/FormatTest.cppBjorn Pettersson2018-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Make the new GetStyleWithEmptyFileName test case independent of the file system used when running the test. Since the test is supposed to use the fallback "Google" style we now use a InMemoryFileSystem to make sure that we do not accidentaly find a .clang-format file in the real file system. That could for example happen when having the build directory inside the llvm och clang repo (as there is a .clang-format file inside the repos). Reviewers: vsapsai, jolesiak, krasimir, benhamilton Reviewed By: krasimir Subscribers: uabelho, twoh, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43732 llvm-svn: 326086
* Explicitly initialize ForceEnableInt128 to avoid UBIlya Biryukov2018-02-261-1/+1
| | | | | | This fixes an uninitialized value read found by msan. llvm-svn: 326083
* Revert "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-267-186/+185
| | | | | | | | | | | | | It looks like some of our tests depend on the ordering of hashed values. I'm reverting my changes while I try to reproduce and fix this locally. Failing builds: lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/18388 lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/6743 lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/15607 llvm-svn: 326082
* [Support] Replace HashString with djbHash.Jonas Devlieghere2018-02-267-185/+186
| | | | | | | | | | | | | | | This removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h This is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching. https://reviews.llvm.org/D43615 (cherry picked from commit 77f7f965bc9499a9ae768a296ca5a1f7347d1d2c) llvm-svn: 326081
* [www] Update link to analyzer's "Building a Checker in 24 hours" videoDevin Coughlin2018-02-263-4/+4
| | | | | | The video is now uploaded to YouTube. llvm-svn: 326062
* When diagnosing the arguments to alloc_size, report the failing argument ↵Aaron Ballman2018-02-252-29/+15
| | | | | | | | using a 1-based index instead of a 0-based index for consistency. Patch by Joel Denny. llvm-svn: 326058
* Fix a failing assertion with the pointer_with_type_tag attribute when the ↵Aaron Ballman2018-02-252-4/+7
| | | | | | | | function the attribute appertains to is variadic. Patch by Joel Denny. llvm-svn: 326057
* Switch the default behavior of the Clang<> spelling to opt-in to the C2x ↵Aaron Ballman2018-02-251-125/+125
| | | | | | | | attribute spellings. NFC to the attribute spellings themselves. The Clang<> spelling helper generates a spelling for C++11, GNU, and C2x attribute spellings. Previously, users had to manually opt in to the C2x spelling while we cautiously added attributes to that spelling. Now that majority of attributes are exposed in C2x, we can switch the default. llvm-svn: 326055
OpenPOWER on IntegriCloud