summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Turn suppress-c++-stdlib on by defaultAnna Zaks2017-03-102-1/+2
| | | | | | | | | | | | | | | | | We have several reports of false positives coming from libc++. For example, there are reports of false positives in std::regex, std::wcout, and also a bunch of issues are reported in https://reviews.llvm.org/D30593. In many cases, the analyzer trips over the complex libc++ code invariants. Let's turn off the reports coming from these headers until we can re-evalate the support. We can turn this back on once we individually suppress all known false positives and perform deeper evaluation on large codebases that use libc++. We'd also need to commit to doing these evaluations regularly as libc++ headers change. Differential Revision: https://reviews.llvm.org/D30798 llvm-svn: 297429
* Add -cc1 flag -ast-dump-all to perform an AST dump including entities that ↵Richard Smith2017-03-099-34/+65
| | | | | | haven't yet been deserialized. llvm-svn: 297412
* [DebugInfo] Append extended dereferencing mechanism to variables' ↵Konstantin Zhuravlyov2017-03-093-2/+166
| | | | | | | | DIExpression for targets that support more than one address space Differential Revision: https://reviews.llvm.org/D29673 llvm-svn: 297397
* Retry: [ubsan] Detect UB loads from bitfieldsVedant Kumar2017-03-095-7/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | It's possible to load out-of-range values from bitfields backed by a boolean or an enum. Check for UB loads from bitfields. This is the motivating example: struct S { BOOL b : 1; // Signed ObjC BOOL. }; S s; s.b = 1; // This is actually stored as -1. if (s.b == 1) // Evaluates to false, -1 != 1. ... Changes since the original commit: - Single-bit bools are a special case (see CGF::EmitFromMemory), and we can't avoid dealing with them when loading from a bitfield. Don't try to insert a check in this case. Differential Revision: https://reviews.llvm.org/D30423 llvm-svn: 297389
* Remove a useless subsitution in doxygen2rst which was incorrectly replacing ↵Sylvestre Ledru2017-03-092-6/+5
| | | | | | | | | | | | | | | | * by \* Summary: For example, "int\* a;" is displayed instead of "int* a;" Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30740 llvm-svn: 297363
* [coroutines] Fix assertion in DependentCoawaitExpr when the argument is ↵Eric Fiselier2017-03-092-1/+9
| | | | | | | | | | | | | | | | | | | non-dependent. Summary: A `co_await arg` expression has a dependent type whenever the promise type is still dependent, even if the argument to co_await is not. This is because we cannot attempt the `await_transform(<arg>)` until after we know the promise type. This patch fixes an assertion in the constructor of `DependentCoawaitExpr` that asserted that `arg` must also be dependent. Reviewers: rsmith, GorNishanov, aaron.ballman Reviewed By: GorNishanov Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30772 llvm-svn: 297358
* [coroutines] Build and pass coroutine_handle to await_suspendGor Nishanov2017-03-097-60/+226
| | | | | | | | | | | | | | | | Summary: This patch adds passing a coroutine_handle object to await_suspend calls. It builds the coroutine_handle using coroutine_handle<PromiseType>::from_address(__builtin_coro_frame()). (a revision of https://reviews.llvm.org/D26316 that for some reason refuses to apply via arc patch) Reviewers: GorNishanov Subscribers: mehdi_amini, cfe-commits, EricWF Differential Revision: https://reviews.llvm.org/D30769 llvm-svn: 297356
* Add a cmake cache file for a stage-2 build with ThinLTOMehdi Amini2017-03-091-0/+6
| | | | | | | This is intended to be targetted by a Green Dragon stage-2 bot I'm bringing up currently. WIP. llvm-svn: 297351
* Fix handling of -fmodule-map-file=X where X has no directory component.Richard Smith2017-03-092-2/+13
| | | | llvm-svn: 297349
* Revert "[ubsan] Detect UB loads from bitfields"Vedant Kumar2017-03-095-82/+7
| | | | | | | | This reverts commit r297298. It breaks the self-host on this bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/962/steps/build%20clang%2Fubsan/logs/stdio llvm-svn: 297331
* Driver/ToolChains: Remove extra semicolons. NFCKonstantin Zhuravlyov2017-03-093-3/+3
| | | | llvm-svn: 297329
* [analyzer] Extend taint propagation and checking to support LazyCompoundValAnna Zaks2017-03-094-0/+103
| | | | | | | | A patch by Vlad Tsyrklevich! Differential Revision: https://reviews.llvm.org/D28445 llvm-svn: 297326
* [analyzer] Improve usability of ExprInspectionCheckerAnna Zaks2017-03-093-3/+34
| | | | | | | | | | | | | | | | Some of the magic functions take arguments of arbitrary type. However, for semantic correctness, the compiler still requires a declaration of these functions with the correct type. Since C does not have argument-type-overloaded function, this made those functions hard to use in C code. Improve this situation by allowing arbitrary suffixes in the affected magic functions' names, thus allowing the user to create different declarations for different types. A patch by Keno Fischer! Differential Revision: https://reviews.llvm.org/D30589 llvm-svn: 297325
* [analyzer] Add bug visitor for taint checker.Anna Zaks2017-03-092-2/+59
| | | | | | | | | | | | Add a bug visitor to the taint checker to make it easy to distinguish where the tainted value originated. This is especially useful when the original taint source is obscured by complex data flow. A patch by Vlad Tsyrklevich! Differential Revision: https://reviews.llvm.org/D30289 llvm-svn: 297324
* [analyzer] Teach the MallocChecker about about Glib APIAnna Zaks2017-03-092-7/+99
| | | | | | | | A patch by Leslie Zhai! Differential Revision: https://reviews.llvm.org/D28348 llvm-svn: 297323
* Defensively ensure that GetExternalDeclStmt protects itself from nested ↵David Blaikie2017-03-081-0/+3
| | | | | | deserialization llvm-svn: 297322
* [DebugInfo] Add address space when creating DIDerivedTypesKonstantin Zhuravlyov2017-03-084-6/+183
| | | | | | Differential Revision: https://reviews.llvm.org/D29671 llvm-svn: 297321
* Take into account C++17's noexcept function types during merging -- it shouldRichard Smith2017-03-084-2/+31
| | | | | | | be possible to merge a declaration with an unresolved function type against one with a resolved function type. llvm-svn: 297316
* Driver/ToolChains: Mips -> MipsLinuxKonstantin Zhuravlyov2017-03-084-6/+6
| | | | | | | | | - Mips is architecture, not a toolchain - Might help eliminate the confusion in the future by not having header files with the same name Differential Revision: https://reviews.llvm.org/D30753 llvm-svn: 297312
* [scan-build-py] move argument parsing into separate moduleLaszlo Nagy2017-03-081-0/+430
| | | | | | Forgot to add the new module. llvm-svn: 297308
* [scan-build-py] move argument parsing into separate moduleLaszlo Nagy2017-03-085-406/+55
| | | | | | Differential Revision: https://reviews.llvm.org/D30601 llvm-svn: 297307
* [ubsan] Detect UB loads from bitfieldsVedant Kumar2017-03-085-7/+82
| | | | | | | | | | | | | | | | | | | | It's possible to load out-of-range values from bitfields backed by a boolean or an enum. Check for UB loads from bitfields. This is the motivating example: struct S { BOOL b : 1; // Signed ObjC BOOL. }; S s; s.b = 1; // This is actually stored as -1. if (s.b == 1) // Evaluates to false, -1 != 1. ... Differential Revision: https://reviews.llvm.org/D30423 llvm-svn: 297298
* Add missing implementation for AtomicChange::replace(...)Eric Liu2017-03-082-2/+25
| | | | | | | | | | | | | | Summary: Just realized the implementation is missing... Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30735 llvm-svn: 297289
* [analyzer] Clarify 'uninitialized function argument' messagesDaniel Marjamaki2017-03-0813-89/+103
| | | | | | Differential Revision: https://reviews.llvm.org/D30341 llvm-svn: 297283
* Honor __unaligned in codegen for declarations and expressionsRoger Ferrer Ibanez2017-03-087-0/+268
| | | | | | | | | | | This patch honors the unaligned type qualifier (currently available through he keyword __unaligned and -fms-extensions) in CodeGen. In the current form the patch affects declarations and expressions. It does not affect fields of classes. Differential Revision: https://reviews.llvm.org/D30166 llvm-svn: 297276
* Add more examples to clang-format configurationSylvestre Ledru2017-03-082-2/+196
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30734 llvm-svn: 297275
* [clang-format] Look at NoLineBreak and NoLineBreakInOperand before ↵Krasimir Georgiev2017-03-082-3/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | breakProtrudingToken Summary: This patch makes ContinuationIndenter call breakProtrudingToken only if NoLineBreak and NoLineBreakInOperand is false. Previously, clang-format required two runs to converge on the following example with 24 columns: Note that the second operand shouldn't be splitted according to NoLineBreakInOperand, but the token breaker doesn't take that into account: ``` func(a, "long long long long", c); ``` After first run: ``` func(a, "long long " "long long", c); ``` After second run, where NoLineBreakInOperand is taken into account: ``` func(a, "long long " "long long", c); ``` With the patch, clang-format now obtains in one run: ``` func(a, "long long long" "long", c); ``` which is a better token split overall. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30575 llvm-svn: 297274
* [XRay] Use AddCXXStdlibLibArgs. NFCI.Jonas Hahnfeld2017-03-081-4/+3
| | | | | | This function already does the very same thing. llvm-svn: 297271
* clang-format: Get slightly better at understanding */&.Daniel Jasper2017-03-082-1/+3
| | | | | | | | | | Before: void f() { MACRO(A * const a); } After: void f() { MACRO(A *const a); } llvm-svn: 297268
* [scan-build-py] fix some line separator issuesLaszlo Nagy2017-03-082-6/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D30600 llvm-svn: 297266
* [clang-format] Fixed a typo in Format.cpp and a clang-tidy nit about ↵Krasimir Georgiev2017-03-081-3/+3
| | | | | | std::function copying; NFC llvm-svn: 297265
* [test] Unbreak OpenMP/linking.c with arch-specific libdirJonas Hahnfeld2017-03-081-8/+8
| | | | | | | After rL296927, -rpath gets added after linking the OpenMP runtime. That's why -lgcc does not immediately follow -lomp or -lgomp. llvm-svn: 297264
* [clang-format] Fix parameter name comment; NFCKrasimir Georgiev2017-03-081-1/+1
| | | | llvm-svn: 297263
* [clang-format] Reformat BreakableToken.h; NFCKrasimir Georgiev2017-03-081-19/+14
| | | | llvm-svn: 297262
* [clang-format] Enable comment reflowing in multiline comments containing pragmasKrasimir Georgiev2017-03-084-13/+38
| | | | | | | | | | | | | | | | | Summary: This patch enables comment reflowing of lines not matching the comment pragma regex in multiline comments containing comment pragma lines. Previously, these comments were dumped without being reindented to the result. Reviewers: djasper, mprobst Reviewed By: mprobst Subscribers: klimek, mprobst, cfe-commits Differential Revision: https://reviews.llvm.org/D30697 llvm-svn: 297261
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-0886-19213/+20919
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 llvm-svn: 297250
* [ODRHash] Hash typedefs and usings statements in classes.Richard Trieu2017-03-082-0/+122
| | | | llvm-svn: 297246
* [AArch64] Vulcan is now ThunderXT99Joel Jones2017-03-073-29/+29
| | | | | | | | | | | | | Broadcom Vulcan is now Cavium ThunderX2T99. LLVM Bugzilla: http://bugs.llvm.org/show_bug.cgi?id=32113 Corresponding LLVM change: https://reviews.llvm.org/rL297190 Changes to clang to support the change. Patch by Joel Jones llvm-svn: 297227
* [coroutines] update coro_end builtin to match llvmGor Nishanov2017-03-072-2/+2
| | | | | | | | | | | | | | Summary: llvm.coro.end intrinsic now returns bool. Updating clang to match it. Reviewers: GorNishanov, rsmith Reviewed By: rsmith Subscribers: mehdi_amini, cfe-commits, EricWF Differential Revision: https://reviews.llvm.org/D30711 llvm-svn: 297224
* Use filename in linemarker when compiling preprocessed source (Revised)Taewook Oh2017-03-073-3/+64
| | | | | | | | | | | | | | | | Summary: This is a revised version of D28796. Included test is changed to resolve the target compatibility issue reported (rL293032). Reviewers: inglorion, dblaikie, echristo, aprantl, probinson Reviewed By: inglorion Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30663 llvm-svn: 297194
* fix test to not check optimized IR; NFCISanjay Patel2017-03-071-1966/+2536
| | | | | | | | | | | | This test broke with an LLVM instcombine patch (r297166). I changed the RUN line to only run -mem2reg (to save time checking this large chunk of tests) and updated the checks using the script attached to D17999: https://reviews.llvm.org/D17999 The goal is to make this test immune to optimizer changes. If there's something in these tests that was checking for an IR optimization, that should be tested in LLVM, not Clang. llvm-svn: 297189
* [analyzer] Fix crashes in CastToStruct checker for undefined structsDaniel Marjamaki2017-03-072-0/+18
| | | | | | | | This crash was reported in https://bugs.llvm.org//show_bug.cgi?id=31173 Differential Revision: https://reviews.llvm.org/D28297 llvm-svn: 297187
* Revert "Document that code inlined into a nodebug function also won't get any"Adrian Prantl2017-03-071-2/+1
| | | | | | | This reverts commit r296776. This statement is no longer true. llvm-svn: 297162
* [analyzer] Improve valist checks and move it out from alpha state.Gabor Horvath2017-03-075-100/+202
| | | | | | | | | This patch makes the valist check more robust to the different AST variants on different platforms and also fixes a FIXME. Differential Revision: https://reviews.llvm.org/D30157 llvm-svn: 297153
* [clang-format] Followup of D30646 - unbreak the buildAndi-Bogdan Postelnicu2017-03-071-2/+2
| | | | llvm-svn: 297148
* [clang-format] Fixed indent issue when adding a comment at the end of a ↵Andi-Bogdan Postelnicu2017-03-072-2/+7
| | | | | | | | return type in named function declaration. Differential Revision: https://reviews.llvm.org/D30646 llvm-svn: 297143
* [clang-format] Support namespaces ending in semicolonKrasimir Georgiev2017-03-072-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for namespaces ending in semicolon to the namespace comment fixer. source: ``` namespace A { int i; int j; }; ``` clang-format before: ``` namespace A { int i; int j; } // namespace A; ``` clang-format after: ``` namespace A { int i; int j; }; // namespace A ``` Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30688 llvm-svn: 297140
* [index] Mark categories of test classes with the 'UnitTest' symbol property ↵Argyrios Kyrtzidis2017-03-072-3/+11
| | | | | | as well. llvm-svn: 297133
* [AST/ObjC] Make ObjCCategoryImplDecl consistent with ObjCCategoryDecl and ↵Argyrios Kyrtzidis2017-03-0710-49/+28
| | | | | | | | use the category name as its DeclName This also addresses the badness in ObjCCategoryImplDecl's API, which was hiding NamedDecl's APIs with different meaning. llvm-svn: 297131
* [analyzer] Fix crash when building CFG with variable of incomplete typeMartin Bohme2017-03-072-2/+14
| | | | | | | | | | | | | | | | | | Summary: I've included a unit test with a function template containing a variable of incomplete type. Clang compiles this without errors (the standard does not require a diagnostic in this case). Without the fix, this case triggers the crash. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30636 llvm-svn: 297129
OpenPOWER on IntegriCloud