summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r255001, "Add parse and sema for OpenMP distribute directive and all ↵NAKAMURA Takumi2015-12-093-9/+0
| | | | | | | | its clauses excluding dist_schedule." It causes memory leak. Some tests in test/OpenMP would fail. llvm-svn: 255094
* [OPENMP 4.5] Parsing/sema for 'num_tasks' clause.Alexey Bataev2015-12-081-0/+1
| | | | | | 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
* Add parse and sema for OpenMP distribute directive and all its clauses ↵Carlo Bertolli2015-12-083-0/+9
| | | | | | excluding dist_schedule. llvm-svn: 255001
* [ThinLTO] Option to invoke ThinLTO backend passes and importingTeresa Johnson2015-12-072-53/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [OPENMP 4.5] parsing/sema support for 'grainsize' clause.Alexey Bataev2015-12-071-0/+1
| | | | | | 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-071-0/+1
| | | | | | 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
* [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
* 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
* 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
* 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
* 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
* [OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.Alexey Bataev2015-12-033-0/+13
| | | | | | OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses. llvm-svn: 254597
* 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
* Add the `pass_object_size` attribute to clang.George Burgess IV2015-12-0211-115/+257
| | | | | | | | | | | | | `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring inlining to happen everywhere. A link to the design doc for this attribute is available at the Differential review link below. Differential Revision: http://reviews.llvm.org/D13263 llvm-svn: 254554
* [OpenMP] Update target directive codegen to use 4.5 implicit data mappings.Samuel Antao2015-12-023-50/+143
| | | | | | | | | | | | | | | Summary: This patch implements the 4.5 specification for the implicit data maps. OpenMP 4.5 specification changes the default way data is captured into a target region. All the non-aggregate kinds are passed by value by default. This required activating the capturing by value during SEMA for the target region. All the non-aggregate values that can be encoded in the size of a pointer are properly casted and forwarded to the runtime library. On top of fixing the previous weird behavior for mapping pointers in nested data regions (an explicit map was always required), this also improves performance as the number of allocations/transactions to the device per non-aggregate map are reduced from two to only one - instead of passing a reference and the value, only the value passed. Explicit maps will be added later on once firstprivate, private, and map clauses' SEMA and parsing are available. Reviewers: hfinkel, rjmccall, ABataev Subscribers: cfe-commits, carlo.bertolli Differential Revision: http://reviews.llvm.org/D14940 llvm-svn: 254521
* Update for llvm api change.Rafael Espindola2015-12-011-1/+1
| | | | llvm-svn: 254450
* [OPENMP 4.5] Parsing/sema analysis for 'priority' clause.Alexey Bataev2015-12-011-0/+1
| | | | | | OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives. llvm-svn: 254398
* Remove superfluous StringRef casts, NFC.Yaron Keren2015-12-011-7/+7
| | | | llvm-svn: 254392
* [OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.Alexey Bataev2015-12-013-1/+13
| | | | | | Adds initial parsing and semantic analysis for 'taskloop' directive. llvm-svn: 254367
* Fix use-after-free when a C++ thread_local variable gets replaced (because itsRichard Smith2015-12-016-32/+22
| | | | | | | type changes when the initializer is attached). Don't hold onto the GlobalVariable*; recompute it from the VarDecl* instead. llvm-svn: 254359
* Fixed default label in fully covered switch warning that was introduced in ↵Daniel Sanders2015-11-271-1/+0
| | | | | | r254203. llvm-svn: 254208
* [OpenMP] Parsing and sema support for thread_limit clause.Kelvin Li2015-11-271-0/+1
| | | | | | http://reviews.llvm.org/D15029 llvm-svn: 254207
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-0/+21
| | | | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Patch by Simon Dardis. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254205
* Revert r254203: [mips] Interrupt attribute support.Daniel Sanders2015-11-271-21/+0
| | | | | | I forgot to credit the author. llvm-svn: 254204
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-0/+21
| | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254203
* [x86] Exclusion of incorrect include headers paths for MCU targetAndrey Bokhanko2015-11-272-20/+57
| | | | | | | | Exclusion of /usr/include and /usr/local/include headers paths for MCU target. Differential Revision: http://reviews.llvm.org/D14954 llvm-svn: 254195
* [OpenMP] Parsing and sema support for num_teams clauseKelvin Li2015-11-241-0/+1
| | | | | | http://reviews.llvm.org/D14802 llvm-svn: 254019
* [OPENMP] Fix crash on codegen for 'task' directive with no shared variables.Alexey Bataev2015-11-241-1/+1
| | | | | | If 'task' region does not have shared variables codegen could crash on calculation of size of list of shared variables. llvm-svn: 253977
* CodeGenFunction.h: Prune a \param in r253926. [-Wdocumentation]NAKAMURA Takumi2015-11-231-3/+0
| | | | llvm-svn: 253938
* Preserve exceptions information during calls code generation.Samuel Antao2015-11-238-41/+73
| | | | | | | | | | | This patch changes the generation of CGFunctionInfo to contain the FunctionProtoType if it is available. This enables the code generation for call instructions to look into this type for exception information and therefore generate better quality IR - it will not create invoke instructions for functions that are know not to throw. llvm-svn: 253926
* [OPENMP] 'out' dependency for 'task' directives must be the same as 'inout'.Alexey Bataev2015-11-231-3/+2
| | | | | | Runtime library requires, that codegen for 'depend' clause for 'out' dependency kind must be the same as codegen for 'depend' clause with 'inout' dependency. llvm-svn: 253866
* [OpenMP] Parsing and sema support for map clauseKelvin Li2015-11-231-0/+1
| | | | | | http://reviews.llvm.org/D14134 llvm-svn: 253849
* [MS ABI] Tolerate invokes of __RTDynamicCastDavid Majnemer2015-11-231-0/+1
| | | | | | | | | | | | The pointer returned by __RTDynamicCast must be bitcasted. However, it was not expected that __RTDynamicCast would be invoked, resulting in the bitcast occuring in a different BasicBlock than the invoke. This caused a down-stream PHI to get confused about which BasicBlock the incomming value was from. This fixes PR25606. llvm-svn: 253843
* [DebugInfo] Look through type sugar on union types when castingReid Kleckner2015-11-201-1/+1
| | | | | | Fixes PR25584. llvm-svn: 253680
* Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper2015-11-191-6/+6
| | | | | | | | | | This reverts commit r253512. This likely broke the bots in: http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253542
* Revert "Fix debian build after r253512."Pete Cooper2015-11-191-4/+3
| | | | | | | | | | This reverts commit r253519. This likely broke the bots in http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 llvm-svn: 253541
* Don't actually add the __unsafe_unretained qualifier in MRC;John McCall2015-11-191-3/+9
| | | | | | | | | | | driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. llvm-svn: 253534
* Fix the emission of ARC-style ivar layouts in the fragile runtimeJohn McCall2015-11-191-5/+4
| | | | | | | | | to start at the offset of the first ivar instead of the rounded-up end of the superclass. The latter could include a large amount of tail padding because of a highly-aligned ivar, and subclass ivars can be laid out within that. llvm-svn: 253533
* Fix debian build after r253512.Pete Cooper2015-11-181-3/+4
| | | | | | | | | | | The conversion from QuantityType to the (temporary) IntegerAlignment class was ambiguous. For now add in explicit conversion to unsigned to satisfy the clang-x86_64-debian-fast bot. I'll remove the explicit conversion when I remove the IntegerAlignment class. llvm-svn: 253519
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. llvm-svn: 253512
* Update for llvm change.Rafael Espindola2015-11-181-1/+1
| | | | llvm-svn: 253440
* [PGO] Removed unused code. [NFC]Betul Buyukkurt2015-11-181-1/+0
| | | | llvm-svn: 253404
* Correctly handle type mismatches in the __weak copy/move-initializationJohn McCall2015-11-161-2/+12
| | | | | | | | peephole I added in r250916. rdar://23559789 llvm-svn: 253255
* When producing error messages for always_inline functions with theEric Christopher2015-11-161-2/+5
| | | | | | | | | | target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
* [CGDebugInfo] Set the size and align for reference typesKeno Fischer2015-11-161-6/+7
| | | | | | | | | | In r253186, I changed the DIBuilder API to now take size and align for reference types as well. This was done in preparation for upcoming changes to the Verifier that will validate that sizes match between DI types and IR values that are declared as having those types. This updates clang to actually pass the information through. llvm-svn: 253190
* Add support for the always_inline + target feature diagnostic to printEric Christopher2015-11-141-6/+11
| | | | | | | out the first missing target feature that's required and reword the diagnostic accordingly. llvm-svn: 253121
* Clarify and elaborate the conditions on which we're checking targetEric Christopher2015-11-141-4/+6
| | | | | | features for calls. llvm-svn: 253117
OpenPOWER on IntegriCloud