summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Revert some Hexagon builtin commits to match reverts done to LLVM inChandler Carruth2012-04-181-749/+155
| | | | | | | | | | | | | | | | | | | r155047. See the LLVM log for the primary motivation: http://llvm.org/viewvc/llvm-project?rev=155047&view=rev Primary commit r154828: - Several issues were raised in review, and fixed in subsequent commits. - Follow-up commits also reverted, and which should be folded into the original before reposting: - r154837: Re-add the 'undef BUILTIN' thing to fix the build. - r154928: Fix build warnings, re-add (and correct) header and license - r154937: Typo fix. Please resubmit this patch with the relevant LLVM resubmission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155048 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix case where the alignment is overaligned, per Eli's suggestion.Chad Rosier2012-04-171-1/+4
| | | | | | | rdar://11220251 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154893 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure EmitMoveFromReturnSlot is passing the correct alignment toChad Rosier2012-04-171-1/+1
| | | | | | | | EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment). rdar://11220251 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154883 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Eric Christopher2012-04-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154880 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154851 91177308-0d34-0410-b5e6-96231b3b80d8
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-1/+6
| | | | | | | up to this yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154835 91177308-0d34-0410-b5e6-96231b3b80d8
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-161-155/+749
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154828 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust for LLVM name tweaks requested by Chandler.Duncan Sands2012-04-162-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154824 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-167-79/+93
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154789 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MDBuilder to help with metadata creation.Duncan Sands2012-04-153-43/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154767 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12226: don't generate wrong code if a braced string literal is used toRichard Smith2012-04-152-14/+4
| | | | | | | | | | initialize an array of unsigned char. Outside C++11 mode, this bug was benign, and just resulted in us emitting a constant which was double the required length, padded with 0s. In C++11, it resulted in us generating an array whose first element was something like i8 ptrtoint ([n x i8]* @str to i8). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154756 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands2012-04-141-2/+1
| | | | | | | | | | thinking of generalizing it to be able to specify other freedoms beyond accuracy (such as that NaN's don't have to be respected). I'd like the 3.1 release (the first one with this metadata) to have the more generic name already rather than having to auto-upgrade it in 3.2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154745 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-142-0/+8
| | | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't enter cleanups for unreachable variables. It's impossible toJohn McCall2012-04-132-0/+6
| | | | | | | | jump into these scopes, and the cleanup-entering code sometimes wants to do some operations first (e.g. a GEP), which can leave us with unparented IR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154684 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid string thrashing when we can concatenate them in the final buffer.Benjamin Kramer2012-04-131-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154678 91177308-0d34-0410-b5e6-96231b3b80d8
* Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov2012-04-134-43/+119
| | | | | | | | - Handle unions - Handle C++ classes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154664 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith2012-04-131-1/+11
| | | | | | | GNU __atomic builtins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a trivial oversight with apple-kext static local destructorsJohn McCall2012-04-131-0/+1
| | | | | | and add a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154653 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-132-4/+179
| | | | | | | | | | | | | | | | | | | | | | | | | __atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some i1/i8 confusion within _Atomic(bool) in IR generation, bothDouglas Gregor2012-04-122-6/+10
| | | | | | | | | | | | | | | | in general (such an atomic has boolean representation) and specifically for IR generation of __c11_atomic_init. The latter also means actually using initialization semantics for this initialization, rather than just creating a store. On a related note, make sure we actually put in non-atomic-to-atomic conversions when performing an implicit conversion sequence. IR generation is far too kind here, but we still want the ASTs to make sense. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154612 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for 18 of the GNU-compatible __atomic builtins.Richard Smith2012-04-121-50/+175
| | | | | | | | | | | | | This is not quite sufficient for libstdc++'s <atomic>: we still need __atomic_test_and_set and __atomic_clear, and may need a more complete __atomic_is_lock_free implementation. We are also missing an implementation of __atomic_always_lock_free, __atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed for libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154579 91177308-0d34-0410-b5e6-96231b3b80d8
* These functions too have no prototypes. Audited the rest of Sema forEric Christopher2012-04-122-4/+4
| | | | | | | | FunctionDecl::Create calls as well. rdar://11079003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154578 91177308-0d34-0410-b5e6-96231b3b80d8
* static functions have a need for mangled name debug information too.Eric Christopher2012-04-121-3/+4
| | | | | | | | | The mangler doesn't like non-prototyped functions so only use a mangled name for prototyped functions. rdar://11079003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154570 91177308-0d34-0410-b5e6-96231b3b80d8
* The copy and destroy helper functions aren't prototyped, don't call themEric Christopher2012-04-121-2/+2
| | | | | | so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154569 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-111-2/+5
| | | | | | | | | | <stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154513 91177308-0d34-0410-b5e6-96231b3b80d8
* Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar ↵David Chisnall2012-04-111-4/+15
| | | | | | types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154507 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable debug info for objective c implementations that may not haveEric Christopher2012-04-113-1/+22
| | | | | | | | an explicit instance variable. rdar://10590352 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154481 91177308-0d34-0410-b5e6-96231b3b80d8
* For debug and coverage analysis if we're not optimizing go aheadEric Christopher2012-04-101-1/+1
| | | | | | | | | and emit a relatively empty block for a plain break statement. This enables us to track where we went through a switch. PR9796 & rdar://11215207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154420 91177308-0d34-0410-b5e6-96231b3b80d8
* Express the number of ULPs in fpaccuracy metadata as a real rather than a Duncan Sands2012-04-103-10/+6
| | | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154388 91177308-0d34-0410-b5e6-96231b3b80d8
* EmitStopPoint already checks if we have debug info.Eric Christopher2012-04-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154384 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy.Eric Christopher2012-04-101-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154383 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r154321, pending more discussion.David Chisnall2012-04-091-15/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154327 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-091-0/+15
| | | | | | | | for hooking in code flow visualisation applications. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154321 91177308-0d34-0410-b5e6-96231b3b80d8
* Wire up -fpie and -fPIE to LLVM's newly added TargetOptions. No testChandler Carruth2012-04-081-0/+1
| | | | | | | | | | | case as we don't currently have any way of dumping target options or otherwise observing this. Another small step toward fixing PR12380. With this we generate TLS accesses using the static model instead of the dynamic model, but we're still generating suboptimal code under the mistaken assumption that the TLS offset might be greater than 2^32, and therefor not viable as an immediate offset of a segment register. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154298 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154291 91177308-0d34-0410-b5e6-96231b3b80d8
* Use atexit when __cxa_atexit isn't available instead of adding aJohn McCall2012-04-061-26/+98
| | | | | | | | | global destructor entry. For some reason this isn't enabled for apple-kexts; it'd be good to have documentation for that. Based on a patch by Nakamura Takumi! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154191 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.John McCall2012-04-062-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154190 91177308-0d34-0410-b5e6-96231b3b80d8
* zext ivar offsets if required (GNU runtimes).David Chisnall2012-04-061-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154175 91177308-0d34-0410-b5e6-96231b3b80d8
* Only emit the getter and setter names if they're not the defaultEric Christopher2012-04-051-5/+13
| | | | | | | | synthesized ones. Reasonable debug info size reduction for objc. rdar://11179756 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154129 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the variant of __builtin_shufflevector that takes the shuffle indexes ↵Eli Friedman2012-04-051-3/+3
| | | | | | as a vector actually usable. Patch by David Neto. PR12465. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154128 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an oversight: don't run ARC optimization cleanup at -O0.Dan Gohman2012-04-041-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154052 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash (assert failure) when generating blocks for C++ types with a ↵David Chisnall2012-04-041-1/+2
| | | | | | | | | | non-const copy constructor. This was caused by the code deciding the number of fields in the byref structure using a different test to the part of the code creating the GEPs into said structure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154013 91177308-0d34-0410-b5e6-96231b3b80d8
* ErrorUnsupported on array cookies in the MS C++ ABI code;John McCall2012-04-041-0/+7
| | | | | | patch by Timur Iskhodzhanov. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153990 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence dead store warning, and fix indentation.Ted Kremenek2012-04-041-8/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153986 91177308-0d34-0410-b5e6-96231b3b80d8
* Change location information for synthesized properties to be at theEric Christopher2012-04-032-7/+8
| | | | | | | | | | | | | | | | | | property file/line rather than the @synthesize file/line. Avoids some nasty confusing-ness with conflating the file from the scope and the line from the original declaration. Use the current scope location as a separate parameter so that we can match it up better in the line table with the beginning of the scope. Update a couple of testcases accordingly since I had to change that we actually use the passed in location in EmitFunctionStart and for the new metadata parameter and add a new testcase to make sure we've got the right line numbers for synthesized properties. Part of rdar://11026482 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153917 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a pair of invalidation bugs when emitting protocol definitionsJohn McCall2012-03-301-2/+6
| | | | | | | in the fragile and non-fragile Mac ObjC runtimes. No useful test case. Fixes rdar://problem/11072576. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153778 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we unique static-local decls across multiple emissions ofJohn McCall2012-03-303-51/+76
| | | | | | | | the function body, but do so in a way that doesn't make any assumptions about the static local actually having a proper, unique mangling, since apparently we don't do that correctly at all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153776 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r153723, and its follow-ups r153728 and r153733.Chandler Carruth2012-03-308-175/+108
| | | | | | | | | | | | | | | | These patches cause us to miscompile and/or reject code with static function-local variables in an extern-C context. Previously, we were papering over this as long as the variables are within the same translation unit, and had not seen any failures in the wild. We still need a proper fix, which involves mangling static locals inside of an extern-C block (as GCC already does), but this patch causes pretty widespread regressions. Firefox, and many other applications no longer build. Lots of test cases have been posted to the list in response to this commit, so there should be no problem reproducing the issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153768 91177308-0d34-0410-b5e6-96231b3b80d8
* Do the static-locals thing properly in the face of unions andJohn McCall2012-03-308-88/+119
| | | | | | other things which might mess with the variable's type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153733 91177308-0d34-0410-b5e6-96231b3b80d8
* ItaniumCXXABI.cpp: Don't use nullptr. Clang source tree should be ↵NAKAMURA Takumi2012-03-301-1/+1
| | | | | | pre-c++11-compatible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153728 91177308-0d34-0410-b5e6-96231b3b80d8