summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Use early exits to reduce indentation.Eric Christopher2015-10-271-46/+48
| | | | llvm-svn: 251371
* [X86] Mark inregs correctly for MCU psABIMichael Kuperstein2015-10-251-5/+18
| | | | | | | | | The MCU psABI calling convention is somewhat, but not quite, like -mregparm 3. In particular, the rules involving structs are different. Differential Revision: http://reviews.llvm.org/D13978 llvm-svn: 251224
* Module Debugging: Emit module debug info for types inside of Objective-CAdrian Prantl2015-10-231-0/+4
| | | | | | | | containers. rdar://problem/23196170 llvm-svn: 251120
* Remove a redundant check. NFCAdrian Prantl2015-10-231-2/+1
| | | | llvm-svn: 251116
* Use newly introduced interfaces in LLVM (NFC)Xinliang David Li2015-10-222-3/+3
| | | | | | | Replaced references to raw strings in instrumentation and coverage code. llvm-svn: 251072
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-225-72/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* [MS ABI] Don't crash when inheriting from base with trailing empty array memberDavid Majnemer2015-10-221-1/+1
| | | | | | | | | | We got this right for Itanium but not MSVC because CGRecordLayoutBuilder was checking if the base's size was zero when it should have been checking the non-virtual size. This fixes PR21040. llvm-svn: 251036
* Enable ARC on the fragile runtime.John McCall2015-10-211-2/+7
| | | | | | | | | | | | | | | | This is almost entirely a matter of just flipping a switch. 99% of the runtime support is available all the way back to when it was implemented in the non-fragile runtime, i.e. in Lion. However, fragile runtimes do not recognize ARC-style ivar layout strings, which means that accessing __strong or __weak ivars reflectively (e.g. via object_setIvar) will end up accessing the ivar as if it were __unsafe_unretained. Therefore, when using reflective technologies like KVC, be sure that your paths always refer to a property. rdar://23209307 llvm-svn: 250955
* Fix and stylize the emission of GC/ARC ivar and GC block layout strings.John McCall2015-10-211-397/+405
| | | | | | | | | | | | | | | Specifically, handle under-aligned object references (by explicitly ignoring them, because this just isn't representable in the format; yes, this means that GC silently ignores such references), descend into anonymous structs and unions, stop classifying fields of pointer-to-strong/weak type as strong/weak in ARC mode, and emit skips to cover the entirety of block layouts in GC mode. As a cleanup, extract this code into a helper class, avoid a number of unnecessary copies and layout queries, generate skips implicitly instead of explicitly tracking them, and clarify the bitmap-creation logic. llvm-svn: 250919
* Unify the ObjC entrypoint caches.John McCall2015-10-215-49/+47
| | | | llvm-svn: 250918
* In ARC, peephole the initialization of a __weak variable withJohn McCall2015-10-211-0/+47
| | | | | | | a value loaded from a __weak variable into a call to objc_copyWeak or objc_moveWeak. llvm-svn: 250916
* Use ArrayRef and MutableArrayRef instead of a pointer and size. NFCCraig Topper2015-10-211-5/+2
| | | | llvm-svn: 250876
* Roll-back r250822.Angel Garcia Gomez2015-10-2010-10/+11
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-2010-11/+10
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Put back dead code that's used out-of-tree.Benjamin Kramer2015-10-201-0/+30
| | | | | | Partially reverts r250418. llvm-svn: 250803
* [DEBUG INFO] Emit debug info for type used in explicit cast only.Alexey Bataev2015-10-207-9/+26
| | | | | | | Currently debug info for types used in explicit cast only is not emitted. It happened after a patch for better alignment handling. This patch fixes this bug. Differential Revision: http://reviews.llvm.org/D13582 llvm-svn: 250795
* Fix 'will be initialized after' warning.Manuel Klimek2015-10-191-2/+2
| | | | llvm-svn: 250691
* [X86] Enable soft float ABI for x86Michael Kuperstein2015-10-191-11/+16
| | | | | | | | | The Intel MCU psABI requires floating-point values to be passed in-reg. This makes the x86-32 ABI code respect "-mfloat-abi soft" and generate float inreg arguments. Differential Revision: http://reviews.llvm.org/D13554 llvm-svn: 250689
* Use saner variable names. NFC.Michael Kuperstein2015-10-191-15/+23
| | | | llvm-svn: 250687
* CodeGen: simplify TargetOptions setupSaleem Abdulrasool2015-10-181-17/+12
| | | | | | | Do direct assignment of boolean values and regroup. Use StringSwitch instead of custom cases. NFC. llvm-svn: 250665
* Make a bunch of static arrays const.Craig Topper2015-10-182-4/+4
| | | | llvm-svn: 250647
* Add an error when calling a builtin that requires features that don'tEric Christopher2015-10-153-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | match the feature set of the function that they're being called from. This ensures that we can effectively diagnose some[1] code that would instead ICE in the backend with a failure to select message. Example: __m128d foo(__m128d a, __m128d b) { return __builtin_ia32_addsubps(b, a); } compiled for normal x86_64 via: clang -target x86_64-linux-gnu -c would fail to compile in the back end because the normal subtarget features for x86_64 only include sse2 and the builtin requires sse3. [1] We're still not erroring on: __m128i bar(__m128i const *p) { return _mm_lddqu_si128(p); } where we should fail and error on an always_inline function being inlined into a function that doesn't support the subtarget features required. llvm-svn: 250473
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-151-2/+2
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* Put back doxygen comment accidentally dropped in r250418.Benjamin Kramer2015-10-151-0/+5
| | | | llvm-svn: 250428
* [CodeGen] Remove dead code. NFC.Benjamin Kramer2015-10-1515-235/+1
| | | | llvm-svn: 250418
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-151-2/+2
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-151-2/+2
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* Update clang for DIBuilder::createSubroutineType API change.Eric Christopher2015-10-151-7/+6
| | | | | | Patch by Amaury Sechet! llvm-svn: 250373
* [X86] Add XSAVE intrinsic familyAmjad Aboud2015-10-131-0/+40
| | | | | | | | | | | | Add intrinsics for the XSAVE instructions (XSAVE/XSAVE64/XRSTOR/XRSTOR64) XSAVEOPT instructions (XSAVEOPT/XSAVEOPT64) XSAVEC instructions (XSAVEC/XSAVEC64) XSAVES instructions (XSAVES/XSAVES64/XRSTORS/XRSTORS64) Differential Revision: http://reviews.llvm.org/D13014 llvm-svn: 250158
* Support Debug Info path remappingSaleem Abdulrasool2015-10-122-8/+25
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* [WinEH] Push cleanupendpad scopes around exceptional cleanupsReid Kleckner2015-10-082-41/+37
| | | | | | | We were only doing this for SEH as a special case. Generalize it to all cleanups. llvm-svn: 249748
* [CodeGen] [CodeGen] Attach function attributes to functions created inAkira Hatanaka2015-10-083-12/+24
| | | | | | | | | | | | | | | | | | CGBlocks.cpp. This commit fixes a bug in clang's code-gen where it creates the following functions but doesn't attach function attributes to them: __copy_helper_block_ __destroy_helper_block_ __Block_byref_object_copy_ __Block_byref_object_dispose_ rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13525 llvm-svn: 249735
* [CodeGen] Check if the Decl pointer passed is null, and if so, returnAkira Hatanaka2015-10-081-7/+15
| | | | | | | | | | | early. This is needed in a patch I plan to commit later, in which a null Decl pointer is passed to SetLLVMFunctionAttributesForDefinition. Relevant discussion is in http://reviews.llvm.org/D13525. llvm-svn: 249722
* CGStmtOpenMP.cpp: Prune redundant \param. [-Wdocumentation]NAKAMURA Takumi2015-10-081-1/+0
| | | | llvm-svn: 249698
* [OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.Alexey Bataev2015-10-083-125/+489
| | | | | | OpenMP 4.1 adds support for array sections/subscripts in 'reduction' clause. Patch adds codegen for this feature. llvm-svn: 249672
* [MSVC Compat] Enable ABI impacting non-conforming behavior independently of ↵David Majnemer2015-10-082-2/+2
| | | | | | | | | | -fms-compatibility No ABI for C++ currently makes it possible to implement the standard 100% perfectly. We wrongly hid some of our compatible behavior behind -fms-compatibility instead of tying it to the compiler ABI. llvm-svn: 249656
* [WinEH] Remove NewMSEH and enable its behavior by defaultReid Kleckner2015-10-084-76/+44
| | | | | | | Testing has shown that it is at least as reliable as the old landingpad pattern matching code. llvm-svn: 249647
* Don't emit exceptional stackrestore cleanups around inalloca functionsReid Kleckner2015-10-082-18/+2
| | | | | | | | The backend restores the stack pointer after recovering from an exception. This is similar to r245879, but it doesn't try to use the normal cleanup mechanism, so hopefully it won't cause the same breakage. llvm-svn: 249640
* [WinEH] Don't use lifetime markers for MS catch parametersReid Kleckner2015-10-071-1/+7
| | | | | | | | | We don't have a good place to put them. Our previous spot was causing us to optimize loads from the exception object to undef, because it was after the catchpad instruction that models the write to the catch object. llvm-svn: 249616
* Fix crash in codegen on casting to `bool &`.Alexey Bataev2015-10-071-1/+1
| | | | | | | | Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*. Differential Revision: http://reviews.llvm.org/D13325 llvm-svn: 249534
* [SEH] Fix x64 __exception_code in __except blocksReid Kleckner2015-10-071-8/+15
| | | | | | | Use llvm.eh.exceptioncode to get the code out of EAX for x64. For 32-bit, the filter is responsible for storing it to memory for us. llvm-svn: 249497
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-065-27/+22
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Re-introduce the unique_ptr removed in r249328 and just makeAdrian Prantl2015-10-051-4/+3
| | | | | | | | ~CodeGenABITypes out-of-line, which should have the same effect. Thanks to David Blaikie for pointing this out! llvm-svn: 249336
* Undo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762.Adrian Prantl2015-10-051-0/+5
| | | | | | | | | | include/clang/CodeGenABITypes.h is in meant to be included by external users, but using a unique_ptr on the private CodeGenModule introduces a dependency on the type definition that prevents such a use. NFC llvm-svn: 249328
* [OpenCL] Fix casting a true boolean to an integer vector.Anastasia Stulova2015-10-051-4/+22
| | | | | | | | | | | | | OpenCL v1.1 s6.2.2: for the boolean value true, every bit in the result vector should be set. This change treats the i1 value as signed for the purposes of performing the cast to integer, and therefore sign extend into the result. Patch by Neil Hickey! http://reviews.llvm.org/D13349 llvm-svn: 249301
* Module Debugging: Emit (ObjC) function declarations in the module scopeAdrian Prantl2015-10-041-1/+1
| | | | | | when building a module. llvm-svn: 249282
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-1/+1
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* Replace double-negated !SourceLocation.isInvalid() with ↵Yaron Keren2015-10-032-3/+3
| | | | | | SourceLocation.isValid(). llvm-svn: 249228
* Don't nil check non-nil class receiver of AArch64 stret calls.Ahmed Bougacha2015-10-021-1/+1
| | | | | | | | | | | I randomly came across this difference between AArch64 and other targets: on the latter, we don't emit nil checks for known non-nil class method calls thanks to r247350, but we still do for AArch64 stret calls. They use different code paths, because those are special, as they go through the regular msgSend, not the msgSend*_stret variants. llvm-svn: 249205
* Emiting invariant.group.barrier for ctors bugfixPiotr Padlewski2015-10-021-10/+11
| | | | | | | | | | | | | Ensure that the vptr store in the most-derived constructor is not behind an invariant group barrier. Previously, the base-most vptr store would be the one behind no barrier, and that could result in the creator of the object thinking it had the base-most vtable. This bug caused clang call pure virtual functions when called from constructor body. http://reviews.llvm.org/D13373 llvm-svn: 249197
OpenPOWER on IntegriCloud