summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-4/+8
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Use the Itanium ABI for thread_local on Darwin.Bill Wendling2013-05-022-2/+12
| | | | | | | | | | | After some discussion, it was decided to use the Itanium ABI for thread_local on Darwin OS X platforms. This involved a couple of changes. First, we use "_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables are marked with 'internal' linkage, because we want all access to be calls to the Itanium-specific entry point, which has normal linkage. <rdar://problem/13733006> llvm-svn: 180941
* Ensure that the line table for functions with cleanups is sequential.Adrian Prantl2013-05-024-7/+45
| | | | | | | | | | | | | | | | If there is cleanup code, the cleanup code gets the debug location of the closing '}'. The subsequent ret IR-instruction does not get a debug location. The return _expression_ will get the debug location of the return statement. If the function contains only a single, simple return statement, the cleanup code may become the first breakpoint in the function. In this case we set the debug location for the cleanup code to the location of the return statement. rdar://problem/13442648 llvm-svn: 180932
* Use a more idiomatic way to disable debug locations.Adrian Prantl2013-05-021-4/+2
| | | | llvm-svn: 180931
* Revert 180817 because 180816 was reverted.Adrian Prantl2013-04-301-0/+16
| | | | llvm-svn: 180823
* Do not generate VLAs as complex variables any more, as they are nowAdrian Prantl2013-04-301-16/+0
| | | | | | | | | | correctly represented as breg+0 locations in the backend. (Paired commit with LLVM: r180815) rdar://problem/13658587 llvm-svn: 180817
* Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin ↵Richard Smith2013-04-303-38/+0
| | | | | | | | | | | | | | | | systems and did not do the right thing on Darwin. Original commit message: Emit the TLS intialization functions into a list. Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> llvm-svn: 180809
* [ms-cxxabi] Implement member pointer comparisonsReid Kleckner2013-04-301-0/+72
| | | | | | | | | | | | | | | | | | Summary: Like Itanium, comparisons are basically bitwise comparisons of the two values, with an exception for null member function pointers. If two function pointers are null, only the function pointer field matters for comparison purposes. The rest of the bits can be arbitrary. We take advantage of this in isZeroInitializable(), and it may matter once we start emitting conversions. Reviewers: rjmccall CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D695 llvm-svn: 180800
* Struct-path aware TBAA: enable struct-path aware TBAA for classes.Manman Ren2013-04-301-2/+4
| | | | llvm-svn: 180795
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-303-0/+11
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* Emit the TLS intialization functions into a list.Bill Wendling2013-04-293-0/+38
| | | | | | | | | | Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> llvm-svn: 180739
* Struct-path aware TBAA: fix handling of may_alias attribute.Manman Ren2013-04-271-2/+2
| | | | llvm-svn: 180656
* Struct-path aware TBAA: change the format of TBAAStructType node.Manman Ren2013-04-271-3/+3
| | | | | | | We switch the order of offset and field type to make TBAAStructType node (name, parent node, offset) similar to scalar TBAA node (name, parent node). llvm-svn: 180653
* ArrayRefize code. No functionality change.Benjamin Kramer2013-04-262-18/+13
| | | | llvm-svn: 180632
* Support debug info for using directives at global/namespace scope.David Blaikie2013-04-261-1/+4
| | | | llvm-svn: 180594
* TBAA: make sure zero-length bitfield works for tbaa.struct and path-aware tbaaManman Ren2013-04-221-1/+24
| | | | | | | | For ms structs, zero-length bitfields following non-bitfield members are completely ignored, we should not increase the field index. Before the fix, we will have an assertion failure. llvm-svn: 180038
* Use the ugly PRIx64 macro to make format string portable.Benjamin Kramer2013-04-221-1/+1
| | | | | | | This is debugging code so functionality isn't a concern, but mingw32 warns because it doesn't understand the %llx format specifier. llvm-svn: 180024
* Don't emit _ZTW wrappers for TLS variables which don't use the C++ ↵Richard Smith2013-04-221-1/+2
| | | | | | thread_local keyword. llvm-svn: 180004
* Revert "Revert "PR14606: Debug info for using ↵David Blaikie2013-04-223-1/+14
| | | | | | | | directives/DW_TAG_imported_module"" This reverts commit 179839 now that the corresponding LLVM patch has been fixed. llvm-svn: 179997
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-208-1/+69
| | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. llvm-svn: 179958
* Emit the underlying type in the debug info for all kinds of fixed enumsAdrian Prantl2013-04-191-1/+1
| | | | | | | | instead of only C++11-scoped-with-class-tag enums. rdar://problem/13463793 llvm-svn: 179879
* Implement CodeGen for C++11 thread_local, following the Itanium ABI ↵Richard Smith2013-04-198-13/+254
| | | | | | specification as discussed on cxx-abi-dev. llvm-svn: 179858
* Revert "PR14606: Debug info for using directives/DW_TAG_imported_module"Eric Christopher2013-04-193-14/+1
| | | | | | This reverts commit r179837 as it seems to be causing test failures. llvm-svn: 179839
* PR14606: Debug info for using directives/DW_TAG_imported_moduleDavid Blaikie2013-04-193-1/+14
| | | | | | More changes later for using declarations/DW_TAG_imported_declaration. llvm-svn: 179837
* Give CGDebugInfo::getContextDescriptor a more specific return typeDavid Blaikie2013-04-192-10/+7
| | | | | | | Not that the DI* hierarchy is terribly type safe, but this makes the contract a little clearer I think. llvm-svn: 179835
* Set SRet flags properly in '-cxx-abi microsoft'.Timur Iskhodzhanov2013-04-174-72/+125
| | | | | | | | | Also, - abstract out the indirect/in memory/in registers decisions into the CGCXXABI - fix handling of empty struct arguments for '-cxx-abi microsoft' - add/fix tests llvm-svn: 179681
* Don't propagate around TargetOptions in IR-gen; we don't use it.John McCall2013-04-163-14/+9
| | | | | | Patch by Stephen Lin! llvm-svn: 179639
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-1624-120/+126
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* objc_autoreleasePoolPop() can throw if a -dealloc does.John McCall2013-04-161-1/+3
| | | | | | | | | | | | | Model it as throwing so that the exception can be caught. This is generally not expected to have significant code-size impact because the contents of the @autoreleasepool block are very likely to contain a call, very likely at the same cleanup level as the @autoreleasepool itself. rdar://13660038 llvm-svn: 179630
* Sema for Captured StatementsTareq A. Siraj2013-04-161-0/+1
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Implement CapturedStmt ASTTareq A. Siraj2013-04-162-1/+8
| | | | | | | | | | | | | | | CapturedStmt can be used to implement generic function outlining as described in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. CapturedStmt is not exposed to the C api. Serialization and template support are pending. Author: Wei Pan <wei.pan@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D370 llvm-svn: 179615
* [Modules] Convert module specific -fno-modules-autolink into -fno-autolink.Daniel Dunbar2013-04-161-1/+1
| | | | | | | | | - There is no reason to have a modules specific flag for disabling autolinking. Instead, convert the existing flag into -fno-autolink (which should cover other autolinking code generation paths like #pragmas if and when we support them). llvm-svn: 179612
* Objective-C IRGen. Use llvm::WeakVHFariborz Jahanian2013-04-162-12/+17
| | | | | | | | | | for caching couple of global symbols used for generation of CF/NS string meta-data so they are not released prematuely in certain corner cases. // rdar:// 13598026. Reviewed by John M. llvm-svn: 179599
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+1
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* CodeGen support for function-local static thread_local variables withRichard Smith2013-04-147-20/+40
| | | | | | | | | non-constant constructors or non-trivial destructors. Plus bugfixes for thread_local references bound to temporaries (the temporaries themselves are lifetime-extended to become thread_local), and the corresponding case for std::initializer_list. llvm-svn: 179496
* Removed #if 0 code that doesn't compiled if uncommented.Rafael Espindola2013-04-141-9/+0
| | | | llvm-svn: 179495
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-134-6/+12
| | | | | | the AST. llvm-svn: 179447
* Use MapVector rather than simulating it.Richard Smith2013-04-132-8/+7
| | | | llvm-svn: 179438
* Struct-path aware TBAA: uniformize scalar tag and path tag.Manman Ren2013-04-115-24/+61
| | | | | | | | | | | | For struct-path aware TBAA, we used to use scalar type node as the scalar tag, which has an incompatible format with the struct path tag. We now use the same format: base type, access type and offset. We also uniformize the scalar type node and the struct type node: name, a list of pairs (offset + pointer to MDNode). For scalar type, we have a single pair. These are to make implementaiton of aliasing rules easier. llvm-svn: 179335
* [ms-cxxabi] Implement member pointer emission and dereferencingReid Kleckner2013-04-111-52/+281
| | | | | | | | | | | | | | | | | | | | | Summary: Handles all inheritance models for both data and function member pointers. Also implements isZeroInitializable() and refactors some of the null member pointer code. MSVC supports converting member pointers through virtual bases, which clang does not (yet?) support. Implementing that extension is covered by http://llvm.org/15713 Reviewers: rjmccall CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D613 llvm-svn: 179305
* Force a load when creating a reference to a temporary copied from a bitfield.Jordan Rose2013-04-111-129/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this source: const int &ref = someStruct.bitfield; We used to generate this AST: DeclStmt [...] `-VarDecl [...] ref 'const int &' `-MaterializeTemporaryExpr [...] 'const int' lvalue `-ImplicitCastExpr [...] 'const int' lvalue <NoOp> `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...] `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X' Notice the lvalue inside the MaterializeTemporaryExpr, which is very confusing (and caused an assertion to fire in the analyzer - PR15694). We now generate this: DeclStmt [...] `-VarDecl [...] ref 'const int &' `-MaterializeTemporaryExpr [...] 'const int' lvalue `-ImplicitCastExpr [...] 'int' <LValueToRValue> `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...] `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X' Which makes a lot more sense. This allows us to remove code in both CodeGen and AST that hacked around this special case. The commit also makes Clang accept this (legal) C++11 code: int &&ref = std::move(someStruct).bitfield PR15694 / <rdar://problem/13600396> llvm-svn: 179250
* Don't copy just to capture a strong block pointer under ARC.John McCall2013-04-081-7/+27
| | | | | | | | | It turns out that the optimizer can't eliminate this without extra information, for which there's a separate bug. rdar://13588325 llvm-svn: 179069
* The PNaCl target no longer permits __attribute__((regparm)).Eli Bendersky2013-04-081-32/+14
| | | | | | | Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo and adjust tests accordingly. llvm-svn: 179059
* fix indentationAdrian Prantl2013-04-081-1/+1
| | | | llvm-svn: 179052
* Remove nondeterminism introduced in r178950.Richard Smith2013-04-062-11/+14
| | | | llvm-svn: 178952
* When an internal-linkage function or variable is declared within an extern "C"Richard Smith2013-04-062-0/+69
| | | | | | | | | | linkage specification, and is marked as __attribute__((used)), try to also give it the unmangled name (by emitting an internal linkage alias) if nothing else within the translation unit would use that name. This allows inline asm in that translation unit to use the entity via its unmangled name, which people apparently rely on. llvm-svn: 178950
* <rdar://problem/13325066> Destroy std::initializer_list temporaries whose ↵Douglas Gregor2013-04-061-4/+20
| | | | | | lifetime has been extended by reference binding. llvm-svn: 178939
* Proper prefix for doxygen commentsEli Bendersky2013-04-051-3/+3
| | | | llvm-svn: 178878
* Allow EmitConstantInit() to emit constant initializers for objects with ↵Alexey Samsonov2013-04-051-2/+1
| | | | | | trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker. llvm-svn: 178856
* Add some documentation for PNaClABIInfo.Eli Bendersky2013-04-041-8/+17
| | | | llvm-svn: 178802
OpenPOWER on IntegriCloud