summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"Artem Dergachev2016-10-0814-93/+292
| | | | | | The parent commit (r283092) was reverted before and now finally landed. llvm-svn: 283661
* [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"Artem Dergachev2016-10-084-12/+116
| | | | | | The parent commit (r283092) was reverted before and now finally landed. llvm-svn: 283660
* Un-tabify source files, NFC.Yaron Keren2016-10-084-8/+7
| | | | llvm-svn: 283657
* Use StringRef in Command::printArg() instead of raw pointer (NFC)Mehdi Amini2016-10-082-4/+4
| | | | llvm-svn: 283645
* [CUDA] Do a better job at detecting wrong-side calls.Justin Lebar2016-10-086-79/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to DiagnoseUseOfDecl. This lets us catch some edge cases we were missing, specifically around class operators. This necessitates a few other changes: - Avoid emitting duplicate deferred diags in CheckCUDACall. Previously we'd carefully placed our call to CheckCUDACall such that it would only ever run once for a particular callsite. But now this isn't the case. - Emit deferred diagnostics from a template specialization/instantiation's primary template, in addition to from the specialization/instantiation itself. DiagnoseUseOfDecl ends up putting the deferred diagnostics on the template, rather than the specialization, so we need to check both. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D24573 llvm-svn: 283637
* Rename variable to not use C++ reserved name (leading underscore + capital) ↵Mehdi Amini2016-10-071-2/+2
| | | | | | (NFC) llvm-svn: 283616
* Fix MSVC build: requires namespace in front of StringRef (NFC)Mehdi Amini2016-10-071-1/+1
| | | | llvm-svn: 283615
* Driver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)Mehdi Amini2016-10-076-6/+9
| | | | llvm-svn: 283611
* Turn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)Mehdi Amini2016-10-0710-41/+39
| | | | llvm-svn: 283605
* Visually align table def with respective enum. NFCDouglas Katzman2016-10-071-19/+43
| | | | | | | 'warn_attribute_wrong_decl_type' has to stay in sync with 'enum AttributeDeclKind' which is much easier when they line up. llvm-svn: 283601
* Revert r283572 - [Driver] Make -print-libgcc-file-name print compiler-rt lib ↵Michal Gorny2016-10-074-28/+3
| | | | | | | | | | when used Revert the -print-libgcc-file-name change as the new test fails on Darwin. It needs to be updated to run the libgcc part only on systems supporting that rtlib. llvm-svn: 283586
* [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)Artem Dergachev2016-10-078-49/+173
| | | | | | | The problem that caused the msvc crash has been indentified and fixed in the previous commit. This patch contains the rest of r283092. llvm-svn: 283584
* Silence Warning. NFC.Nirav Dave2016-10-071-1/+1
| | | | llvm-svn: 283583
* [analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.Artem Dergachev2016-10-071-1/+1
| | | | | | | Remove the brace default initializer to see if this is what's causing the msvc crash. llvm-svn: 283574
* [analyzer] Re-apply r283092, attempt no.4, chunk no.3.Artem Dergachev2016-10-071-1/+17
| | | | | | | | This is the primary suspect for causing the msvc crash, now that vector of smart pointers was proven to be safe. Probably the default {}-initializer is the problem. llvm-svn: 283573
* [Driver] Make -print-libgcc-file-name print compiler-rt lib when usedMichal Gorny2016-10-074-3/+28
| | | | | | | | | | | | | | | | | | | | Make the -print-libgcc-file-name option print an appropriate compiler runtime library, that is libgcc.a if gcc runtime is used and an appropriate compiler-rt library if that runtime is used. The main use for this is to allow linking executables built with -nodefaultlibs (e.g. to avoid linking to the standard C++ library) to the compiler runtime library, e.g. using: clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name) in which case currently a program built like this linked to the gcc runtime unconditionally. The patch fixes it to use compiler-rt libraries instead when compiler-rt is the active runtime. Differential Revision: https://reviews.llvm.org/D25338 llvm-svn: 283572
* [analyzer] Re-apply r283092, attempt no.4, chunk no.2.Artem Dergachev2016-10-071-1/+4
| | | | | | | Define the list of pieces in BugReport class. This is half of the changes in the BugReport class code, which is pointed to by the msvc crash message. llvm-svn: 283568
* [analyzer] Re-apply r283092, attempt no.4, a small chunk.Artem Dergachev2016-10-073-10/+47
| | | | | | | Define PathDiagnosticNotePiece. The next commit would be able to address the BugReport class code that is pointed to by the msvc crash message. llvm-svn: 283566
* Update clang test to accomendate discriminator change in ↵Dehao Chen2016-10-072-4/+5
| | | | | | | | | | | | | | https://reviews.llvm.org/D25132 Summary: https://reviews.llvm.org/D25132 added discriminator even add -g0. This leads to test fail which is addressed in thie patch. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25133 llvm-svn: 283564
* [analyzer] Don't merge different return nodes in ExplodedGraphDaniel Marjamaki2016-10-078-15/+43
| | | | | | | | Returns when calling an inline function should not be merged in the ExplodedGraph unless they are same. Differential Revision: https://reviews.llvm.org/D25326 llvm-svn: 283554
* Wdocumentation fixSimon Pilgrim2016-10-071-5/+5
| | | | llvm-svn: 283549
* [ARM]: Add Cortex-R52 targetJaved Absar2016-10-073-0/+35
| | | | | | | This patch adds Cortex-R52, the new ARM real-time processor. Cortex-R52 implements the ARMv8-R architecture. llvm-svn: 283543
* Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."Artem Dergachev2016-10-071-35/+2
| | | | llvm-svn: 283541
* [analyzer] Re-apply r283092, attempt no.3, in small chunks this time.Artem Dergachev2016-10-071-2/+35
| | | | llvm-svn: 283540
* Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"Artem Dergachev2016-10-0710-241/+58
| | | | | | Vector of smart pointers wasn't the thing that caused msvc crash. llvm-svn: 283537
* [analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"Artem Dergachev2016-10-0710-58/+241
| | | | | | | Replace SmallVector<IntrusiveRefCntPtr> with a vector of plain pointers. Would insignificantly increase memory usage. llvm-svn: 283536
* Use StringReg in TargetParser APIs (NFC)Mehdi Amini2016-10-072-36/+37
| | | | llvm-svn: 283527
* PR25890: Fix incoherent error handling in PerformImplicitConversion andRichard Smith2016-10-0610-29/+51
| | | | | | | | | | | | CheckSingleAssignmentConstraints. These no longer produce ExprError() when they have not emitted an error, and reliably inform the caller when they *have* emitted an error. This fixes some serious issues where we would fail to emit any diagnostic for invalid code and then attempt to emit code for an invalid AST, and conversely some issues where we would emit two diagnostics for the same problem. llvm-svn: 283508
* [analyzer] Add explanation why analyzer report is not generated (fix for ↵Anton Yartsev2016-10-064-7/+36
| | | | | | | | | PR12421). Currently if the path diagnostic consumer (e.g HTMLDiagnostics and PlistDiagnostics) do not support cross file diagnostics then the path diagnostic report is silently omitted in the case of cross file diagnostics. The patch adds a little verbosity to Clang in this case. The patch also adds help entry for the "--analyzer-output" driver option. llvm-svn: 283499
* Add another .def file to module map to fix modules buildbot's displeasure.Richard Smith2016-10-061-0/+1
| | | | llvm-svn: 283498
* [coroutines] Fix co_return statement for initializer list argumentsEric Fiselier2016-10-062-6/+20
| | | | | | | | | | | | | | | Summary: Previously the statement `co_return {42}` would be transformed into `P.return_void()`, since the type of `{42}` is represented as `void` by Clang. This patch fixes the bug by checking for `InitListExpr` arguments and transforming them accordingly. Reviewers: majnemer, GorNishanov, rsmith Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25296 llvm-svn: 283495
* [modules] Be sure to emit local specializations of imported templates, even ifRichard Smith2016-10-068-11/+71
| | | | | | | | | | | the resulting specialization is not referenced by the rest of the AST. This both avoids performing unnecessary reinstantiations in downstream users of the AST file and fixes a bug (breaking modules self-host right now) where we would sometimes fail to emit a definition of a class template specialization if we imported just a declaration of it from elsewhere (see new testcase for reduced example). llvm-svn: 283489
* [Sema] Replace smart quote with "'" in comment.Justin Lebar2016-10-061-1/+1
| | | | | | | | | | Looks like the smart quote was copy/pasted from the C++ standard. The smart quote was not encoded as valid UTF-8 (?), even though vim was detecting the file as UTF-8. This broke the clang-format Python script, which tried to read the file using the same encoding as vim detected. llvm-svn: 283487
* [OpenMP] Check if the template specialization is mappable instead of ↵David Sheinkman2016-10-062-3/+12
| | | | | | specialized template Differential Revision: https://reviews.llvm.org/D25252 llvm-svn: 283460
* Allocate after the early exit checks. NFC.Vassil Vassilev2016-10-061-2/+2
| | | | llvm-svn: 283448
* [modules] Allow VarDecls with initializers to use special var abbrev.Vassil Vassilev2016-10-062-11/+9
| | | | | | | | | Update storage sizes to fit the (past) changes in the VarDecl's data model. Update some comments. Patch partially reviewed by Richard Smith as part of https://reviews.llvm.org/D24508 llvm-svn: 283444
* [Sema] Fix PR30520: Handle incomplete field types in transparent_union unionsAlex Lorenz2016-10-062-0/+13
| | | | | | | | | | | This commit fixes a crash that happens when clang is analyzing a transparent_union attribute on a union which has a field with incomplete type. rdar://28630028 Differential Revision: https://reviews.llvm.org/D25273 llvm-svn: 283432
* Add missing -no-canonical-prefixes.Benjamin Kramer2016-10-062-2/+2
| | | | llvm-svn: 283430
* Fix PR30440: Initialize FunctionTypeDepth in CXXNameManglerAlex Lorenz2016-10-062-4/+17
| | | | | | | | | | | | This commit fixes PR 30440 by initializing CXXNameMangler's FunctionTypeDepth in the two constructors added in r274222 (The commit that caused this regression). rdar://28455269 Differential Revision: https://reviews.llvm.org/D24932 llvm-svn: 283428
* [Driver] Add driver support for FuchsiaPetr Hosek2016-10-068-0/+359
| | | | | | | | | | | Provide toolchain and tool support for Fuchsia operating system. Fuchsia uses compiler-rt as the runtime library and libc++, libc++abi and libunwind as the C++ standard library. lld is used as a default linker. Differential Revision: https://reviews.llvm.org/D25117 llvm-svn: 283420
* Taking StringRef in Driver.h APIs instead of raw pointers (NFC)Mehdi Amini2016-10-062-42/+39
| | | | llvm-svn: 283417
* Use llvm::raw_string_ostream instead of std::stringstream (NFC)Mehdi Amini2016-10-061-3/+2
| | | | | | As a side effect, this avoid having to call .data() on the StringRef. llvm-svn: 283416
* PR22924, PR22845, some of CWG1464: When checking the initializer for an arrayRichard Smith2016-10-059-108/+254
| | | | | | | | | | | | | | | | | | new expression, distinguish between the case of a constant and non-constant initializer. In the former case, if the bound is erroneous (too many initializer elements, bound is negative, or allocated size overflows), reject, and take the bound into account when determining whether we need to default-construct any elements. In the remanining cases, move the logic to check for default-constructibility of trailing elements into the initialization code rather than inventing a bogus array bound, to cope with cases where the number of initialized elements is not the same as the number of initializer list elements (this can happen due to string literal initialization or brace elision). This also fixes rejects-valid and crash-on-valid errors when initializing a new'd array of character type from a braced string literal. llvm-svn: 283406
* Removing optimization from the RUN lines and adjusting the checksNemanja Ivanovic2016-10-051-50/+2
| | | | | | to not rely on optimization. llvm-svn: 283363
* Make DeletedLines local variables in checkEmptyNamespace.Eric Liu2016-10-052-5/+24
| | | | | | | | | | | | Summary: Patch by Sam McCall! Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D25162 llvm-svn: 283332
* [clang-format] append newline after code when inserting new headers at the ↵Eric Liu2016-10-052-3/+20
| | | | | | | | | | | | | | | | end of the code which does not end with newline. Summary: append newline after code when inserting new headers at the end of the code which does not end with newline. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D21026 llvm-svn: 283330
* [Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clangMichael Zuckerman2016-10-053-0/+64
| | | | | | Differential Revision: http://reviews.llvm.org/D21021 llvm-svn: 283314
* [Sema] Packed member warning: Use the typedef name for anonymous structuresAlex Lorenz2016-10-052-1/+41
| | | | | | | | | | | This commit improves the packed member warning by showing the name of the anonymous structure/union when it was defined within a typedef declaration. rdar://28498901 Differential Revision: https://reviews.llvm.org/D25106 llvm-svn: 283304
* [analyzer] Squash a compile error in r283301.Artem Dergachev2016-10-052-4/+8
| | | | | | The constexpr string literal trick isn't supported in MSVC2013. llvm-svn: 283303
* [analyzer] Improve "Assuming..." diagnostic pieces for logical operators.Artem Dergachev2016-10-053-148/+109
| | | | | | | | | | | | | | | | | | Logical short-circuit operators now act like other branch conditions. If the symbolic value of the left-hand side is not known to be true or false (based on the previous execution path), the "Assuming" event piece is added in order to explain that the analyzer is adding a new assumption. Additionally, when the assumption is made against the right-hand side of the logical operator (i.e. when the operator itself acts as a condition in another CFG terminator), the "Assuming..." piece is written out for the right-hand side of the operator rather than for the whole operator. This allows expression-specific diagnostic message text to be constructed. Differential Revision: https://reviews.llvm.org/D25092 llvm-svn: 283302
OpenPOWER on IntegriCloud