summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR20334: invalid assertion while diagnosing list initialization failureFaisal Vali2015-12-072-1/+23
| | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=20334 Unfortunately, clang currently checks for a certain brokenness of implementations of std::initializer_list in CodeGen (void AggExprEmitter::VisitCXXStdInitializerListExpr), not in SemaInit. Until that is fixed, make sure we don't let broken attempts that are aggregates leak through into sema, which allows maintenance of expected invariants, and avoids triggering an assertion. llvm-svn: 254889
* [PGO] Instrument only base constructors and destructors.Serge Pavlov2015-12-069-34/+67
| | | | | | | | | | | | | | | | Constructors and destructors may be represented by several functions in IR. Only base structors correspond to source code, others are small pieces of code and eventually call the base variant. In this case instrumentation of non-base structors has little sense, this fix remove it. Now profile data of a declaration corresponds to exactly one function in IR, it agrees with the current logic of the profile data loading. This change fixes PR24996. Differential Revision: http://reviews.llvm.org/D15158 llvm-svn: 254876
* Use llvm::make_range to reduce mentions of iterator type. NFCCraig Topper2015-12-064-12/+7
| | | | llvm-svn: 254870
* Fix crash in ASTDumper when dumping NamedDecl with NULL getQualifier().Dawn Perchik2015-12-051-3/+6
| | | | | | | | Reviewed by: aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15254 llvm-svn: 254867
* [X86][3DNow!] Stripped backend codegen testsSimon Pilgrim2015-12-051-26/+0
| | | | | | | | As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible. The llvm tests will (re)added in a future commit llvm-svn: 254849
* Updated test names to match the intrinsics being testedSimon Pilgrim2015-12-052-14/+14
| | | | llvm-svn: 254848
* [X86][F16C] Stripped backend codegen testsSimon Pilgrim2015-12-051-6/+4
| | | | | | | | | | As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible. The llvm tests will (re)added in a future commit I will update PR24580 on this new plan llvm-svn: 254847
* [AST] Use std::copy and std::fill to simplify some memcpy and memset calls. ↵Craig Topper2015-12-051-5/+7
| | | | | | Also const-correct some methods being used since the std::copy catches the mismatch where memcpy didn't. llvm-svn: 254846
* Use std::copy and std::transform instead of manual loops. NFCCraig Topper2015-12-051-17/+16
| | | | llvm-svn: 254845
* Pass profile version info to name API (NFC)Xinliang David Li2015-12-051-1/+4
| | | | llvm-svn: 254839
* Revert "[x86] Exclusion of incorrect include headers paths for MCU target"Reid Kleckner2015-12-052-57/+20
| | | | | | | | | | This reverts commit r254195. From the description, I suspect that the wrong patch was committed here, and this is causing assertion failures in EmitDeferred() when the global value ends up being a bitcast of a global. llvm-svn: 254823
* [WebAssembly] Remove an obsolete TODO comment.Dan Gohman2015-12-051-1/+0
| | | | llvm-svn: 254817
* [analyzer] Fix MemRegion crash casting non-struct to derived struct (PR25426).Devin Coughlin2015-12-052-13/+27
| | | | | | | | | | This commit prevents MemRegion::getAsOffset() from crashing when the analyzed program casts a symbolic region of a non-record type to some derived type and then attempts to access a field of the base type. rdar://problem/23458069 llvm-svn: 254806
* [Docs] One more cleanup of -fsanitize= section.Alexey Samsonov2015-12-042-18/+17
| | | | | | | Describe -fsanitize-blacklist flags in separate paragraphs, move notes about importance of clang++ for vptr down to UBSan docs. llvm-svn: 254798
* [CMake] Don't build the libclang tests unless you're building libclangChris Bieneman2015-12-041-1/+1
| | | | | | This fixes a build issue reported by users at Apple. llvm-svn: 254797
* [Docs] Update MSan docsAlexey Samsonov2015-12-042-48/+35
| | | | | | | | | | | | | | Summary: 1. Move MSan-specific flags and features from user manual to MSan page. 2. Update current status / list of supported platforms. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15246 llvm-svn: 254788
* [Docs] Move the list of CFI schemes down to CFI doc, and update it.Alexey Samsonov2015-12-042-31/+48
| | | | | | | | | | | | | Use proper headling levels in CFI doc. Before that, all sections were considered a subsection of "Introduction". Reviewers: pcc, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15237 llvm-svn: 254771
* Small follow-up to 254750 to get the test added there passing...Nico Weber2015-12-041-5/+5
| | | | llvm-svn: 254754
* Fix debug info for Objective-C properties from class extensions after r251874Nico Weber2015-12-042-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After r251874, properties from class extensions no longer show up in ObjCInterfaceDecl::properties(). Make debug info emission explicitly look for properties in class extensions before looking at direct properties. Also add a test that checks for this. There are three interesting cases: 1. A property is only declared in a class extension, and the @implementation is in a different file. This used to generated a DIObjcProperty before r251874 and does again with this fix. 2. A property is declared as readonly in the class itself and redeclared as readwrite in a class extension. clang before r251874 put the DIObjcProperty on the first declaration. clang after r251874 didn't emit any DIObjcProperty, and clang with this fix puts it on the readwrite redeclaration (which is what lookup finds). This seems like a progression. 3. Like 2, but with an @implementation in the same file. In this case, the property debug info gets generated a second time through the ivar from the definition. In this case, lookup and declaration code need to agree on the line number so that the DIObjcProperty isn't emitted twice. In this case, clang before r251874 emitted one DIObjcProperty on the first declaration, clang with r251874 emitted one on the second declaration, and clang with this patch still does the latter. llvm-svn: 254750
* [Docs] Remove false claim: UBSan can also be combined with TSan/MSan.Alexey Samsonov2015-12-041-2/+1
| | | | llvm-svn: 254734
* Clang documentation for UBSan.Alexey Samsonov2015-12-043-61/+211
| | | | | | | | | | | | | | | | | | | | | | Summary: Create a separate page describing UBSan tool, move the description of fine-grained checks there, provide extra information about supported platforms, symbolization etc. This text is compiled from four parts: * Existing documentation copied from User's Manual * Layout used in documentation for another sanitizers (ASan, MSan etc.) * Text written from scratch * Small parts taken from Michael Morrison's attempt at creating UBSan page: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20141215/249503.html Reviewers: kcc, rsmith, silvas Subscribers: tberghammer, danalbert, srhines, kcc Differential Revision: http://reviews.llvm.org/D15217 llvm-svn: 254733
* [PS4] Add an additional test for ASan+UBSanFilipe Cabecinhas2015-12-041-0/+4
| | | | llvm-svn: 254723
* [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.Gabor Horvath2015-12-042-1/+57
| | | | | | Differential Revision: http://reviews.llvm.org/D15007 llvm-svn: 254718
* Fix an unused variable warning in released builds. While there use 'auto' to ↵Craig Topper2015-12-041-3/+2
| | | | | | simplify code. llvm-svn: 254704
* [AST] ArrayRef-ize CompoundStmt::setStmts.Craig Topper2015-12-043-8/+9
| | | | llvm-svn: 254703
* [analyzer] Support inlining lambda-converted blocks.Devin Coughlin2015-12-045-11/+142
| | | | | | | | | clang converts C++ lambdas to blocks with an implicit user-defined conversion operator method on the lambda record. This method returns a block that captures a copy of the lambda. To inline a lambda-converted block, the analyzer now calls the lambda records's call operator method on the lambda captured by the block. llvm-svn: 254702
* Don't assert if evaluation of an expression that we're syntactically requiredRichard Smith2015-12-042-1/+7
| | | | | | | to treat as an ICE results in undefined behavior. Instead, return the "natural" result of the operation (signed wraparound / inf / nan). llvm-svn: 254699
* LLDB JIT needs android vector passing rules.Stephen Hines2015-12-042-9/+94
| | | | | | | | | | | | | | | | Summary: Looking into some recent issues with LLDBs expression parser highlighted that upstream clang passes vectors types differently to Android Open Source Project's clang for Arm Android targets. This patch reflects the changes present in the AOSP and allows LLDB's JIT expression evaluation to work correctly for Arm Android targets when passing vectors. This is submitted with consent of the original author Stephen Hines. Reviewers: asl, rsmith, ADodds, rnk Subscribers: rnk, aemerson, tberghammer, danalbert, srhines, cfe-commits, pirama Differential Revision: http://reviews.llvm.org/D14639 llvm-svn: 254682
* [Docs] Sanitizer docs migrated from code.google.com to github.com.Alexey Samsonov2015-12-044-9/+4
| | | | llvm-svn: 254672
* [PowerPC] Fix calculating address of arguments on stack for variadic funcPetar Jovanovic2015-12-043-32/+43
| | | | | | | | | | | Fix calculating address of arguments larger than 32 bit on stack for variadic functions (rounding up address to alignment) on ppc32 architecture. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D14871 llvm-svn: 254670
* PR25731: namespace alias declarations can appear at block scope; ensure that weRichard Smith2015-12-033-11/+34
| | | | | | | | | do scope-based lookup when looking for redeclarations of them. Add some related missing checks for the scope-based redeclaration lookup: properly filter the list of found declarations to match the scope, and diagnose shadowing of a template parameter name. llvm-svn: 254663
* Fix pass_object_size test on Windows.George Burgess IV2015-12-031-3/+3
| | | | | | | | | The tests were failing because the types of some member functions, when printed, unexpectedly had "__attribute__((thiscall))" at the end. The types in question were relatively unimportant to begin with, so they were removed/replaced with regexes. llvm-svn: 254650
* Add tests for `&enable_if_function` diagnostics.George Burgess IV2015-12-033-1/+25
| | | | | | | | The introduction of pass_object_size fixed a few bugs related to taking the address of a function with enable_if attributes. This patch adds tests for the cases that were fixed. llvm-svn: 254646
* [CMake] Removing an unnecessary layer of variable indirectionChris Bieneman2015-12-031-1/+1
| | | | | | This prevents passthrough variables from having values. llvm-svn: 254642
* [analyzer] Suppress stack address escape on CK_CopyAndAutoreleaseBlockObject.Devin Coughlin2015-12-032-4/+13
| | | | | | | | | | Don't warn about addresses of stack-allocated blocks escaping if the block region was cast with CK_CopyAndAutoreleaseBlockObject. These casts, which are introduced in the implicit conversion operator for lambda-to-block conversions, cause the block to be copied to the heap -- so the warning is spurious. llvm-svn: 254639
* Add tests for pass_object_size.George Burgess IV2015-12-034-0/+554
| | | | | | | | These additions were meant to go in as a part of r254554; while it's certainly nice to have new functionality, it's nicer if we have tests to go with it. :) llvm-svn: 254632
* Fix Objective-C metadata for properties from class extensions after r251874Nico Weber2015-12-032-7/+57
| | | | | | | | | | | | After, properties from class extensions no longer show up in ObjCInterfaceDecl::properties(). Make ObjCCommonMac::EmitPropertyList() explicitly look for properties in class extensions before looking at direct properties. Also add a test that passes both with clang before r251874 and after this patch (but fails with r251874 and without this patch). llvm-svn: 254622
* Fix clang/test/Sema/struct-packed-align.c. "Windows" is not MS compiler.NAKAMURA Takumi2015-12-031-1/+1
| | | | llvm-svn: 254614
* Make check-clang depend on LTO.Nico Weber2015-12-031-0/+1
| | | | | | | | r249143 added test/Driver/darwin-ld-lto.c which requires libLTO.dylib to pass, but when running `ninja check-clang` in a fresh build directory nothing caused libLTO.dylib to be built and the test would fail. llvm-svn: 254612
* Unxfail passing test: test/CodeGenCXX/crash.cppKrzysztof Parzyszek2015-12-031-1/+0
| | | | llvm-svn: 254606
* Revert "Fix for merging decls in pragma weak Calling ↵Alexander Kornienko2015-12-033-28/+8
| | | | | | | | | | | | CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: http://reviews.llvm.org/D13048" This reverts commit r254143 which introduces a crash on the following input: f(char *); g(char *); #pragma weak f = g int g(char *p) {} llvm-svn: 254605
* Add fall-back mode for clang tools.Manuel Klimek2015-12-031-4/+7
| | | | | | | | | Run without flags if we cannot load a compilation database. This matches the behavior of clang itself when simply called with a source file. Based on a patch by Russell Wallace. llvm-svn: 254599
* [OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.Alexey Bataev2015-12-0337-35/+3302
| | | | | | OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses. llvm-svn: 254597
* PR25575: Make GCC 4.4+ comatible layout for packed bit-fileds of char type, ↵Alexey Bataev2015-12-033-13/+32
| | | | | | | | | patch by D. Polukhin This CL is for discussion how to better fix bit-filed layout compatibility issue with GCC (see PR25575 for test case and more details). Current clang behavior is compatible with GCC 4.1-4.3 series but it was fixed in 4.4+. Ignoring packed attribute looks very odd and because it was also fixed in GCC 4.4+, it makes sense also fix it in clang. Differential Revision: http://reviews.llvm.org/D14872 llvm-svn: 254596
* [X86] Stripped backend codegen testsSimon Pilgrim2015-12-039-1285/+498
| | | | | | | | | | As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible. The llvm tests will (re)added in a future commit I will update PR24580 on this new plan llvm-svn: 254594
* Fix a comment typo from r251874.Nico Weber2015-12-031-1/+1
| | | | llvm-svn: 254579
* generalize CHECK lines to make buildbot happySanjay Patel2015-12-031-2/+2
| | | | llvm-svn: 254576
* PR17381: Treat undefined behavior during expression evaluation as an unmodeledRichard Smith2015-12-0311-64/+92
| | | | | | | | | | | | | | | | | | | | | side-effect, so that we don't allow speculative evaluation of such expressions during code generation. This caused a diagnostic quality regression, so fix constant expression diagnostics to prefer either the first "can't be constant folded" diagnostic or the first "not a constant expression" diagnostic depending on the kind of evaluation we're doing. This was always the intent, but didn't quite work correctly before. This results in certain initializers that used to be constant initializers to no longer be; in particular, things like: float f = 1e100; are no longer accepted in C. This seems appropriate, as such constructs would lead to code being executed if sanitizers are enabled. llvm-svn: 254574
* change an assert when generating fmuladd to an ordinary 'if' check (PR25719)Sanjay Patel2015-12-032-11/+21
| | | | | | | | | | | | | | | | | | | We don't want to generate fmuladd if there's a use of the fmul expression, but this shouldn't be an assert. The test case is derived from the commit message for r253337: http://reviews.llvm.org/rL253337 That commit reverted r253269: http://reviews.llvm.org/rL253269 ...but the bug exists independently of the default fp-contract setting. It just became easier to hit with that change. PR25719: https://llvm.org/bugs/show_bug.cgi?id=25719 Differential Revision: http://reviews.llvm.org/D15165 llvm-svn: 254573
* fix typos; NFCSanjay Patel2015-12-021-2/+2
| | | | llvm-svn: 254561
OpenPOWER on IntegriCloud