summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-231-0/+1
| | | | llvm-svn: 218299
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-191-0/+1
| | | | llvm-svn: 218110
* MS ABI: Don't ICE for pointers to pointers to members of incomplete classesDavid Majnemer2014-09-181-12/+1
| | | | | | | | | | | | | | | | | | | CodeGen would try to come up with an LLVM IR type for a pointer to member type on the way to forming an LLVM IR type for a pointer to pointer to member type. However, if the pointer to member representation has not been locked in yet, we would not be able to come up with a pointer to member IR type. In these cases, make the pointer to member type an incomplete type. This will make the pointer to pointer to member type a pointer to an incomplete type. If the class eventually obtains an inheritance model, we will make the pointer to member type represent the actual inheritance model. Differential Revision: http://reviews.llvm.org/D5373 llvm-svn: 218084
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-181-0/+1
| | | | llvm-svn: 218029
* Implement nonnull-attribute sanitizerAlexey Samsonov2014-09-081-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a new UBSan check, which verifies that function arguments declared to be nonnull with __attribute__((nonnull)) are actually nonnull in runtime. To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs (where applicable) and if function declaration has nonnull attribute specified for a certain formal parameter, we compare the corresponding RValue to null as soon as it's calculated. Test Plan: regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, rnk Differential Revision: http://reviews.llvm.org/D5082 llvm-svn: 217389
* Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.Hal Finkel2014-09-071-0/+4
| | | | | | | | | | | This makes use of the recently-added @llvm.assume intrinsic to implement a __builtin_assume(bool) intrinsic (to provide additional information to the optimizer). This hooks up __assume in MS-compatibility mode to mirror __builtin_assume (the semantics have been intentionally kept compatible), and implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM now contains special logic to deal with assumptions of this form. llvm-svn: 217349
* MS inline asm: Allow __asm blocks to set a return valueReid Kleckner2014-09-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | If control falls off the end of a function after an __asm block, MSVC assumes that the inline assembly filled the EAX and possibly EDX registers with an appropriate return value. This functionality is used in inline functions returning 64-bit integers in system headers, so we need some amount of compatibility. This is implemented in Clang by adding extra output constraints to every inline asm block, and storing the resulting output registers into the return value slot. If we see an asm block somewhere in the function body, we emit a normal epilogue instead of marking the end of the function with a return type unreachable. Normal returns in functions not using this functionality will overwrite the return value slot, and in most cases LLVM should be able to eliminate the dead stores. Fixes PR17201. Reviewed By: majnemer Differential Revision: http://reviews.llvm.org/D5177 llvm-svn: 217187
* Kill one of EmitCallArgs overloads. NFC.Alexey Samsonov2014-08-281-46/+33
| | | | llvm-svn: 216635
* Fix some cases were ArrayRefs were being passed by reference.Craig Topper2014-08-271-5/+5
| | | | llvm-svn: 216527
* Pass actual CXXConstructExpr instead of argument iteratorsAlexey Samsonov2014-08-251-2/+1
| | | | | | into EmitSynthesizedCXXCopyCtorCall. No functionality change. llvm-svn: 216410
* Pass actual CallExpr instead of CallExpr-specific iteratorsAlexey Samsonov2014-08-251-9/+5
| | | | | | | | | | | into EmitCXXMemberOrOperatorCall methods. In the end we want to make declaration visible in EmitCallArgs() method, that would allow us to alter CodeGen depending on function/parameter attributes. No functionality change. llvm-svn: 216404
* DebugInfo: Scope for condition variables more narrowly than the loop variable.David Blaikie2014-08-221-1/+1
| | | | | | | | for loops introduce two scopes - one for the outer loop variable and its initialization, and another for the body of the loop, including any variable declared inside the loop condition. llvm-svn: 216288
* CGCall: Factor out the logic mapping call arguments to LLVM IR arguments.Alexey Samsonov2014-08-221-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This refactoring introduces ClangToLLVMArgMapping class, which encapsulates the information about the order in which function arguments listed in CGFunctionInfo should be passed to actual LLVM IR function, such as: 1) positions of sret, if there is any 2) position of inalloca argument, if there is any 3) position of helper padding argument for each call argument 4) positions of regular argument (there can be many if it's expanded). Simplify several related methods (ConstructAttributeList, EmitFunctionProlog and EmitCall): now they don't have to maintain iterators over the list of LLVM IR function arguments, dealing with all the sret/inalloca/this complexities, and just use expected positions of LLVM IR arguments stored in ClangToLLVMArgMapping. This may increase the running time of EmitFunctionProlog, as we have to traverse expandable arguments twice, but in further refactoring we will be able to speed up EmitCall by passing already calculated CallArgsToIRArgsMapping to ConstructAttributeList, thus avoiding traversing expandable argument there. No functionality change. Test Plan: regression test suite Reviewers: majnemer, rnk Reviewed By: rnk Subscribers: cfe-commits, rjmccall, timurrrr Differential Revision: http://reviews.llvm.org/D4938 llvm-svn: 216251
* Pass expressions instead of argument ranges to EmitCall/EmitCXXConstructorCall.Alexey Samsonov2014-08-211-12/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is a first small step towards passing generic "Expr" instead of ArgBeg/ArgEnd pair into EmitCallArgs() family of methods. Having "Expr" will allow us to get the corresponding FunctionDecl and its ParmVarDecls, thus allowing us to alter CodeGen depending on the function/parameter attributes. No functionality change. Test Plan: regression test suite Reviewers: rnk Reviewed By: rnk Subscribers: aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D4915 llvm-svn: 216214
* ext_vector IRGen. Patch to allow indexing into Fariborz Jahanian2014-08-191-0/+2
| | | | | | | ext_vector_type's 'hi/lo' components when used as lvalue. rdar://18031917 pr20697 llvm-svn: 215991
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-131-2/+2
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* Objective-C ARC. First patch toward generating new APIsFariborz Jahanian2014-08-061-1/+2
| | | | | | | for Objective-C's array and dictionary literals. rdar://17554063. This is wip. llvm-svn: 214983
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-051-1/+6
| | | | | | | | | to instruct the code generator to not enforce a higher alignment than the given number (of bytes) when accessing memory via an opaque pointer or reference. Patch reviewed by John McCall (with post-commit review pending). rdar://16254558 llvm-svn: 214911
* Remove separator parameter from static local naming codeReid Kleckner2014-08-041-1/+0
| | | | | | It was always set to ".", which was duplicated in a few places. llvm-svn: 214792
* MS ABI: Use musttail for vtable thunks that pass arguments by valueReid Kleckner2014-07-261-0/+4
| | | | | | | | | | | | | This moves some memptr specific code into the generic thunk emission codepath. Fixes PR20053. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D4613 llvm-svn: 214004
* Remove an extra parameter and C++11 for loop-ify this codeReid Kleckner2014-07-261-2/+1
| | | | llvm-svn: 214003
* MS ABI: Don't push destructor cleanups for aggregate parameters in thunksReid Kleckner2014-07-251-0/+4
| | | | | | | | The target method of the thunk will perform the cleanup. This can't be tested in 32-bit x86 yet because passing something by value would create an inalloca, and we refuse to generate broken code for that. llvm-svn: 213976
* [OPENMP] Initial parsing and sema analysis for 'atomic' directive.Alexey Bataev2014-07-221-0/+1
| | | | llvm-svn: 213639
* [OPENMP] Initial parsing and sema analysis for 'ordered' directive.Alexey Bataev2014-07-221-0/+1
| | | | llvm-svn: 213616
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-211-37/+0
| | | | | | | | | objects." This commit did break the sanitizer-x86 bot. Revert it while investigating. llvm-svn: 213579
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-211-0/+37
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. llvm-svn: 213576
* [OPENMP] Initial parsing and sema analysis for 'flush' directive.Alexey Bataev2014-07-211-0/+1
| | | | llvm-svn: 213512
* [OPENMP] Parsing/Sema of the OpenMP directive 'critical'.Alexander Musman2014-07-211-0/+1
| | | | llvm-svn: 213510
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-181-20/+0
| | | | | | | | | objects." This reverts commit dbf785a6432f78a8ec229665876647c4cc610d3d, while I qm investigating a buildbot failure. llvm-svn: 213380
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-181-0/+20
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. llvm-svn: 213379
* [OPENMP] Initial parsing and sema analysis for 'taskwait' directive.Alexey Bataev2014-07-181-0/+1
| | | | llvm-svn: 213363
* [OPENMP] Initial parsing and sema analysis for 'barrier' directive.Alexey Bataev2014-07-181-0/+1
| | | | llvm-svn: 213360
* [OPENMP] Initial parsing and sema analysis of 'taskyield' directive.Alexey Bataev2014-07-181-0/+1
| | | | llvm-svn: 213355
* [UBSan] Add !nosanitize metadata to the code generated by UBSan.Alexey Samsonov2014-07-171-0/+11
| | | | | | | | | | This is used to mark the instructions emitted by Clang to implement variety of UBSan checks. Generally, we don't want to instrument these instructions with another sanitizers (like ASan). Reviewed in http://reviews.llvm.org/D4544 llvm-svn: 213291
* [OPENMP] Parsing/Sema analysis of directive 'master'Alexander Musman2014-07-171-0/+1
| | | | llvm-svn: 213237
* [OPENMP] Parsing and sema analysis for 'omp task' directive.Alexey Bataev2014-07-111-0/+1
| | | | llvm-svn: 212804
* Fix the dtor location issues in PR20038 harder.David Blaikie2014-07-101-0/+13
| | | | | | | | | | | | | Originally committed in r211722, this fixed one case of dtor calls being emitted without locations (this causes problems for debug info if the call is then inlined), this caught only some of the cases. Instead of trying to re-enable the location before the cleanup, simply re-enable the location immediately after the unconditional branches in question using a scoped device to ensure the no-location state doesn't leak out arbitrarily. llvm-svn: 212761
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-081-0/+1
| | | | llvm-svn: 212516
* [Sanitizer] Remove brittle cache variable and slightly simplify blacklisting ↵Alexey Samsonov2014-07-071-4/+4
| | | | | | | | | | | | code. Now CodeGenFunction is responsible for looking at sanitizer blacklist (in CodeGenFunction::StartFunction) and turning off instrumentation, if necessary. No functionality change. llvm-svn: 212501
* [OPENMP] Added initial support for 'omp parallel for'.Alexey Bataev2014-07-071-0/+1
| | | | llvm-svn: 212453
* Add an AST node for __leave statements, hook it up.Nico Weber2014-07-071-0/+1
| | | | | | | Codegen is still missing (and I won't work on that), but __leave is now as implemented as __try and friends. llvm-svn: 212425
* Remove CleanupHackLevel from CGException.Logan Chien2014-07-011-2/+0
| | | | | | | | | | | | | | | | | | | | This patch removes the dead code, and refines the getEHResumeBlock() slightly. The CleanupHackLevel was a hack to the old exception handling intrinsics, which have several issues with function inliner. Since LLVM 3.0, the new landingpad and resume instructions are added to LLVM IR. With the new exception handling mechanism, most of the issues are fixed now. We should always use these instructions to implement the exception handling code nowadays, and we don't need the hack any more. Besides, the `CleanupHackLevel` is a compile-time constant, thus other cases have been considered as dead code for a while. llvm-svn: 212097
* Using of variable length arrays in captured statements and OpenMP constructs.Alexey Bataev2014-06-301-3/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D4067 llvm-svn: 212010
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-1/+1
| | | | llvm-svn: 211987
* [OPENMP] Initial parsing and sema analysis for 'single' directive.Alexey Bataev2014-06-261-0/+1
| | | | llvm-svn: 211774
* [OPENMP] Initial parsing and sema analysis for 'section' directive.Alexey Bataev2014-06-261-0/+1
| | | | llvm-svn: 211767
* [OPENMP] Initial support for 'sections' directive.Alexey Bataev2014-06-251-0/+1
| | | | llvm-svn: 211685
* Add R600 builtin codegen.Matt Arsenault2014-06-241-0/+1
| | | | llvm-svn: 211631
* ARM: remove dead CodeGen functions.Tim Northover2014-06-241-3/+0
| | | | | | These two are no longer being used by NEON codegen. llvm-svn: 211586
* [OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with ↵Alexey Bataev2014-06-181-0/+1
| | | | | | MSVC). llvm-svn: 211140
OpenPOWER on IntegriCloud