summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Add a separate llvm.global_ctors entry for linkonce_odr data initializersReid Kleckner2013-08-221-0/+13
| | | | | | | | | | | | | | | Summary: These typically come from static data members of class template specializations. This accomplishes two things: 1. May expose GlobalOpt optimizations for Itanium C++ ABI code. 2. Works toward fixing double initialization in the Microsoft C++ ABI. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1475 llvm-svn: 189051
* DebugInfo: emit the definition of types when construction vtables are ↵David Blaikie2013-08-221-3/+6
| | | | | | | | | | required as these types may never end up emitting the full class data This might be able to be optimized further by only doing this in the absence of a key function, but it doesn't look like GCC is doing that so I'm not rushing to do it just yet. llvm-svn: 189022
* DebugInfo: Remove explicit declaration-emissiong handling now that we have a ↵David Blaikie2013-08-222-42/+32
| | | | | | | | more principled approach (the 'requires complete type' callback) No functionality change intended. llvm-svn: 189013
* Revert "Implement a rudimentary form of generic lambdas."Manuel Klimek2013-08-221-1/+1
| | | | | | This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7. llvm-svn: 189004
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the following features are not included in this commit: - any sort of capturing within generic lambdas - nested lambdas - conversion operator for captureless lambdas - ensuring all visitors are generic lambda aware As an example of what compiles: template <class F1, class F2> struct overload : F1, F2 { using F1::operator(); using F2::operator(); overload(F1 f1, F2 f2) : F1(f1), F2(f2) { } }; auto Recursive = [](auto Self, auto h, auto ... rest) { return 1 + Self(Self, rest...); }; auto Base = [](auto Self, auto h) { return 1; }; overload<decltype(Base), decltype(Recursive)> O(Base, Recursive); int num_params = O(O, 5, 3, "abc", 3.14, 'a'); Please see attached tests for more examples. Some implementation notes: - Add a new Declarator context => LambdaExprParameterContext to clang::Declarator to allow the use of 'auto' in declaring generic lambda parameters - Augment AutoType's constructor (similar to how variadic template-type-parameters ala TemplateTypeParmDecl are implemented) to accept an IsParameterPack to encode a generic lambda parameter pack. - Add various helpers to CXXRecordDecl to facilitate identifying and querying a closure class - LambdaScopeInfo (which maintains the current lambda's Sema state) was augmented to house the current depth of the template being parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth) so that Sema::ActOnLambdaAutoParameter may use it to create the appropriate list of corresponding TemplateTypeParmDecl for each auto parameter identified within the generic lambda (also stored within the current LambdaScopeInfo). Additionally, a TemplateParameterList data-member was added to hold the invented TemplateParameterList AST node which will be much more useful once we teach TreeTransform how to transform generic lambdas. - SemaLambda.h was added to hold some common lambda utility functions (this file is likely to grow ...) - Teach Sema::ActOnStartOfFunctionDef to check whether it is being called to instantiate a generic lambda's call operator, and if so, push an appropriately prepared LambdaScopeInfo object on the stack. - Teach Sema::ActOnStartOfLambdaDefinition to set the return type of a lambda without a trailing return type to 'auto' in C++1y mode, and teach the return type deduction machinery in SemaStmt.cpp to process either C++11 and C++14 lambda's correctly depending on the flag. - various tests were added - but much more will be needed. A greatful thanks to all reviewers including Eli Friedman, James Dennett and the ever illuminating Richard Smith. And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified! Thanks! llvm-svn: 188977
* DebugInfo: Require only the declaration of types only used as parameter and ↵David Blaikie2013-08-211-2/+2
| | | | | | return types llvm-svn: 188962
* Don't use mangleCXXRTTIName in TBAA for C code.Manman Ren2013-08-211-3/+8
| | | | | | | | | | | With r185721, calling mangleCXXRTTIName on C code will cause crashes. This commit fixes crashes on C testing cases when turning on struct-path TBAA. For C code, we simply use the Decl name without the context. This can cause two different structs having the same name, and may cause inaccurate but conservative alias results. llvm-svn: 188930
* [CGF] Get rid of passing redundant VTable pointer around in ↵Timur Iskhodzhanov2013-08-212-11/+4
| | | | | | CodeGenFunction::InitializeVTablePointer[s] llvm-svn: 188909
* Sema: Use the right type for PredefinedExpr when it's in a lambda.Benjamin Kramer2013-08-211-8/+15
| | | | | | | | | | | | | 1. We now print the return type of lambdas and return type deduced functions as "auto". Trailing return types with decltype print the underlying type. 2. Use the lambda or block scope for the PredefinedExpr type instead of the parent function. This fixes PR16946, a strange mismatch between type of the expression and the actual result. 3. Verify the type in CodeGen. 4. The type for blocks is still wrong. They are numbered and the name is not known until CodeGen. llvm-svn: 188900
* Abstract out virtual calls and virtual function prologue code generation; ↵Timur Iskhodzhanov2013-08-2110-28/+194
| | | | | | implement them for -cxx-abi microsoft llvm-svn: 188870
* DebugInfo: comment/inlining based on feedback from Eric & AdrianDavid Blaikie2013-08-202-18/+16
| | | | llvm-svn: 188834
* DebugInfo: Simplify/clarify propagation of typemembers between declaration ↵David Blaikie2013-08-202-32/+21
| | | | | | | | | and definition Based on code review feedback from Eric Christopher (on r188739) and Adrian Prantl (r188642). llvm-svn: 188829
* Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic ↵David Blaikie2013-08-203-34/+97
| | | | | | | | | | | | | | classes in TUs that do not have the vtable for that class"""" This reverts commit r188687 (reverts r188642 (reverts 188600 (reverts 188576))). With added test coverage & fix for -gline-tables-only. Thanks Michael Gottesman for reverting this patch when it demonstrated problems & providing a reproduction/details to help me track this down. llvm-svn: 188739
* Fix last commit.Juergen Ributzka2013-08-191-1/+1
| | | | llvm-svn: 188724
* Simplify code by using CreateMemTemp. No functional change intended.Juergen Ributzka2013-08-191-18/+9
| | | | | Reviewer: Eli llvm-svn: 188722
* PR16933: Don't try to codegen things after we've seen errors.David Blaikie2013-08-195-27/+19
| | | | | | | | Refactor the underlying code a bit to remove unnecessary calls to "hasErrorOccurred" & make them consistently at all the entry points to the IRGen ASTConsumer. llvm-svn: 188707
* Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in ↵Michael Gottesman2013-08-193-96/+35
| | | | | | | | | | | | | TUs that do not have the vtable for that class""" This reverts commit r188642. This change is causing LTO builds to cause our 16 GB machines to swap and OOM all weekend. I am going to work with Dave Blaikie to resolve the issue. Sorry Dave =(. llvm-svn: 188687
* Fix -Wcovered-switch-default warning from r188664Alexey Samsonov2013-08-191-1/+1
| | | | llvm-svn: 188672
* XCore target: Add target specific EmitVAArgRobert Lytton2013-08-191-1/+41
| | | | | | This is so aggregates can be passed as var args too. llvm-svn: 188664
* DebugInfo: Do not include line/file info for artificial parameters & ↵David Blaikie2013-08-191-5/+18
| | | | | | parameters of artificial functions llvm-svn: 188651
* Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that ↵David Blaikie2013-08-183-35/+96
| | | | | | | | | | | | do not have the vtable for that class"" This reverts commit r188600. r188640/r188639 fixed the root cause of the crash-on-valid that r188600 originally introduced. This now appears to bootstrap debug clang successfully to the best of my testing. llvm-svn: 188642
* DebugInfo: Avoid duplicating types that may be created during the process of ↵David Blaikie2013-08-181-0/+13
| | | | | | | | | | | | creating their context A partner to r188639, this is a somewhat heavy-handed fix to the general issue, since even after that prior change the issue does still unavoidably arise with template parameters (see test case). There are other ways we could consider addressing this (see FIXME). llvm-svn: 188640
* DebugInfo: Don't emit vbase 'containing types' for context chain limited typesDavid Blaikie2013-08-182-25/+32
| | | | | | | | | Possible minor reduction in debug info & avoid some cases where creating a context chain could lead to the type the context chain is being created for, being created. (this is still possible with template parameters - tests/fixes/improvements to follow) llvm-svn: 188639
* DebugInfo: don't require full definitions for friend classesDavid Blaikie2013-08-181-3/+2
| | | | | | | | | | Fixes a crash-on-valid introduced by r188486 (which should've occurred earlier but for a blatant bug where calling createFwdDecl from the requireCompleteType callback was useless under -flimit-debug-info and we were just getting lucky with other later callbacks requiring the type anyway). llvm-svn: 188622
* PR16927: Don't assert (or, previously, skip) static data members of ↵David Blaikie2013-08-171-3/+0
| | | | | | enumeration type llvm-svn: 188612
* Fix the name and the type of the argument for intriniscJuergen Ributzka2013-08-171-0/+10
| | | | | | | | _mm256_broadcastsi128_si256 to align with the Intel documentation. This fixes bug PR 16581 and rdar:14747994. llvm-svn: 188609
* Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not ↵David Blaikie2013-08-173-84/+33
| | | | | | | | | | have the vtable for that class" This reverts commit r188576. Reverting while I investigate a selfhosting buildbot failure on Darwin. llvm-svn: 188600
* DebugInfo: Canonicalize namespaces to avoid emitting multiple namespaces ↵David Blaikie2013-08-161-0/+1
| | | | | | | | | | | | with the same name but different lines Updated test case to not rely on line numbers in more cases (it's hard to use the @ check syntax for debug info test cases (due to the interesting ordering of metadata) and this case in particular (given the hash-line directive)) - left a few in there to cover the line number information for these. llvm-svn: 188585
* DebugInfo: Omit debug info for dynamic classes in TUs that do not have the ↵David Blaikie2013-08-163-33/+84
| | | | | | | | | vtable for that class This reduces Clang's .dwo (fission debug info) size by 23% over Clang+LLVM. llvm-svn: 188576
* DebugInfo: Contrain the record type parameter for CollectRecordFieldsDavid Blaikie2013-08-162-5/+5
| | | | | | | This is the correct type (as is demonstrated by the fact that the caller didn't need to change) & will be useful in a future patch. llvm-svn: 188575
* Revert r188498.Evgeniy Stepanov2013-08-162-24/+19
| | | | | | This change broke release+asserts build with compiler-rt. llvm-svn: 188539
* DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its ↵David Blaikie2013-08-152-11/+9
| | | | | | result. llvm-svn: 188501
* Remove unnecessary explicit cast.David Blaikie2013-08-151-1/+1
| | | | llvm-svn: 188500
* DebugInfo: Split out the implementation of getStaticDataMemberDeclaration ↵David Blaikie2013-08-152-19/+24
| | | | | | for future use llvm-svn: 188498
* Fix assert added in r188494David Blaikie2013-08-151-1/+1
| | | | llvm-svn: 188496
* DebugInfo: Remove unused conditionalDavid Blaikie2013-08-151-3/+2
| | | | llvm-svn: 188494
* DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type ↵David Blaikie2013-08-152-7/+6
| | | | | | | | | match the semantics Rather than having a cast immediately inside the function, push that type requirement out to the callers. llvm-svn: 188492
* DebugInfo: Add a FIXME, remove a FIXME.David Blaikie2013-08-151-3/+4
| | | | | | | (the removed FIXME no longer applies since we made this debug info optimization not apply to C) llvm-svn: 188491
* DebugInfo: Unify & optimize the lazy addition of record typesDavid Blaikie2013-08-154-17/+32
| | | | | | | | | | | | | | | Rather than going through the whole getOrCreateType machinery to manifest a type, cut straight to the implementation because we know we have to do work. While the previous implementation was sufficient for the two cases (completeness and required completeness) we have already (the general machinery could inspect the type for those attributes & go down the full definition path), a pending change (to emit info for types when we emit their vtables) won't have that luxury & we'll need to force the creation rather than relying on the general purpose routine. llvm-svn: 188486
* DebugInfo: Revert change to the return type of createRecordFwdDeclDavid Blaikie2013-08-152-7/+4
| | | | | | | It still does only return DICompositeType, but I've no need to make that change right now. llvm-svn: 188482
* CodeGen: __uuidof should work even with an incomplete _GUID typeDavid Majnemer2013-08-152-37/+23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue will be foiled: the type of the constant value is incomplete. Instead, create an unnamed type with the proper layout on all platforms. Punt the problem of wrongly defined struct _GUID types to the user. (It's impossible because the TU may never get to see the type and thus we can't verify that it is suitable.) This fixes PR16856. Reviewers: rsmith, rnk, thakis Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1375 llvm-svn: 188481
* DebugInfo: remove unnecessary type registrationDavid Blaikie2013-08-151-1/+0
| | | | | | This happens in the caller a few frames up anyway. llvm-svn: 188475
* DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.David Blaikie2013-08-152-7/+11
| | | | | | | No functionality change, at best a slight (questionable) optimization, but necessary for correctness of future work. llvm-svn: 188474
* Fix the build failure of Realease versionHao Liu2013-08-151-1/+1
| | | | llvm-svn: 188456
* Clang and AArch64 backend patches to support shll/shl and vmovl instructions ↵Hao Liu2013-08-151-0/+43
| | | | | | and ACLE functions llvm-svn: 188452
* Add support for -fsanitize-blacklist and default blacklists for DFSan.Peter Collingbourne2013-08-141-1/+4
| | | | | | | | Also add some documentation. Differential Revision: http://llvm-reviews.chandlerc.com/D1346 llvm-svn: 188403
* Add XCore targetRobert Lytton2013-08-131-0/+19
| | | | llvm-svn: 188258
* [-cxx-abi microsoft] Mangle __uuidof correctly into template parametersDavid Majnemer2013-08-131-11/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that __uuidof introduces a global extern "C" declaration of type __s_GUID. However, our implementation of __uuidof does not provide such a declaration and thus must open-code the mangling for __uuidof in template parameters. This allows us to codegen scoped COM pointers and other such things. This fixes PR16836. Depends on D1356. Reviewers: rnk, cdavis5x, rsmith Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1357 llvm-svn: 188252
* Drive by cleanupDavid Blaikie2013-08-131-7/+2
| | | | llvm-svn: 188251
* DebugInfo: Simplify declaration building code - relying on the limit debug ↵David Blaikie2013-08-121-17/+6
| | | | | | info checking already in CreateType(RecordType) llvm-svn: 188222
OpenPOWER on IntegriCloud