summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Convert the return value ofKen Dyck2011-03-311-11/+11
| | | | | | | VCallAndVBaseOffsetBuilder::getCurrentOffsetOffset() to CharUnits. No change in functionality intended. llvm-svn: 128603
* Convert the OffsetInLayoutClass parameter ofKen Dyck2011-03-311-9/+10
| | | | | | | VCallAndVBaseOffsetBuilder::AddVBaseOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128600
* Convert the OffsetInLayoutClass of the VCallAndVBaseOffsetBuilderKen Dyck2011-03-311-6/+6
| | | | | | constructor to CharUnits. No change in functionality intended. llvm-svn: 128598
* Convert the RealBaseOffset parameter ofKen Dyck2011-03-311-5/+6
| | | | | | | VCallAndVBaseOffsetBuilder::AddVCallAndVBaseOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128596
* Use intrinsics for Neon vmull operations. Radar 9208957.Bob Wilson2011-03-311-3/+3
| | | | llvm-svn: 128590
* Fix IRGen issues related to using property-dot syntaxFariborz Jahanian2011-03-303-14/+23
| | | | | | for prperty reference types. // rdar://9208606. llvm-svn: 128551
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-3012-45/+24
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-303-0/+7
| | | | llvm-svn: 128534
* Convert the offset parameter ofKen Dyck2011-03-301-4/+4
| | | | | | | VCallAndVBaseOffsetBuilder::AddVCallOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128531
* Convert local offset variable to CharUnits in AddVCallOffsets. No change inKen Dyck2011-03-301-4/+4
| | | | | | functionality intended. llvm-svn: 128522
* Convert a local offset variable to CharUnits. No change in functionalityKen Dyck2011-03-301-3/+3
| | | | | | intended. llvm-svn: 128521
* Convert the OffsetInLayoutClass parameter of DeterminePrimaryVirtualBases()Ken Dyck2011-03-301-9/+9
| | | | | | to CharUnits. No change in functionality intended. llvm-svn: 128520
* Convert the OffsetInLayoutClass parameter of LayoutSecondaryVTables toKen Dyck2011-03-301-8/+6
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128516
* Fix in r128471 is very broad. Some of the unconditional branches need line ↵Devang Patel2011-03-302-3/+9
| | | | | | | | number information for better user experience. Restrict the fix. This fixes break.exp failures from gdb testsuite. llvm-svn: 128513
* Do not line number entry for unconditional branches. Usually, users do not ↵Devang Patel2011-03-291-0/+3
| | | | | | want to stop at closing '}'. llvm-svn: 128471
* Implements property of reference types. AddingFariborz Jahanian2011-03-281-5/+14
| | | | | | | an executable test to llvm test suite. // rdar://9070460. llvm-svn: 128435
* Integrated-As: Support -Wa,-L when using the integrated assembler.Daniel Dunbar2011-03-281-0/+2
| | | | llvm-svn: 128433
* refactoringAnton Yartsev2011-03-281-3/+1
| | | | llvm-svn: 128427
* Convert offset parameter in LayoutPrimaryAndSecondaryVTables() to CharUnits.Ken Dyck2011-03-271-16/+16
| | | | | | No change in functionality intended. llvm-svn: 128393
* Convert VTableBuilder::MostDerivedClassOffset to CharUnits. No change inKen Dyck2011-03-271-16/+15
| | | | | | functionality intended. llvm-svn: 128392
* Convert FinalOverriders::MostDerivedClassOffset to CharUnits. No change inKen Dyck2011-03-271-5/+8
| | | | | | functionality intended. llvm-svn: 128391
* Remove a fixed FIXME comment (the base offset has already been converted toKen Dyck2011-03-271-1/+0
| | | | | | CharUnits). llvm-svn: 128386
* Convert the offset parameters of AddMethods() to CharUnits. No change inKen Dyck2011-03-271-17/+15
| | | | | | functionality intended. llvm-svn: 128385
* Convert the BaseOffsetInLayoutClass parameter of ComputeThisAdjustment() toKen Dyck2011-03-271-9/+8
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128384
* Convert offset members in MethodInfo to CharUnits. No change inKen Dyck2011-03-271-14/+17
| | | | | | functionality intended. llvm-svn: 128383
* AltiVec vector comparison logic now affect only vectors of fundamental ↵Anton Yartsev2011-03-271-1/+3
| | | | | | AltiVec vector types. It fixes bug 9347. llvm-svn: 128381
* supported: AltiVec vector initialization with a single literal according to ↵Anton Yartsev2011-03-271-6/+23
| | | | | | PIM section 2.5.1 - after initialization all elements have the value specified by the literal llvm-svn: 128375
* We were emitting construction v-tables with internal linkage all the time.John McCall2011-03-274-7/+25
| | | | | | | | | | | | | | | Emit them instead with the linkage of the VTT. I'm actually really ambivalent about this; it's what GCC does, but outside of improving code size (if the linkage is coalescing), I'm not sure it's at all relevant. Construction vtables are naturally referenced only by the VTT, which is itself only referenced by complete-object constructors and destructors; giving the construction vtables possibly-external linkage is important if you have an optimization that drills through the VTT to a reference to a particular construction vtable which it cannot just emit itself. llvm-svn: 128374
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-262-2/+2
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Reformatted doc comments so that they are now difficult to edit in any ↵David Chisnall2011-03-261-339/+186
| | | | | | editor that doesn't have explicit doxygen support, as per LLVM style guidelines. llvm-svn: 128335
* Convert the OffsetInLayoutClass parameter ofKen Dyck2011-03-261-8/+8
| | | | | | | FinalOverriders::ComputeBaseOffsets() to CharUnits. No change in functionality intended. llvm-svn: 128323
* Convert FinalOverriders::Offset to CharUnits. No change in functionalityKen Dyck2011-03-261-8/+8
| | | | | | intended. llvm-svn: 128321
* Convert offset in MethodBaseOffsetPairTy to CharUnits. No change inKen Dyck2011-03-261-9/+8
| | | | | | functionality intended. llvm-svn: 128318
* Convert the offsets in SubobjectOffsetMapTy to CharUnits. No change inKen Dyck2011-03-261-8/+8
| | | | | | functionality intended. llvm-svn: 128317
* Convert several local variables to CharUnits. No change in functionalityKen Dyck2011-03-261-45/+39
| | | | | | intended. llvm-svn: 128315
* Provide blockDecl's startLoc to startFunction. This fixes hidden bug exposed ↵Devang Patel2011-03-251-1/+1
| | | | | | by recent code gen changes. This is tested by global-blocks-lines.exp in gdb testsuite. llvm-svn: 128303
* Obj-C/NeXT: Update and reapply 108847, now that changes are more baked.Daniel Dunbar2011-03-251-5/+15
| | | | llvm-svn: 128300
* Refactor CGObjCMac to use the shared code for EH stuff.David Chisnall2011-03-251-154/+7
| | | | | | Sanity checked by John McCall. llvm-svn: 128287
* Unbreak CMake build.Anders Carlsson2011-03-251-0/+1
| | | | llvm-svn: 128276
* Added some doc comments.David Chisnall2011-03-251-14/+263
| | | | llvm-svn: 128275
* Continuing work on ObjC tidyup:David Chisnall2011-03-254-449/+427
| | | | | | | | | | | | | | | | - Moved the CGObjCRuntime functions out of CGObjCMac.cpp into CGObjCRuntime.cpp - Added generic functions in CGObjCRuntime for emitting @try and @synchronize blocks, usable by any runtime that uses DWARF exceptions. - Made the GNU runtimes use these functions. It should now be possible to replace the equivalent functions in CGObjCNonFragileABIMac with simple calls to these two functions, providing the runtime functions as arguments. I'll post a diff to the list for review before making any changes to the Mac runtime stuff. llvm-svn: 128274
* Make sure we aggressively attach nounwind (etc.) to calls to libraryEli Friedman2011-03-241-2/+1
| | | | | | functions of the form __builtin_XXX. llvm-svn: 128198
* Convert the BaseOffset member of BaseSubobject to CharUnits from bits. NoKen Dyck2011-03-245-82/+104
| | | | | | change in functionality intended. llvm-svn: 128190
* Fixed type error in last commit (forgot that now that selectors are notDavid Chisnall2011-03-231-147/+199
| | | | | | | | | | | | | accessed via the indirect pointer, they don't need to be pointers to pointers). Finished moving the message lookup code into separate subclasses for each runtime. Also performed a few smallish related tidies. We're now bitcasting the result of the message lookup functions, rather than casting the lookup functions themselves, so the messages.m test needed updating to reflect this. llvm-svn: 128180
* Revert r128156 because of CodeGenObjC/messages.m and Coverage/codegen-gnu.m.Andrew Trick2011-03-231-9/+10
| | | | llvm-svn: 128157
* Remove the redundant loads / stores to globals that we were generating for ↵David Chisnall2011-03-231-10/+9
| | | | | | selectors (GNU runtimes). llvm-svn: 128156
* Initial work on refactoring GNU runtime code (long overdue - it's quite obviousDavid Chisnall2011-03-231-298/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that I hadn't used C++ for several years before writing most of this code). Still lots more to do. This set of changes includes: - Remove the distinction between typed and untyped selectors. More accurately reflect what the runtime does, by using typed selectors everywhere, with an empty type field if the types are unknown. Now we just store a small list of types for each selector (in theory, this should always be exactly one, but this constraint was not enforced back in 1986 when it should have been). - Add some consistency to how runtime functions are created. These are all generated via the LazyRuntimeFunction class (which might be useful outside CGObjCGNU - feel free to move it into a header if it is). This function stores the types of a function, looks it up the first time it's used, and caches the result. This means that we're now not wasting time constructing the llvm::FunctionType every time some of the functions are looked up, but also not inserting references to runtime functions into the module if they're not actually used. - Started separating out the fragile and non-fragile ABI behaviours into two subclasses of CGObjCGNU: CGObjCGCC for the legacy GCC runtime ABI and CGObjCGNUstep for the new GNUstep ABI. Not all of the differences in behaviour are factored out yet, but they will be in future commits. - Removed all of the CodeGen:: things: we've been using namespace CodeGen in this file for ages, so having explicit namespace specifiers is just a bit confusing. - Added a few more comments. - Used llvm::StringRef instead of std::string in a few places. - Finally got around to storing the module path in the module structure. The ABI says that the compiler should do this, although it's not used in the runtime or exposed outside the runtime, so it's pretty useless. Still to do: - We currently have two code paths for generating try blocks, one for ObjC and one for ObjC++. Not only are these substantially similar, they are also very similar to the CGObjCMac version. These need factoring out into a single parameterised implementation, either in CGObjCRuntime or CodeGenFunction. The EmitObjCXXTryStmt() function was added so that the changes to fix a bug in time for the 2.9 release would be self-contained and reduce the chances of breaking anything else, but these should be done properly as soon as possible. - Split up some large functions (e.g. GenerateClass()) into smaller functions for generating the various data structures. - The method lookup code into the two subclasses, removing the conditionals in the message send functions. - Add doxygen comments on the remaining undocumented functions. - We seem to be generating global pointer variables for selectors, then storing a pointer to the selector, then generating a load of this pointer (and then a load of the real selector later) every time a static selector is used. I can only assume I was asleep or drunk when I did this - we should just be referencing the selectors directly in the selector array. llvm-svn: 128152
* Update type cache when a type is completed.Devang Patel2011-03-234-5/+28
| | | | | | Radar 9168773 llvm-svn: 128150
* Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) toKen Dyck2011-03-232-14/+15
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128129
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-232-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
OpenPOWER on IntegriCloud