aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01Add codegen support for ObjC message expressions with the GNU runtime.Chris Lattner
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21implement codegen support for sizeof(void), fixing PR2080.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16implement codegen support for aggregates casted to void.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02minor tweak to anders patch: (only) ocu vectors support splatting, butChris Lattner
ocu vectors should not treat bitcasts from int <-> vector as a splat unless it is of the element type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Only OCU vectors can be splatted.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31Fix PR1921 by promoting negative indices to intptrty.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46599 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Implement first round of feedback on __builtin_overloadNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Make sure to emit all the arguments to a function call. This fixes the Eli Friedman
codegen of calls to functions without a prototype and varargs functions, including printf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Fix a bug where CodeGen would attempt to erase an instruction that was Eli Friedman
already used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Implement __builtin_offsetof.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Correctly handle scalars in braces.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22Problem with ObjC's type-encoding of nested structs causing infinit recursion.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46260 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman
__builtin_overload takes 2 or more arguments: 0) a non-zero constant-expr for the number of arguments the overloaded functions will take 1) the arguments to pass to the matching overloaded function 2) a list of functions to match. The return type of __builtin_overload is inferred from the function whose args match the types of the arguments passed to the builtin. For example: float a; float sinf(float); int sini(int); float b = __builtin_overload(1, a, sini, sinf); Says that we are overloading functions that take one argument, and trying to pass an argument of the same type as 'a'. sini() does not match since it takes and argument of type int. sinf does match, so at codegen time this will turn into float b = sinf(a); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek
some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03fix long lines.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03Fix a crash reported by Seo Sanghyeon.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30Allow implicit casts during arithmetic for OCUVector operationsNate Begeman
Add codegen support and test for said casts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30Allow codegen of vector fdivNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45440 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-26No need to do work that the folding builder does for us.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45361 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-26Remove broken assert from CodeGen. Better check is done in Sema.Seo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18Turns out the LLVMFoldingBuilder can fold InsertElement. Knowing this, we ↵Anders Carlsson
can get rid of our special casing of constants when creating vectors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15We now support all MMX intrinsics. SSE intrinsics are next.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Fix a codegen crash on test/CodeGen/cast.c, reported by Keith.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek
SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10Added missing inclusion of stdarg.h. Now CGExprScalar.cppTed Kremenek
compiles again on Linux. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10Add EmitShuffleVector helper method.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44806 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Implement CodeGen for vectors. Don't create unnecessary conversion ↵Anders Carlsson
instructions if the value to be converted is a constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Ignore typedefs in pointer arithmetic codegen.Seo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02convert the rest of the stderr users in codegen to use diagnostics.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30Fix a codegen crash on void ?: reported by OliverChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26Fix sema support for the gnu ?: expression with a Chris Lattner
missing middle expression, and fix a codegen bug where we didn't correctly promote the condition to the right result type. This fixes PR1824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Implement codegen of CXX BoolNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Fix a typo that prevented pointer-to-int conversions from working.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Fix 80 col violations.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Remove commented out line.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Add (partial) support for @encode.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Fix "strbuf += stufflen;" crash.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Add a new ChooseExpr::isConditionTrue method to unifyChris Lattner
some code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Handle non-constant initializers.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Visit CompoundLiteralExpr and InitListExprDevang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Updated VC++ build system.Hartmut Kaiser
Silenced some VC++ warnings. Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review. Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15Move type compatibility predicates from Type to ASTContext. In addition, the ↵Steve Naroff
predicates are now instance methods (they were previously static class methods on Type). This allowed me to fix the following hack from this weekend... // FIXME: Devise a way to do this without using strcmp. // Would like to say..."return getAsStructureType() == IdStructType;", but // we don't have a pointer to ASTContext. bool Type::isObjcIdType() const { if (const RecordType *RT = getAsStructureType()) return !strcmp(RT->getDecl()->getName(), "objc_object"); return false; } ...which is now... bool isObjcIdType(QualType T) const { return T->getAsStructureType() == IdStructType; } Side notes: - I had to remove a convenience function from the TypesCompatibleExpr class. int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);} Which required a couple clients get a little more verbose... - Result = TCE->typesAreCompatible(); + Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2()); Overall, I think this change also makes sense for a couple reasons... 1) Since ASTContext vends types, it makes sense for the type compatibility API to be there. 2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15Add code generation and sema checking for __builtin_va_arg.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13Fix an incorrect assertion.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42951 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12Generate code for va_start and va_end.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09Use LLVMFoldingBuilderDevang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22further apfloat'ize the front-end, allowing codegen to pass Chris Lattner
APFloat straight through to LLVM now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42236 91177308-0d34-0410-b5e6-96231b3b80d8