summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Missing piece of r153720: make sure the vtable pointer is handled correctly.Eli Friedman2012-03-301-1/+1
| | | | llvm-svn: 153721
* ConstStructBuilder: fix offset math for base classes so it works correctly ↵Eli Friedman2012-03-301-7/+3
| | | | | | in general. Found by inspection. llvm-svn: 153720
* Change location information for synthesized properties to be at theEric Christopher2012-03-302-7/+6
| | | | | | | | | | | | | 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. Update a couple of testcases accordingly since I had to change that we actually use the passed in location in EmitFunctionStart. Fixes rdar://11026482 llvm-svn: 153714
* The UTF16 string referenced by a CFString should go into the __TEXT,__ustringBill Wendling2012-03-301-26/+24
| | | | | | | | | | | | | section. A 'normal' string will go into the __TEXT,__const section, but this isn't good for UTF16 strings. The __ustring section allows for coalescing, among other niceties (such as allowing the linker to easily split up strings). Instead of outputting the UTF16 string as a series of bytes, output it as a series of shorts. The back-end will then nicely place the UTF16 string into the correct section, because it's a mensch. <rdar://problem/10655949> llvm-svn: 153710
* Fix whitespace.Bill Wendling2012-03-291-6/+5
| | | | llvm-svn: 153698
* Call out to GCC-compatible runtime functions for atomic ops that we can't useDavid Chisnall2012-03-291-34/+61
| | | | | | | | | | | | | | LLVM intrinsics for. I have an implementation of these functions, which wants to go in a libgcc_s equivalent in compiler-rt. It's currently here: http://people.freebsd.org/~theraven/atomic.c It will be committed to compiler-rt as soon as I work out where would be a sensible place to put it... llvm-svn: 153666
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-2913-205/+126
| | | | | | testers. llvm-svn: 153660
* Go back to using just the selector name for the getter and setterEric Christopher2012-03-291-8/+13
| | | | | | | | in the property debug info. Any more isn't necessary after all. rdar://11144023 llvm-svn: 153659
* Tidy.Eric Christopher2012-03-291-13/+19
| | | | llvm-svn: 153658
* Add support for objc property decls according to the page at:Eric Christopher2012-03-291-17/+22
| | | | | | | | | | | http://llvm.org/docs/SourceLevelDebugging.html#objcproperty including type and DECL. Expand the getter and setter names into the fully qualified names. rdar://11144023 llvm-svn: 153640
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-2813-126/+205
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* CodeGen/CGDeclCXX.cpp: Twine-ize CreateGlobalInitOrDestructFunction().NAKAMURA Takumi2012-03-281-1/+1
| | | | llvm-svn: 153578
* Move the emission of strict enum range metadata behind a flag (the sameChandler Carruth2012-03-271-2/+3
| | | | | | | | | | | | | | | | | | | | | flag as GCC uses: -fstrict-enums). There is a *lot* of code making unwarranted assumptions about the underlying type of enums, and it doesn't seem entirely reasonable to eagerly break all of it. Much more importantly, the current state of affairs is *very* good at optimizing based upon this information, which causes failures that are very distant from the actual enum. Before we push for enabling this by default, I think we need to implement -fcatch-undefined-behavior support for instrumenting and trapping whenever we store or load a value outside of the range. That way we can track down the misbehaving code very quickly. I discussed this with Rafael, and currently the only important cases he is aware of are the bool range-based optimizations which are staying hard enabled. We've not seen any issue with those either, and they are much more important for performance. llvm-svn: 153550
* add tbaa metadata to vtable pointer loads/storesKostya Serebryany2012-03-265-2/+20
| | | | llvm-svn: 153447
* Simplify some users of DenseMap::erase.Benjamin Kramer2012-03-242-8/+2
| | | | llvm-svn: 153389
* Add back r153360 with a fix for enums that cover all the 32 bit values.Rafael Espindola2012-03-242-8/+63
| | | | | | Thanks to NAKAMURA Takumi for finding it! llvm-svn: 153383
* Revert r153360 (and r153380), "Second part of PR12251. Produce the range ↵NAKAMURA Takumi2012-03-242-62/+8
| | | | | | | | | | metadata in clang for booleans and". For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier. It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range. llvm-svn: 153382
* Second part of PR12251. Produce the range metadata in clang for booleans andRafael Espindola2012-03-242-8/+62
| | | | | | c++ enums. llvm-svn: 153360
* use EP_OptimizerLast instead of EP_ScalarOptimizerLate for ThreadSanitizerKostya Serebryany2012-03-231-1/+1
| | | | llvm-svn: 153356
* When an MMX output variable is tied to the input variable, we have to implicitlyBill Wendling2012-03-221-1/+6
| | | | | | | cast the value to x86_mmx. This gives the ASM string the correct call signature. <rdar://problem/10919182> llvm-svn: 153290
* Make sure we correctly set the alignment for vector loads and stores ↵Eli Friedman2012-03-222-19/+33
| | | | | | associated with vector element lvalues. Patch by Kevin Schoedel (with some minor modifications by me). llvm-svn: 153285
OpenPOWER on IntegriCloud