summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo.Eric Christopher2012-04-161-1/+1
| | | | llvm-svn: 154880
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-4/+0
| | | | llvm-svn: 154851
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-1/+6
| | | | | | up to this yet. llvm-svn: 154835
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-161-155/+749
| | | | llvm-svn: 154828
* Adjust for LLVM name tweaks requested by Chandler.Duncan Sands2012-04-162-9/+9
| | | | llvm-svn: 154824
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-167-79/+93
| | | | llvm-svn: 154789
* Use MDBuilder to help with metadata creation.Duncan Sands2012-04-153-43/+14
| | | | llvm-svn: 154767
* 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). llvm-svn: 154756
* 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. llvm-svn: 154745
* 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! llvm-svn: 154723
* 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. llvm-svn: 154684
* Avoid string thrashing when we can concatenate them in the final buffer.Benjamin Kramer2012-04-131-8/+8
| | | | llvm-svn: 154678
* Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov2012-04-134-43/+119
| | | | | | | - Handle unions - Handle C++ classes llvm-svn: 154664
* Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith2012-04-131-1/+11
| | | | | | GNU __atomic builtins. llvm-svn: 154659
* Fix a trivial oversight with apple-kext static local destructorsJohn McCall2012-04-131-0/+1
| | | | | | and add a test case. llvm-svn: 154653
* 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. llvm-svn: 154640
* 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. llvm-svn: 154612
* 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++. llvm-svn: 154579
* These functions too have no prototypes. Audited the rest of Sema forEric Christopher2012-04-122-4/+4
| | | | | | | | FunctionDecl::Create calls as well. rdar://11079003 llvm-svn: 154578
* 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 llvm-svn: 154570
* The copy and destroy helper functions aren't prototyped, don't call themEric Christopher2012-04-121-2/+2
| | | | | | so. llvm-svn: 154569
* 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. llvm-svn: 154513
* Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar ↵David Chisnall2012-04-111-4/+15
| | | | | | types. llvm-svn: 154507
* Enable debug info for objective c implementations that may not haveEric Christopher2012-04-113-1/+22
| | | | | | | | an explicit instance variable. rdar://10590352 llvm-svn: 154481
* 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 llvm-svn: 154420
* 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. llvm-svn: 154388
* EmitStopPoint already checks if we have debug info.Eric Christopher2012-04-101-1/+1
| | | | llvm-svn: 154384
* Tidy.Eric Christopher2012-04-101-2/+2
| | | | llvm-svn: 154383
* Revert r154321, pending more discussion.David Chisnall2012-04-091-15/+0
| | | | llvm-svn: 154327
* 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. llvm-svn: 154321
* 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. llvm-svn: 154298
* 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. llvm-svn: 154291
* 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! llvm-svn: 154191
* Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.John McCall2012-04-062-6/+6
| | | | llvm-svn: 154190
* zext ivar offsets if required (GNU runtimes).David Chisnall2012-04-061-1/+4
| | | | llvm-svn: 154175
* 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 llvm-svn: 154129
* 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. llvm-svn: 154128
* Fix an oversight: don't run ARC optimization cleanup at -O0.Dan Gohman2012-04-041-1/+2
| | | | llvm-svn: 154052
* 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. llvm-svn: 154013
* ErrorUnsupported on array cookies in the MS C++ ABI code;John McCall2012-04-041-0/+7
| | | | | | patch by Timur Iskhodzhanov. llvm-svn: 153990
* Silence dead store warning, and fix indentation.Ted Kremenek2012-04-041-8/+9
| | | | llvm-svn: 153986
* 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 llvm-svn: 153917
* 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. llvm-svn: 153778
* 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. llvm-svn: 153776
* 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. llvm-svn: 153768
* 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. llvm-svn: 153733
* ItaniumCXXABI.cpp: Don't use nullptr. Clang source tree should be ↵NAKAMURA Takumi2012-03-301-1/+1
| | | | | | pre-c++11-compatible. llvm-svn: 153728
* Revert previous commit changing location information to see if thisEric Christopher2012-03-302-6/+7
| | | | | | is causing the gdb test failures on the bots. llvm-svn: 153727
* When emitting a static local variable in C++, handleJohn McCall2012-03-302-31/+67
| | | | | | | | | | | | | | | the case that the variable already exists. Partly this is just protection against people making crazy declarations with custom asm labels or extern "C" names that intentionally collide with the manglings of such variables, but the main reason is that we can actually emit a static local variable twice with the requirement that it match up. There may be other cases with (e.g.) the various nested functions, but the main exemplar is with constructor variants, where we can be forced into double-emitting the function body under certain circumstances like (currently) the presence of virtual bases. llvm-svn: 153723
* Add a note about a missing optimization in the case of virtualJohn McCall2012-03-301-0/+3
| | | | | | inheritance. llvm-svn: 153722
OpenPOWER on IntegriCloud