summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle BuiltinType::WChar inside CodeGenTypes::ConvertNewType().Argyrios Kyrtzidis2008-08-091-0/+2
| | | | llvm-svn: 54593
* update to make IRBuilder API change.Chris Lattner2008-08-088-35/+37
| | | | llvm-svn: 54548
* ParseAST now conditionally deletes the passed ASTConsumer.Ted Kremenek2008-08-071-8/+11
| | | | | | | | | | ModuleBuilder now performs llvmgen in HandleTranslationUnit. This patch follows from the discussion on the following thread on cfe-commits: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080804/006849.html llvm-svn: 54486
* Fix EmitNullInitializationToLValue for bitfield lvalues. Daniel Dunbar2008-08-061-4/+2
| | | | | | - PR2643 llvm-svn: 54397
* Fix bitfield accesses which straddle the boundary of the underlyingDaniel Dunbar2008-08-061-46/+116
| | | | | | | | | | | | | | | | | | | | | type. - This generates somewhat less optimal code than before but this is not hard to rectify once stable (at the cost of slightly more complex code). - This currently always uses little-endian ordering of the bitfield. - This breaks the CodeGen/bitfield.c test because it was grepping for hard-coded assembly instructions. Will fix once a better test case is constructed (hard to do without execution). - This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c and Regression/C/PR1386.c from the test suite. - <rdar://problem/6085090>, <rdar://problem/6094169> llvm-svn: 54395
* Fix CodeGen of pointer arithmetic in compound assignment statements.Daniel Dunbar2008-08-061-76/+94
| | | | | | | | | | | | | | | | | | | - Changed EmitSub to work on all cases (arithmetic, ptr - int, ptr - ptr) so that implementation matches that of other operators. - Modify EmitCompoundAssign to compute and perform the appropriate casts of left, right, and result types for the assorted pointer arithmetic cases. - Fix EmitSub (ptr - int) case to negate the rhs *after* extension. This is critical when the rhs is unsigned (and needs extension). - This fixes cfrac. - <rdr://6115726> llvm-svn: 54392
* Implement GNU asm-label extension support in CodeGen. This fixesDaniel Dunbar2008-08-061-7/+14
| | | | | | | | | | | | | | scimark2 on Darwin. - Added Sema support for asm-label on variables, which I forgot before. - Update CodeGen to use GlobalDeclMap to determine if static Decls require emission (instead of LLVM module name lookup). Important since the Decl name and the LLVM module name can differ. - <rdar://problem/6116729> llvm-svn: 54388
* Change CodeGen of global decls to key off of the name (instead ofDaniel Dunbar2008-08-052-97/+45
| | | | | | | | | | | | | | | | | having multiple bindings from all the possible decls which conceptually map to the same global). - This eliminates CodeGen depending on the LLVM module for name lookup. - This also eliminates the need for ReplaceMapValuesWith (hurrah). - This handles lookups for FunctionDecls correctly in the presence of aliases, this was previously broken. - WIP: Can still clean up & unify variable and function emission. llvm-svn: 54382
* Remove excess #include.Ted Kremenek2008-08-051-1/+0
| | | | llvm-svn: 54366
* Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ↵Ted Kremenek2008-08-053-28/+42
| | | | | | ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files. llvm-svn: 54364
* Bug fix, CodeGen of (void*) - (void*) was broken.Daniel Dunbar2008-08-051-3/+12
| | | | | | - <rdar://problem/6122967> llvm-svn: 54338
* Avoid creating dummy block when no indirect gotos are present.Daniel Dunbar2008-08-041-0/+3
| | | | llvm-svn: 54322
* Add CodeGen support for indirect goto.Daniel Dunbar2008-08-044-2/+84
| | | | | | | | | | - Follows emission scheme used by llvm-gcc, i.e. invent an id for each label whose address is taken and replace each indirect goto by a switch to each possible target. - Currently we emit a switch for each indirect goto instead of merging them as llvm-gcc does. llvm-svn: 54318
* Finally fix PR2189. This makes a fairly invasive but important change toChris Lattner2008-08-045-18/+16
| | | | | | | | | | move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. llvm-svn: 54317
* Support constructor and destructor attributes in CodeGenDaniel Dunbar2008-08-012-46/+65
| | | | | | | | | - There is an miscompilation issue remaining due to a poor interaction between the delayed emission of static functions and the emission of constructors, but that already existed prior to this change. llvm-svn: 54258
* Fix a regression I introduced in r54107:Chris Lattner2008-07-311-1/+1
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=54107 llvm-svn: 54242
* Updated to match new atomic names (to enable overloading for pointers toMon P Wang2008-07-311-4/+8
| | | | | | different address spaces) for llvm r54195. llvm-svn: 54241
* Fix implicit initialization of structures.Daniel Dunbar2008-07-301-5/+0
| | | | | | <rdar://problem/6113085> llvm-svn: 54237
* Change CodeGenModule GlobalDeclMap to directly reference globalsDaniel Dunbar2008-07-302-42/+56
| | | | | | | | | | | | | | | instead of mapping the decl to a bitcast of the global to the correct type. - GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now. - This solves a problem where a dangling pointer could be introduced by the RAUW done when replacing a forward or tentative definition. See testcase for more details. - Fixes <rdar://problem/6108358> llvm-svn: 54211
* Rework codegen emission of globalsDaniel Dunbar2008-07-297-192/+229
| | | | | | | | | | | | | | | | | | | | - No (intended) functionality change. - Primary purpose is to clearly separate (lazy) construction of globals that are a forward declaration or tentative definition from those that are the final definition. - Lazy construction is now encapsulated in GetAddrOf{Function,GlobalVar} while final definitions are constructed in EmitGlobal{Function,Var}Definition. - External interface for dealing with globals is now limited to EmitGlobal and GetAddrOf{Function,GlobalVar}. - Also updated helper functions dealing with statics, annotations, and ctors to be private. llvm-svn: 54179
* Fix codegen of chained declarationsDaniel Dunbar2008-07-293-12/+8
| | | | | | | | - Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just recurse on any ScopedDecl. - Fix for <rdar://problem/6093838> llvm-svn: 54162
* Fix a bug in my previous patch, CGF is not valid for constants outside a ↵Chris Lattner2008-07-261-2/+2
| | | | | | function llvm-svn: 54108
* remove uses of QualType::getCanonicalType() from codegen for PR2189Chris Lattner2008-07-266-52/+46
| | | | llvm-svn: 54107
* change more instances of QualType::getCanonicalType to callChris Lattner2008-07-261-5/+9
| | | | | | ASTContext::getCanonicalType instead (PR2189) llvm-svn: 54105
* implement codegen support for labels at the end of stmtexprs.Chris Lattner2008-07-263-6/+20
| | | | llvm-svn: 54100
* minor tidying, no functionality change.Chris Lattner2008-07-262-31/+15
| | | | llvm-svn: 54099
* Fix rdar://6103124, the only dummy blocks are ones without names. Named blocksChris Lattner2008-07-251-1/+1
| | | | | | are important part of control flow structures. llvm-svn: 54078
* X86 builtin fixesNate Begeman2008-07-251-32/+10
| | | | llvm-svn: 54049
* Generate vector compares in codegenNate Begeman2008-07-251-2/+18
| | | | llvm-svn: 54048
* Move comment to match styleNate Begeman2008-07-251-1/+2
| | | | llvm-svn: 54047
* Rework codegen of case rangesDaniel Dunbar2008-07-251-47/+49
| | | | | | | | | | | | | - Fix multiple issues with the way case ranges were emitted, see test cases details about the specific issues. - The root issue was not being careful about how basic blocks were emitted which led to them being chained together incorrectly, resulting in improper control flow. - Fixes <rdar://problem/6098585> llvm-svn: 54006
* Fix EmitCaseStmtRange to ignore empty rangesDaniel Dunbar2008-07-241-16/+14
| | | | | | | | | | - Also cleaned up emission slightly - Inspection of the code revealed several other bugs, however. Case ranges are not properly wired and can result in switch cases being dropped or even infinite loops. See: <rdar://problem/6098585> Completes: <rdar://problem/6094119> llvm-svn: 53975
* don't depend on the result of CreateNeg to be a binopChris Lattner2008-07-231-3/+3
| | | | llvm-svn: 53948
* Fix a codegen crash on:Chris Lattner2008-07-231-6/+10
| | | | | | | | | | | int foo(void) { float x[2]; return x; } rdar://6093986 llvm-svn: 53946
* Add note to check what __alignof__ a function type should be.Daniel Dunbar2008-07-221-0/+1
| | | | llvm-svn: 53928
* Prevent codegen crash on sizeof(<function type>), a gcc extension.Daniel Dunbar2008-07-221-2/+3
| | | | llvm-svn: 53899
* Implement bzero, memset, memmove builtins.Daniel Dunbar2008-07-221-10/+31
| | | | | | | This subsumes Nico Weber's patch and implements bzero in terms of llvm.memset to match llvm-gcc. llvm-svn: 53888
* Implement nans, prefetch, and trap builtins. Daniel Dunbar2008-07-211-1/+15
| | | | | | | This closes <rdar://problem/6080720>, support for __builtin_constant_p has been filed separately. llvm-svn: 53885
* Kill an unused variable warningDaniel Dunbar2008-07-211-3/+0
| | | | llvm-svn: 53878
* move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner2008-07-211-4/+5
| | | | | | simplifying code along the way and fixing a problem and memory leak or two. llvm-svn: 53876
* Add __builtin_powi[fl] supportDaniel Dunbar2008-07-211-0/+14
| | | | llvm-svn: 53866
* introduce a new ObjCList templated class and start moving Chris Lattner2008-07-211-5/+9
| | | | | | | various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. llvm-svn: 53856
* Implement ffs, parity, and popcount builtins.Daniel Dunbar2008-07-211-2/+55
| | | | | | + test case llvm-svn: 53851
* don't pass in null as the Name for GenerateClassStructure,Chris Lattner2008-07-211-3/+2
| | | | | | | it goes and makes std::strings out of them, which is not defined. llvm-svn: 53843
* Add support shufpdMon P Wang2008-07-181-0/+4
| | | | llvm-svn: 53747
* Fix for codegen crash on multibit bool bitfield initializationDaniel Dunbar2008-07-171-0/+7
| | | | | | <rdar://problem/6078606> llvm-svn: 53737
* remove CGObjCEtoile until it compiles.Chris Lattner2008-07-141-245/+0
| | | | llvm-svn: 53552
* Codegen support for __builtin_stdarg_startChris Lattner2008-07-091-2/+3
| | | | llvm-svn: 53329
* Fixed bugzilla bug# 2489.Sanjiv Gupta2008-07-041-0/+20
| | | | | | This was broken when the GenerateCode function was splitted to use GenerateFunction. llvm-svn: 53136
* Remove removed header.Bill Wendling2008-07-031-1/+0
| | | | llvm-svn: 53121
OpenPOWER on IntegriCloud