summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
AgeCommit message (Collapse)Author
2008-08-04Add CodeGen support for indirect goto.Daniel Dunbar
- 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
2008-07-26remove uses of QualType::getCanonicalType() from codegen for PR2189Chris Lattner
llvm-svn: 54107
2008-07-26implement codegen support for labels at the end of stmtexprs.Chris Lattner
llvm-svn: 54100
2008-07-26minor tidying, no functionality change.Chris Lattner
llvm-svn: 54099
2008-07-25Generate vector compares in codegenNate Begeman
llvm-svn: 54048
2008-07-23Fix a codegen crash on:Chris Lattner
int foo(void) { float x[2]; return x; } rdar://6093986 llvm-svn: 53946
2008-07-22Add note to check what __alignof__ a function type should be.Daniel Dunbar
llvm-svn: 53928
2008-07-22Prevent codegen crash on sizeof(<function type>), a gcc extension.Daniel Dunbar
llvm-svn: 53899
2008-06-30Make a few related changes:Chris Lattner
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
2008-06-26avoid a lot of unneeded selector processing work by passing aroundChris Lattner
selectors instead of Value*'s. llvm-svn: 52760
2008-06-17This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek
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
2008-06-04fix crash when codegening 'cond ? lhs : call-to-void-func()'Nuno Lopes
llvm-svn: 51958
2008-06-01Support for code generation of Objective-C top-level language constructs.Anton Korobeynikov
Implemented by David Chisnall! llvm-svn: 51835
2008-05-29Fix an extremely subtle bug with pointer comparisons: they have to be Eli Friedman
unsigned because it's possible (at least in theory) to have have both positive and negative pointers pointing to the same object. llvm-svn: 51681
2008-05-25Fix for PR2001. I'm not really fond of it, but it is correct (unless Eli Friedman
someone tries to make a bitfield volatile?). Not sure how to write a test; any suggestions? llvm-svn: 51558
2008-05-16Backout of codegen-based fix to PR2334; this has been fixed differently Eli Friedman
at the Sema layer. llvm-svn: 51203
2008-05-16Patch for PR2334, and a similar ObjC bug.Eli Friedman
llvm-svn: 51193
2008-05-14Implementation of __builtin_shufflevector, a portable builtin capable of Eli Friedman
expressing the full flexibility of the LLVM shufflevector instruction. The expected immediate usage is in *mmintrin.h, so that they don't depend on the mess of gcc-inherited (and not completely implemented) shuffle builtins. llvm-svn: 51113
2008-05-13Add codegen support for block-level compound literals.Eli Friedman
llvm-svn: 51081
2008-04-20implement a fixme, add support for ++/-- on long double.Chris Lattner
llvm-svn: 49980
2008-04-20use simplified ConstantFP:get method.Chris Lattner
llvm-svn: 49979
2008-04-18OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman
llvm-svn: 49942
2008-04-13update to follow mainline llvm API change.Chris Lattner
llvm-svn: 49607
2008-04-08Add support for C++ default arguments, and rework Parse-Sema Chris Lattner
interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
2008-04-06tracking API changes arising from r49277Gabor Greif
llvm-svn: 49279
2008-04-04Since isComplexType() no longer returns true for _Complex integers, the codeChris Lattner
generator needs to call isAnyComplexType(). This fixes PR1960. llvm-svn: 49220
2008-04-04Codegen assignment to self correctly, patch by David Chisnall!Chris Lattner
llvm-svn: 49201
2008-04-02add a common base class "PointerLikeType" for PointerType and ReferenceType,Chris Lattner
allowing them to be treated the same in some contexts. A suggestion for a better name is welcome :) llvm-svn: 49100
2008-03-30some cleanups on top of David's patch. There are still twoChris Lattner
remaining open issues I've communicated to him: 1) self can be assigned to, and his patch didn't handle it correctly. 2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses all parent class ivars) and flattens classes. If A derives from B, and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}. David, please review. llvm-svn: 48970
2008-03-30Add initial support for objc codegen for methods, ivars, and theChris Lattner
etoile runtime, patch by David Chisnall! llvm-svn: 48969
2008-03-19simplify the clang codegen by using the new Builder.CreateStructGEP method.Chris Lattner
llvm-svn: 48534
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. llvm-svn: 48402