summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use tryEvaluate for constant exprs.Anders Carlsson2008-11-221-2/+13
| | | | llvm-svn: 59857
* A few corrections to the expr constant work. Not enabled at the Eli Friedman2008-11-171-2/+3
| | | | | | moment. llvm-svn: 59435
* More expr constant work. (Off by default).Anders Carlsson2008-11-171-8/+25
| | | | llvm-svn: 59433
* rename Expr::tryEvaluate to Expr::Evaluate.Chris Lattner2008-11-161-2/+2
| | | | llvm-svn: 59426
* More constant expr work.Anders Carlsson2008-11-161-6/+18
| | | | llvm-svn: 59405
* Check in code that uses tryEvaluate for emitting constant exprs (not used yet).Anders Carlsson2008-11-151-0/+29
| | | | llvm-svn: 59375
* Use IgnoreParenCasts. No functionality change.Anders Carlsson2008-11-151-10/+1
| | | | llvm-svn: 59371
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-8/+2
| | | | | | expressions, both of values and types. llvm-svn: 59057
* make codegen reject initializes with designators, like this:Chris Lattner2008-10-261-0/+6
| | | | | | | | t.c:1:13: error: cannot codegen this designators yet int a[10] = {2, 4, [8]=9, 10}; ^~~~~~~~~~~~~~~~~ llvm-svn: 58220
* Preliminary support for function overloadingDouglas Gregor2008-10-211-2/+2
| | | | llvm-svn: 57909
* silence release-assert warnings.Chris Lattner2008-10-121-2/+2
| | | | llvm-svn: 57392
* Make sema and codegen allow __builtin___CFStringMakeConstantString as a validChris Lattner2008-10-061-0/+18
| | | | | | | constant lvalue. Implement this in codegen by moving the code out of CGBuiltin into EmitConstantExpr. llvm-svn: 57163
* instead of making codegen try to know about all of the builtins to generateChris Lattner2008-10-061-23/+8
| | | | | | | constants for them, just use the constant evaluator to do the job. This also fixes crashes on 'unknown constant builtins'. llvm-svn: 57155
* Handle emitting __builtin_huge_valf as a constant expr.Anders Carlsson2008-08-251-0/+28
| | | | llvm-svn: 55299
* Add CodeGen support for CXXZeroInitValueExpr.Argyrios Kyrtzidis2008-08-231-0/+3
| | | | llvm-svn: 55249
* Add ExplicitCastExpr to replace the current CastExpr, and have ↵Argyrios Kyrtzidis2008-08-181-1/+1
| | | | | | | | | | | ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr): Expr -> CastExpr -> ExplicitCastExpr -> ImplicitCastExpr llvm-svn: 54955
* Add CodeGen support for AddrLabelExpr in initializers.Daniel Dunbar2008-08-161-0/+8
| | | | llvm-svn: 54837
* Change WarnUnsupported to ErrorUnsupported (in name and in practice).Daniel Dunbar2008-08-161-5/+5
| | | | | | | - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
* Add GetAddrOfConstantCString methodDaniel Dunbar2008-08-131-5/+3
| | | | | | | | | | | | | | | | | | - Returns addr of constant for argument + '\0'. - I couldn't think of a better name. - Move appropriate users of GetAddrOfConstantString to this. Rename getStringForStringLiteral to GetStringForStringLiteral. Add GetAddrOfConstantStringFromLiteral - This combines GetAddrOfConstantString and GetStringForStringLiteral. This method can be, but is not yet, more efficient. Change GetAddrOfConstantString to not add terminating '\0' - <rdar://problem/6140956> llvm-svn: 54768
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-0/+1
| | | | | | | | | | | ObjCProtocolDecl directly. Implement CodeGen support for forward protocol decls (no-ops are so nice to implement). Also moved CGObjCRuntime.h out of CodeGenModule.h llvm-svn: 54709
* Add ObjC constant string support for NeXT.Daniel Dunbar2008-08-121-2/+4
| | | | | | | | | | Changed CGObjCRuntime::GenerateConstantString interface to take std::string instead of char* and size. Change ObjC functions which call on GenerateConstantString to bitcast result to appropriate type. llvm-svn: 54659
* Change CodeGenModule to only create ObjC runtime for ObjC filesDaniel Dunbar2008-08-111-1/+1
| | | | | | | - Changed CodeGenModule::getObjCRuntime to return reference. - Added CodeGenModule::hasObjCRuntime predicate. llvm-svn: 54645
* More #include cleaningDaniel Dunbar2008-08-111-1/+2
| | | | | | - Remove internal uses of AST.h llvm-svn: 54628
* Back out r54608 (inline string literals were getting an extra '\0')Daniel Dunbar2008-08-101-23/+3
| | | | | | | | | | | | | | | temporarily, I assumed GetAddrForConstantString literal was being used consistently but it doesn't look like it is. Factored out a CodeGenModule::getStringForStringLiteral which handles extracting a std::string for the bytes of a StringLiteral, padded to match the type. Update EmitLValue to use getStringForStringLiteral, this was previously not padding strings correctly. Good thing we only emit strings in 4 different places! llvm-svn: 54621
* Fix crash during initialization of a bitfield which followed a zeroDaniel Dunbar2008-08-101-2/+8
| | | | | | | | length element. Fix some 80-col violations. llvm-svn: 54610
* Finally fix PR2189. This makes a fairly invasive but important change toChris Lattner2008-08-041-5/+4
| | | | | | | | | | 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
* Rework codegen emission of globalsDaniel Dunbar2008-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | - 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 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-261-5/+4
| | | | llvm-svn: 54107
* Fix for codegen crash on multibit bool bitfield initializationDaniel Dunbar2008-07-171-0/+7
| | | | | | <rdar://problem/6078606> llvm-svn: 53737
* "this patch adds code generation hooks for Objective-C constant strings. It ↵Chris Lattner2008-06-211-0/+4
| | | | | | | | 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
* 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
* 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
* Make sure _Bool globals have the correct type.Eli Friedman2008-06-011-3/+8
| | | | llvm-svn: 51838
* 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
* Fix constant vector init for initializer lists with an incomplete list Eli Friedman2008-05-301-6/+9
| | | | | | of elements. llvm-svn: 51769
* Some additions to constant initializer generation code. Adds Eli Friedman2008-05-301-28/+132
| | | | | | | | | | | | | | bit-field initialization; ugly code, X86-only, but it works, at least for basic stuff. Separates/adds union initialization; currently disabled, though, because the struct/array code needs modifications to support elements of the wrong type. Fixes PR2381 and PR2309 with the bit-field initialization. And NetHack compiles and appears to work with a few tweaks (to work around the lack of transparent_union support, and clang being a bit strict about conflicting declarations). llvm-svn: 51763
* More complete/correct implementation of the comparison operators for Eli Friedman2008-05-291-7/+47
| | | | | | constant expressions. llvm-svn: 51682
* Add codegen support for a few more kinds of initializer constant Eli Friedman2008-05-291-0/+35
| | | | | | expressions. llvm-svn: 51677
* Restructure constant structure init codegen so that it's possible to Eli Friedman2008-05-201-29/+20
| | | | | | | | implement bitfield codegen (although I don't envy the person who implements it). This also prevents a crash on code like that from PR2309 (it's still broken, but it fails more gracefully). llvm-svn: 51285
* Remove code that shouldn't have any effect anymore.Eli Friedman2008-05-201-18/+0
| | | | llvm-svn: 51284
* use simplified ConstantFP:get method.Chris Lattner2008-04-201-1/+1
| | | | llvm-svn: 49979
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-5/+7
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-0/+4
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+627
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud