summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for __builtin_{add,sub,mul}_overflow.John McCall2015-10-291-1/+127
| | | | | | Patch by David Grayson! llvm-svn: 251651
* [WinEH] Mark calls inside cleanups as noinlineReid Kleckner2015-10-283-11/+27
| | | | | | | | | | | | | | | This works around PR25162. The MSVC tables make it very difficult to correctly inline a C++ destructor that contains try / catch. We've attempted to address PR25162 in LLVM's backend, but it feels pretty infeasible. MSVC and ICC both appear to avoid inlining such complex destructors. Long term, we want to fix this by making the inliner smart enough to know when it is inlining into a cleanup, so it can inline simple destructors (~unique_ptr and ~vector) while avoiding destructors containing try / catch. llvm-svn: 251576
* Fix the calling convention of Mingw64 long double valuesReid Kleckner2015-10-281-11/+22
| | | | | | | | | | GCC uses the x87DoubleExtended model for long doubles, and passes them indirectly by address through function calls. Also replace the existing mingw-long-double assembly emitting test with an IR-level test. llvm-svn: 251567
* Move global classes into anonymous namespaces. NFC.Benjamin Kramer2015-10-281-2/+2
| | | | llvm-svn: 251528
* Put global classes into the appropriate namespace.Benjamin Kramer2015-10-282-2/+4
| | | | | | | Most of the cases belong into an anonymous namespace. No functionality change intended. llvm-svn: 251514
* Reflow comment.Eric Christopher2015-10-281-6/+4
| | | | llvm-svn: 251501
* [CodeGen] Attach function attributes to Objective-C and OpenMPAkira Hatanaka2015-10-282-7/+12
| | | | | | | | | | | | | | functions. This commit fixes a bug in CGOpenMPRuntime.cpp and CGObjC.cpp where some of the function attributes are not attached to newly created functions. rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13928 llvm-svn: 251476
* Allow linking multiple bitcode files.Artem Belevich2015-10-271-53/+61
| | | | | | | | | | | | | | | | | | Linking options for particular file depend on the option that specifies the file. Currently there are two: * -mlink-bitcode-file links in complete content of the specified file. * -mlink-cuda-bitcode links in only the symbols needed by current TU. Linked symbols are internalized. This bitcode linking mode is used to link device-specific bitcode provided by CUDA. Files are linked in order they are specified on command line. -mlink-cuda-bitcode replaces -fcuda-uses-libdevice flag. Differential Revision: http://reviews.llvm.org/D13913 llvm-svn: 251427
* Access the right triple field for IAMCU.Michael Kuperstein2015-10-271-2/+2
| | | | llvm-svn: 251396
* Handle target builtin options that are all required rather thanEric Christopher2015-10-271-4/+9
| | | | | | | | | | | | | | | | | only one of a group of possibilities. This changes the syntax in the builtin files to represent: , as the and operator | as the or operator The former syntax matches how the backend tablegen files represent multiple subtarget features being required. Updated the builtin and intrinsic headers accordingly for the new syntax. llvm-svn: 251388
* [coroutines] Creation of promise object, lookup of operator co_await, buildingRichard Smith2015-10-271-0/+4
| | | | | | of await_* calls, and AST representation for same. llvm-svn: 251387
* 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
OpenPOWER on IntegriCloud