summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Make a few related changes:Chris Lattner2008-06-304-88/+101
| | | | | | | | | | | | | | 1) add a new ASTContext::getFloatTypeSemantics method. 2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places. 3) Change the TargetInfo.h get*Format methods to return their fltSemantics byref instead of by pointer. 4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which sometimes expand specially and othertimes fall back to libm. 5) Add support for __builtin_nan("") to codegen, cases that don't pass in an empty string are currently lowered to libm calls. 6) Fix codegen of __builtin_infl. llvm-svn: 52914
* Add missing include file (due to a file splitting in llvm).Cedric Venet2008-06-271-0/+1
| | | | | | | Add new file to Sema Project for VS. this unbreak the build for VS2005 (with the associated patch on llvm). llvm-svn: 52830
* refactor more objc codegen interfaces to pass around selectors soChris Lattner2008-06-263-52/+40
| | | | | | we don't push strings into LLVM IR and then have to read them back out. llvm-svn: 52765
* indenting and other minor things.Chris Lattner2008-06-262-6/+6
| | | | llvm-svn: 52764
* refactor interface to GenerateClassStructure to avoid converting a Chris Lattner2008-06-261-7/+6
| | | | | | string to LLVM IR and then regenerating the string from IR. llvm-svn: 52762
* remove the old getSelector implementation, which removes someChris Lattner2008-06-262-64/+2
| | | | | | calls to getStringValue llvm-svn: 52761
* avoid a lot of unneeded selector processing work by passing aroundChris Lattner2008-06-264-20/+10
| | | | | | selectors instead of Value*'s. llvm-svn: 52760
* use cheaper/simpler getselector call for @selector exprs.Chris Lattner2008-06-263-5/+5
| | | | llvm-svn: 52759
* start avoid doing lots of unneeded work handling selectorsChris Lattner2008-06-263-25/+43
| | | | llvm-svn: 52758
* improve indentation, avoid thrashing on maps and recalculating strings as much.Chris Lattner2008-06-262-33/+24
| | | | llvm-svn: 52757
* give CreateObjCRuntime a full CGM so it can get whatever state it needs, Chris Lattner2008-06-264-30/+16
| | | | | | | instead of passing in just a couple random things it currently happens to use. llvm-svn: 52756
* Fix 80 col violations, assert on assumptions.Chris Lattner2008-06-262-22/+23
| | | | llvm-svn: 52755
* a temporary minimal hack to get clang building after the getStringValue ↵Chris Lattner2008-06-261-7/+17
| | | | | | changes in llvm mainline. llvm-svn: 52753
* Updated atomic intrinsic name from llvm r52706. Fixed dropped bit in shufps.Mon P Wang2008-06-251-4/+4
| | | | llvm-svn: 52707
* "Support for Objective-C message sends which return structures. Also ↵Chris Lattner2008-06-244-4/+102
| | | | | | | | includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)." Patch by David Chisnall! llvm-svn: 52681
* "This is a small fix for a bug where static object instances were being ↵Chris Lattner2008-06-241-4/+6
| | | | | | | | incorrectly generated. The bug was caused by my inability to read the GNU libobjc source and is only apparent when JITing code (static compilation does not expose the bug due to the data layout of other globals)." Patch by David Chisnall! llvm-svn: 52680
* "this patch adds code generation hooks for Objective-C constant strings. It ↵Chris Lattner2008-06-212-1/+6
| | | | | | | | also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet." Patch by David Chisnall! llvm-svn: 52599
* Don't add isa with @defs only to work around it in the code generator, patchChris Lattner2008-06-211-4/+0
| | | | | | by David Chisnall. llvm-svn: 52597
* Remove tabs.Mike Stump2008-06-191-2/+2
| | | | llvm-svn: 52507
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-176-136/+136
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-176-63/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* force size of alloca to i32, which is currently required by LLVM IR.Chris Lattner2008-06-161-3/+6
| | | | | | This fixes use of alloca on 64-bit systems. llvm-svn: 52334
* Basic support for volatile loads and stores. Stores the volatile Eli Friedman2008-06-138-51/+112
| | | | | | | | | | qualifier in the lvalue, and changes lvalue loads/stores to honor the volatile flag. Places which need some further attention are marked with FIXMEs. Patch by Cédric Venet. llvm-svn: 52264
* Make CodeGenFunction::EmitDecl() recognise CXXClass/CXXStruct/CXXUnion.Argyrios Kyrtzidis2008-06-091-0/+3
| | | | llvm-svn: 52162
* -Changes to TagDecl:Argyrios Kyrtzidis2008-06-091-3/+3
| | | | | | | | | Added TagKind enum. Added getTagKind() method. Added convenience methods: isEnum(), isStruct(), isUnion(), isClass(). -RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one. llvm-svn: 52160
* Generate debug descriptors for array types while generating the debug info.Sanjiv Gupta2008-06-092-3/+63
| | | | llvm-svn: 52140
* implement the alias attirbute (in both Sema and Codegen)Nuno Lopes2008-06-082-17/+42
| | | | llvm-svn: 52092
* fix compiler warningsNuno Lopes2008-06-081-2/+2
| | | | llvm-svn: 52089
* Don't crash emitting an initializer for a static local with union type. Eli Friedman2008-06-081-3/+7
| | | | | | | This fix just makes sure to construct the global with the appropriate type, and fixes up the one user this affects to compensate. llvm-svn: 52084
* Fix crash with conversion to an address-space-qualified pointer. Bug Eli Friedman2008-06-071-2/+2
| | | | | | | | | | reported on cfe-dev by Cédric Venet. Note that I seriously doubt that this perticular construct is useful, though: it's a pointer in an alternate address space pointing into unqualified address space. llvm-svn: 52076
* Create debug type descriptors for aggregate/enum types.Sanjiv Gupta2008-06-072-5/+130
| | | | llvm-svn: 52070
* Reorganize this loop a bit so it doesn't crash for empty unions. Fixes Eli Friedman2008-06-061-4/+6
| | | | | | PR2419. llvm-svn: 52060
* implement constant expr. sub ptr ptrNuno Lopes2008-06-061-3/+13
| | | | llvm-svn: 52049
* Emit debug information for global and static variables when -g is specified.Sanjiv Gupta2008-06-054-0/+70
| | | | llvm-svn: 51993
* For setting attributes, don't assume there are ParamVarDecls available, Eli Friedman2008-06-041-12/+16
| | | | | | | because trying to access non-existent ParamVarDecls can crash. Testcase from the original source for PR2414. llvm-svn: 51960
* fix crash when codegening 'cond ? lhs : call-to-void-func()'Nuno Lopes2008-06-041-1/+1
| | | | llvm-svn: 51958
* clang fix to parallel LLVM r51928 Eli Friedman2008-06-041-1/+1
| | | | | | (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080602/063306.html). llvm-svn: 51944
* Include <string> header to allow compiling for MSVC.Argyrios Kyrtzidis2008-06-011-0/+1
| | | | llvm-svn: 51847
* Don't name the ObjC types if there aren't any ObjC objects in the file. Eli Friedman2008-06-011-4/+6
| | | | | | Patch by David Chisnall. llvm-svn: 51840
* First cut at setting attributes for functions and calls; this puts us Eli Friedman2008-06-014-34/+90
| | | | | | | | | | | | | | | much closer to passing the gcc struct layout tests. It might be possible to refactor this a bit, but I'm not sure there's actually enough common code for that to be useful. To get the calling convention completely correct, a bit of platform-specific code is necessary even for x86-Linux. On x86-Linux, the alignment of function parameters is extremely strange; as far as I can tell, it's always 4 except for SSE vectors or structs containing SSE vectors. I'm continuing to investigate this. llvm-svn: 51839
* Make sure _Bool globals have the correct type.Eli Friedman2008-06-011-3/+8
| | | | llvm-svn: 51838
* Minor cleanup to use the ConvertTypeForMem helper.Eli Friedman2008-06-011-5/+3
| | | | llvm-svn: 51837
* Remove spurious == 0Anton Korobeynikov2008-06-011-1/+1
| | | | llvm-svn: 51836
* Support for code generation of Objective-C top-level language constructs.Anton Korobeynikov2008-06-018-44/+1027
| | | | | | Implemented by David Chisnall! llvm-svn: 51835
* Calculate alignment for local variables.Eli Friedman2008-05-311-2/+6
| | | | llvm-svn: 51826
* PR1893: Fix up the type of tentative definitions of incomplete array Eli Friedman2008-05-301-2/+22
| | | | | | types so that they end up the correct size. llvm-svn: 51787
* Fix and enable generating general union initializers. Essentially, what Eli Friedman2008-05-301-9/+26
| | | | | | | | | | | | this does is reconstruct the type for structs and arrays if the type wouldn't be compatible otherwise. The assertion about packing in the struct type reconstruction code sucks, but I don't see any obvious way to fix it. Maybe we need a general utility method to take a list of types and alignments and try to construct an unpacked type if possible? llvm-svn: 51785
* Allow the type of a global to be different from the type of its Eli Friedman2008-05-301-69/+62
| | | | | | | | | | | | | | | | | associated declaration. This is a prerequisite to handling general union initializations; for example, an array of unions involving pointers has to be turned into a struct because the elements can have incompatible types. I refactored the code a bit to make it more readable; now, the logic for definitions is all in EmitGlobalVarInit. The second parameter for GetAddrOfGlobalVar is now dead; I'll remove it separately. By itself, this patch should not cause any visible changes. llvm-svn: 51783
* Fix constant vector init for initializer lists with an incomplete list Eli Friedman2008-05-301-6/+9
| | | | | | of elements. llvm-svn: 51769
* Always check that the definition of a function has the correct type. Eli Friedman2008-05-301-1/+1
| | | | | | This fixes a crash on the included testcase (found in NetHack). llvm-svn: 51767
OpenPOWER on IntegriCloud