summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [PPC64, TSAN] Enable thread sanitizer for PPC64Bill Schmidt2015-12-081-1/+1
| | | | | | | | Patch by Simone Atzeni. This enables the -fsanitize=thread flag for PPC64 and PPC64LE. llvm-svn: 255067
* Objective-C properties: fix bogus use of "isa<>" on a QualType.Douglas Gregor2015-12-081-6/+5
| | | | | | | | | The code used "isa" to check the type and then "getAs" to look through sugar; we need to look through the sugar when checking, too, otherwise any kind of sugar (nullability qualifiers in the example; or a typedef) will thwart this semantic check. Fixes rdar://problem/23804250. llvm-svn: 255066
* Module file extensions: pass a Sema through to the extension writer.Douglas Gregor2015-12-083-4/+7
| | | | | | | | Module file extensions are likely to need access to Sema/Preprocessor/ASTContext, and cannot get it through other sources. llvm-svn: 255065
* [Sema] Add warning when comparing nonnull and nullGeorge Burgess IV2015-12-081-28/+45
| | | | | | | | | | | | | | | | | | Currently, we emit warnings in some cases where nonnull function parameters are compared against null. This patch extends this support to warn when comparing the result of `returns_nonnull` functions against null. More specifically, we will now warn cases like: int *foo() __attribute__((returns_nonnull)); int main() { if (foo() == NULL) {} // warning: will always evaluate to false } Differential Revision: http://reviews.llvm.org/D15324 llvm-svn: 255058
* Use range loops and autos in lib/Serialization/ASTWriter.cpp.Eugene Zelenko2015-12-081-127/+103
| | | | | | Differential revision: http://reviews.llvm.org/D15311 llvm-svn: 255033
* [x86][avx512] more changes in intrinsics to be align with gcc formatAsaf Badouh2015-12-082-16/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D15328 llvm-svn: 255012
* [OPENMP 4.5] Parsing/sema for 'num_tasks' clause.Alexey Bataev2015-12-089-2/+114
| | | | | | OpenMP 4.5 adds directives 'taskloop' and 'taskloop simd'. These directives support clause 'num_tasks'. Patch adds parsing/semantic analysis for this clause. llvm-svn: 255008
* [Sema] Remove tab characters. NFCCraig Topper2015-12-081-2/+2
| | | | llvm-svn: 255004
* Add parse and sema for OpenMP distribute directive and all its clauses ↵Carlo Bertolli2015-12-0813-12/+278
| | | | | | excluding dist_schedule. llvm-svn: 255001
* Explicitly permit undefined behavior in constant initializers for globalRichard Smith2015-12-082-7/+42
| | | | | | | | variables in C, in the cases where we can constant-fold it to a value regardless (such as floating-point division by zero and signed integer overflow). Strictly enforcing this rule breaks too much code. llvm-svn: 254992
* Replace a bunch of duplicate conditions with the call from types::.Eric Christopher2015-12-081-10/+4
| | | | llvm-svn: 254986
* Remove name from FIXME.Eric Christopher2015-12-081-1/+1
| | | | llvm-svn: 254985
* [diagnostics] Avoid crashes while printing macro backtracesReid Kleckner2015-12-081-19/+64
| | | | | | | | | | | | | | | | | | | When attempting to map a source into a given level of macro expansion, this code was ignoring the possibility that the start and end of the range might take wildly different paths through the tree of macro expansions. It was assuming that the begin spelling location would always precede the end spelling location, which is false. A macro can easily transpose its arguments. This also fixes a related issue where there are extra macro arguments between the begin location and the end location. In this situation, we now highlight the entire macro invocation. Pair programmed with Richard Smith. Fixes PR12818. llvm-svn: 254981
* 80-column fixup.Eric Christopher2015-12-081-1/+2
| | | | llvm-svn: 254973
* Update comment.Eric Christopher2015-12-081-2/+2
| | | | llvm-svn: 254972
* [analyzer] Fix crash when lambda captures a variable-length array.Devin Coughlin2015-12-071-3/+17
| | | | | | | | | | | | When a C++ lambda captures a variable-length array, it creates a capture field to store the size of the array. The initialization expression for this capture is null, which led the analyzer to crash when initializing the field. To avoid this, use the size expression from the VLA type to determine the initialization value. rdar://problem/23748072 llvm-svn: 254962
* 80-col and whitespace fixups.Eric Christopher2015-12-071-9/+12
| | | | llvm-svn: 254958
* clang-format: Make wrapping after "./->" cheaper, even if the elementDaniel Jasper2015-12-071-4/+14
| | | | | | | | | | | | | | | | | | | before it is not a closing parenthesis. Otherwise, this frequently leads to "hanging" indents that users perceive as "weird". Before: return !soooooooooooooome_map.insert( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .second; After: return !soooooooooooooome_map .insert(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .second; llvm-svn: 254933
* [ThinLTO] Option to invoke ThinLTO backend passes and importingTeresa Johnson2015-12-075-53/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds new option -fthinlto-index=<file> to invoke the LTO pipeline along with function importing via clang using the supplied function summary index file. This supports invoking the parallel ThinLTO backend processes in a distributed build environment via clang. Additionally, this causes the module linker to be invoked on the bitcode file being compiled to perform any necessary promotion and renaming of locals that are exported via the function summary index file. Add a couple tests that confirm we get expected errors when we try to use the new option on a file that isn't bitcode, or specify an invalid index file. The tests also confirm that we trigger the expected function import pass. Depends on D15024 Reviewers: joker.eph, dexonsmith Subscribers: joker.eph, davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D15025 llvm-svn: 254927
* [avx512] rename gcc intrinsics to be align with gcc formatAsaf Badouh2015-12-071-60/+60
| | | | | | | | rename the gcc intrinsics suffix : _mask ->_round Differential Revision: http://reviews.llvm.org/D15284 llvm-svn: 254906
* [OPENMP 4.5] parsing/sema support for 'grainsize' clause.Alexey Bataev2015-12-079-2/+78
| | | | | | OpenMP 4.5 adds 'taksloop' and 'taskloop simd' directives, which have 'grainsize' clause. Patch adds parsing/sema analysis of this clause. llvm-svn: 254903
* [OPENMP 4.5] parsing/sema support for 'nogroup' clause.Alexey Bataev2015-12-079-1/+40
| | | | | | OpenMP 4.5 adds 'taskloop' and 'taskloop simd' directives. These directives have new 'nogroup' clause. Patch adds basic parsing/sema support for this clause. llvm-svn: 254899
* Fix PR20334: invalid assertion while diagnosing list initialization failureFaisal Vali2015-12-071-1/+3
| | | | | | | | | | | | | 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-067-24/+18
| | | | | | | | | | | | | | | | 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-062-5/+3
| | | | 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
* 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-051-12/+13
| | | | | | | | | | 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
* 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-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [analyzer] Improve modelling of nullptr_t in the analyzer. Fix PR25414.Gabor Horvath2015-12-041-0/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D15007 llvm-svn: 254718
* [AST] ArrayRef-ize CompoundStmt::setStmts.Craig Topper2015-12-042-7/+8
| | | | llvm-svn: 254703
* [analyzer] Support inlining lambda-converted blocks.Devin Coughlin2015-12-043-7/+45
| | | | | | | | | 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-041-1/+5
| | | | | | | 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-041-9/+26
| | | | | | | | | | | | | | | | 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
* [PowerPC] Fix calculating address of arguments on stack for variadic funcPetar Jovanovic2015-12-041-28/+34
| | | | | | | | | | | 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-031-10/+20
| | | | | | | | | 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
* Add tests for `&enable_if_function` diagnostics.George Burgess IV2015-12-031-1/+0
| | | | | | | | 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
* [analyzer] Suppress stack address escape on CK_CopyAndAutoreleaseBlockObject.Devin Coughlin2015-12-031-0/+9
| | | | | | | | | | 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
* Fix Objective-C metadata for properties from class extensions after r251874Nico Weber2015-12-031-7/+18
| | | | | | | | | | | | 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
* Revert "Fix for merging decls in pragma weak Calling ↵Alexander Kornienko2015-12-031-13/+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-0313-18/+221
| | | | | | 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-031-9/+6
| | | | | | | | | 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
* Fix a comment typo from r251874.Nico Weber2015-12-031-1/+1
| | | | llvm-svn: 254579
* PR17381: Treat undefined behavior during expression evaluation as an unmodeledRichard Smith2015-12-032-52/+65
| | | | | | | | | | | | | | | | | | | | | 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-031-11/+9
| | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud