summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix handling of C99 "extern inline" semantics when dealing withDouglas Gregor2009-04-231-6/+5
| | | | | | | multiple declarations of the function. Should fix PR3989 and <rdar://problem/6818429>. llvm-svn: 69905
* Handle corner case where clang-cc is invoked directly to compile ↵Devang Patel2009-04-232-8/+15
| | | | | | | | preprocessed source file without -main-file-name. In this case, CDDebugInfo is not able identify correct main source file becase SM.isFromMainFile() returns true for locations from header files as well as locations from main source file. This patch takes conservative approach by not emitting more then one compile unit with isMain bit set. llvm-svn: 69902
* Removed bunch of FIXMEs no longer needed.Fariborz Jahanian2009-04-231-8/+0
| | | | llvm-svn: 69896
* Mark IMAGE_INFO as constant on x86_64-darwin.Daniel Dunbar2009-04-231-0/+1
| | | | | | | - This shouldn't change anything, we never actually access it, but this is consistent with llvm-gcc (and 32-bit) llvm-svn: 69880
* fix a problem producing debug info with global blocks.Chris Lattner2009-04-231-1/+2
| | | | llvm-svn: 69875
* implement debug info for _Complex.Chris Lattner2009-04-232-1/+18
| | | | llvm-svn: 69873
* the logic for computing __func__ and friends is really broken:Chris Lattner2009-04-234-6/+11
| | | | | | | | | the type assigned by sema (and is visible with sizeof(__func__) for example) has nothing to do with what codegen ends up producing. We should eventually add a method on PredefinedExpr to handle this. In the meantime, just set up some framework and add some fixme's. llvm-svn: 69872
* Use std::sort instead of qsort.Daniel Dunbar2009-04-231-15/+7
| | | | | | | | | - Notably, there was a memory error here, SkipIvars does not have to be the same size as IvarsInfo. - Fariborz, please check. llvm-svn: 69850
* Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor2009-04-233-32/+51
| | | | | | | | | | | methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). llvm-svn: 69849
* ivar layout bitmap is alive!Fariborz Jahanian2009-04-221-10/+20
| | | | llvm-svn: 69838
* Reapply r69771, with updates & fixes:Daniel Dunbar2009-04-221-8/+21
| | | | | | | | | | | | | | | | | | | | | | Rework the shadow struct that is layed out for Objective-C classes. - Superclasses are now always laid out in their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields were incorrect (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal (for example, ivar are looked up recursively, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69811
* Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.Daniel Dunbar2009-04-221-2/+18
| | | | | | - This is only used by CGObjCRuntime now. llvm-svn: 69800
* Don't convert interface types (to structs) as part of CodeGenTypes.Daniel Dunbar2009-04-224-43/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - This has pros and cons, but for now the pros seem to significantly outway the con. The con is that we will always need to cast in the runtime implementation to a struct type, if we wish to access an interface directly. The pros are: - Avoid the cost of generating types which are used. Most manipulation of Objective-C objects is done through messages, and only the implementation of a class will directly access memory. Previously, we would convert the type even if it only appear as a function parameter, for example. - We don't need to worry about incomplete types, and UpdateCompletedType for interfaces is gone. - It becomes easier to narrow the interface to the shadow struct for Objective-C interfaces (so it can be eliminated). Currently the runtimes still use the CodeGenTypes machinery to generate the LLVM structure they need via ConvertTagDecl, but this can eventually be replaced. llvm-svn: 69797
* Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to theDaniel Dunbar2009-04-223-38/+24
| | | | | | underlying llvm::StructType for an interface. llvm-svn: 69796
* Simplify.Daniel Dunbar2009-04-221-23/+11
| | | | llvm-svn: 69793
* Emit meta data using the Ivar, not a looked up FieldDecl.Daniel Dunbar2009-04-221-8/+6
| | | | llvm-svn: 69790
* Use ComputeIvarBaseOffset instead of looking up by hand.Daniel Dunbar2009-04-221-7/+2
| | | | llvm-svn: 69789
* Merge ivar access amongst the three runtimes.Daniel Dunbar2009-04-223-147/+124
| | | | | | | | | - For now, this means we are always doing the address computations by hand instead of constructing a proper GEP. Right now, however, this is less important than having fewer entry points to dealing with Objective-C interface layout. llvm-svn: 69787
* implement debug info support for id<proto> and interface<proto>Chris Lattner2009-04-221-9/+9
| | | | llvm-svn: 69784
* ObjCQualifiedClass is dead, remove it.Chris Lattner2009-04-222-2/+0
| | | | llvm-svn: 69783
* Make ObjCInterfaceDecl's const in some more places.Daniel Dunbar2009-04-225-11/+10
| | | | llvm-svn: 69775
* Revert r69771, I missed some (obvious) details. :/Daniel Dunbar2009-04-221-16/+49
| | | | llvm-svn: 69773
* Mark another TypeForDecl const and make getObjCInterfaceType's argument const.Daniel Dunbar2009-04-221-2/+1
| | | | llvm-svn: 69772
* Rework the shadow struct that is layed out for Objective-C classes.Daniel Dunbar2009-04-221-49/+16
| | | | | | | | | | | | | | | | | | | - Superclasses are now always laid out their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields weren't packed correctly (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69771
* move 64-bit abi functions to lazy model, everything is lazy now, yay.Chris Lattner2009-04-221-75/+81
| | | | llvm-svn: 69767
* remove the last of the non-lazy objc runtime functions for the 32-bit ABI,Chris Lattner2009-04-221-54/+56
| | | | | | 7 left for 64-bit ABI. llvm-svn: 69766
* number of non-lazy runtime functions from 9 -> 4.Chris Lattner2009-04-221-44/+47
| | | | llvm-svn: 69765
* make message send functions lazy, we're down from 14 non-lazy functions to 9.Chris Lattner2009-04-221-64/+65
| | | | llvm-svn: 69764
* move more EH stuff to being lazily created. An empty .m file now Chris Lattner2009-04-221-52/+54
| | | | | | produces just 14 dead "declares" in llvm ir instead of 19. llvm-svn: 69763
* make try/catch objc runtime functions be lazily generated.Chris Lattner2009-04-221-22/+26
| | | | | | rdar://6809612 llvm-svn: 69762
* Fix some mishandling of the attr(gnu_inline) mode when used withChris Lattner2009-04-221-16/+13
| | | | | | | | | | extern. Previously we would warn about it and ignore the attribute. This is incorrect, it should be handled as a c89 "extern inline" function. Many thanks to Matthieu Castet for pointing this out and beating me over the head until I got it. PR3988: extern inline function are not externally visible llvm-svn: 69756
* fix PR4026: Clang can't codegen __func__ without implicit castChris Lattner2009-04-211-6/+9
| | | | llvm-svn: 69747
* Make sure to mark the interface as completed when we see anDaniel Dunbar2009-04-211-5/+2
| | | | | | | | | @implementation that closes a @class delcaration. - I don't know how to make a test case for this, but this strengthens the invariants that hold internally. The functionality change here is the edit to SemaDeclObjC.cpp. llvm-svn: 69728
* Fix emission of static tentative definitions referenced from other static ↵Douglas Gregor2009-04-211-9/+11
| | | | | | functions llvm-svn: 69699
* More objc2's ivar layout bitmap. No change in functionality.Fariborz Jahanian2009-04-211-5/+26
| | | | llvm-svn: 69695
* don't bother emitting a zero byte memset at all. We used to get themChris Lattner2009-04-211-2/+5
| | | | | | | | | | | | | | | | | in cases like this: typedef struct { short instance; char name[0]; } ATTR_LIST_ENTRY2; void test() { ATTR_LIST_ENTRY2 X = (ATTR_LIST_ENTRY2) { .instance = 7, }; } While it is safe to emit them, it is pretty silly. llvm-svn: 69687
* Explictly track tentative definitions within Sema, then hand thoseDouglas Gregor2009-04-213-25/+20
| | | | | | | | | | | | | | | tentative definitions off to the ASTConsumer at the end of the translation unit. Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions. Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681
* Pass and return aggregate types directly to function calls.Sanjiv Gupta2009-04-211-0/+41
| | | | llvm-svn: 69668
* use of predefined identifiers like __func__ at global scope warn in sema,Chris Lattner2009-04-211-1/+1
| | | | | | | but crashed codegen. Fix this to report the name of the llvm function. This fixes rdar://6808051 llvm-svn: 69658
* Remove unnused variable.Daniel Dunbar2009-04-211-1/+0
| | | | llvm-svn: 69650
* Kill ASTContext::[gs]etFieldForDecl, instead we just lookup thingsDaniel Dunbar2009-04-216-23/+9
| | | | | | | | when we need them -- which is exactly what some code was already doing! - No intended functionality change. llvm-svn: 69648
* Remove LateBoundIVars() runtime interface, it is unused.Daniel Dunbar2009-04-213-24/+3
| | | | llvm-svn: 69641
* Assert on a few conditions that (I believe) should holdDaniel Dunbar2009-04-212-0/+3
| | | | | | | w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to EmitObjCValueForIvar). llvm-svn: 69639
* ObjC2's Ivar bitmap layout work. No change in functionality.Fariborz Jahanian2009-04-201-17/+29
| | | | llvm-svn: 69629
* Move countInheritedIvars to within striking distance ofDaniel Dunbar2009-04-201-39/+34
| | | | | | | | | | | | GetClassSizeInfo Reduce nesting in GetInterfaceDeclStructLayout. Tweak some comments. No functionality change. llvm-svn: 69621
* the __gnuc_inline__ attribute is actually named __gnu_inline__,Chris Lattner2009-04-201-1/+1
| | | | | | PR4023 llvm-svn: 69618
* Inline GetFirstIvarInRecord into sole caller.Daniel Dunbar2009-04-201-28/+9
| | | | | | - No functionality change. llvm-svn: 69582
* Set a bit in IMAGE_INFO to indicate that we don't contain anyDaniel Dunbar2009-04-201-3/+12
| | | | | | | | @synthesized ivars for superclasses. - <rdar://problem/6806371> [clang] Mark code without miscompiled @synthesized properties llvm-svn: 69581
* Lift out GetNamedIvarList.Daniel Dunbar2009-04-201-30/+40
| | | | | | | | | Drop uses of GetFirstInvarInRecord, instead we lookup the ivars we know are in the record. - This is somewhat less efficient, but I need to detangle this code first... llvm-svn: 69579
* Don't emit ivar offsets for unnamed bit fields.Daniel Dunbar2009-04-201-5/+8
| | | | | | Also, added assertion that the field matches what would be looked up. llvm-svn: 69572
OpenPOWER on IntegriCloud