summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* OpenCL: Fix vector conditional operator CodeGen for the case wherePeter Collingbourne2012-05-291-1/+1
| | | | | | the operands are vectors of doubles. llvm-svn: 157596
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-2/+2
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Use enum to set debug info size generated by ClangAlexey Samsonov2012-04-271-3/+4
| | | | llvm-svn: 155697
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-2/+2
| | | | llvm-svn: 155082
* Express the number of ULPs in fpaccuracy metadata as a real rather than a Duncan Sands2012-04-101-1/+1
| | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. llvm-svn: 154388
* Make the variant of __builtin_shufflevector that takes the shuffle indexes ↵Eli Friedman2012-04-051-3/+3
| | | | | | as a vector actually usable. Patch by David Neto. PR12465. llvm-svn: 154128
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-16/+16
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-11/+4
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Unify the BlockDeclRefExpr and DeclRefExpr paths so thatJohn McCall2012-03-101-46/+15
| | | | | | | | we correctly emit loads of BlockDeclRefExprs even when they don't qualify as ODR-uses. I think I'm adequately convinced that BlockDeclRefExpr can die. llvm-svn: 152479
* [AST] Reduce Decl::getASTContext() calls.Daniel Dunbar2012-03-091-1/+1
| | | | | | | - This function is not at all free; pass it around along some hot paths instead of recomputing it deep inside various VarDecl methods. llvm-svn: 152363
* Don't even try to directly emit the value of a DeclRefExpr if that declarationRichard Smith2012-03-071-2/+11
| | | | | | is not usable in a constant expression. ~2.5% speedup on 403.gcc / combine.c. llvm-svn: 152193
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+12
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Reinstate r151879, r151880, reverted in r151922, along with a bugfix forRichard Smith2012-03-021-9/+15
| | | | | | | | | scalar emission of DeclRefExprs to const bools: emit scalar bools as i1, not as i8. In addition to the extra unit testing, this has successfully bootstrapped. llvm-svn: 151955
* Revert r151879, r151880, "PR12145: Avoid emitting loads of constexpr ↵Daniel Dunbar2012-03-021-15/+9
| | | | | | | | variables in contexts where there" and "Fix buildbot: make this test less dependent on the value names in the produced IR." They broke bootstrap. llvm-svn: 151922
* PR12145: Avoid emitting loads of constexpr variables in contexts where thereRichard Smith2012-03-021-9/+15
| | | | | | | is no odr-use of the variable. Go slightly beyond what the standard requires for variables of reference type. llvm-svn: 151879
* Implement IRGen for the retain-autorelease in the lambda ↵Eli Friedman2012-02-281-2/+1
| | | | | | conversion-to-block-pointer outside of ARC. Testcases coming up soon. llvm-svn: 151603
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-221-0/+4
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Fix wrong-code bug: __imag on a scalar lvalue should produce a zero rvalue,Richard Smith2012-02-181-1/+4
| | | | | | rather than an lvalue referring to the scalar. llvm-svn: 150889
* Split reinterpret_casts of member pointers out from CK_BitCast; thisJohn McCall2012-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | is general goodness because representations of member pointers are not always equivalent across member pointer types on all ABIs (even though this isn't really standard-endorsed). Take advantage of the new information to teach IR-generation how to do these reinterprets in constant initializers. Make sure this works when intermingled with hierarchy conversions (although this is not part of our motivating use case). Doing this in the constant-evaluator would probably have been better, but that would require a *lot* of extra structure in the representation of constant member pointers: you'd really have to track an arbitrary chain of hierarchy conversions and reinterpretations in order to get this right. Ultimately, this seems less complex. I also wasn't quite sure how to extend the constant evaluator to handle foldings that we don't actually want to treat as extended constant expressions. llvm-svn: 150551
* Use a simpler (and more efficient) pattern to pad vectors.Benjamin Kramer2012-02-141-11/+6
| | | | llvm-svn: 150475
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-5/+4
| | | | | | CodeGenModule. llvm-svn: 149943
* Fix vector splat casts to cast element to the appropriate vector element ↵Craig Topper2012-02-061-0/+2
| | | | | | before inserting into the vector. Fixes PR11930. llvm-svn: 149855
* reapply r148902:Chris Lattner2012-01-251-20/+6
| | | | | | | | | | "use the new ConstantVector::getSplat method where it makes sense." Also simplify a bunch of code to use the Builder->getInt32 instead of doing it the hard and ugly way. Much more progress could be made here, but I don't plan to do it. llvm-svn: 148926
* Revert 148902 which was part of 148901 which was reverted in r148906.Argyrios Kyrtzidis2012-01-251-6/+18
| | | | | | | Original log: use the new ConstantVector::getSplat method where it makes sense. llvm-svn: 148907
* use the new ConstantVector::getSplat method where it makes sense.Chris Lattner2012-01-251-18/+6
| | | | llvm-svn: 148902
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-13/+0
| | | | llvm-svn: 148577
* Add support for OpenCL 1.1 logical operations.Tanya Lattner2012-01-161-0/+33
| | | | llvm-svn: 148254
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-0/+52
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* Revert r147664; it's breaking clang regression tests.Eli Friedman2012-01-061-1/+1
| | | | llvm-svn: 147681
* Silence GCC warnings.Jakub Staszak2012-01-061-1/+1
| | | | llvm-svn: 147664
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-281-9/+7
| | | | | | clients. No functionality change. llvm-svn: 147318
* Switch a few callers of MakeAddrLValue places over to ↵Eli Friedman2011-12-191-4/+4
| | | | | | MakeNaturalAlignAddrLValue. llvm-svn: 146920
* Fix an edge case in IRGen for conditionals. PR11509.Eli Friedman2011-12-081-0/+5
| | | | llvm-svn: 146189
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-1/+3
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Rip out CK_GetObjCProperty.John McCall2011-11-071-1/+0
| | | | llvm-svn: 143910
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-071-21/+1
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-4/+4
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Annotate imprecise FP division with fpaccuracy metadataPeter Collingbourne2011-10-271-2/+12
| | | | | | | | | The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-2/+2
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-2/+2
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-2/+2
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Handle an edge case involving the conditional operator and throw ↵Eli Friedman2011-10-151-5/+12
| | | | | | expressions. PR10582. llvm-svn: 142047
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-22/+57
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+5
| | | | llvm-svn: 141632
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-041-4/+2
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* de-tmpify clang.Benjamin Kramer2011-09-271-2/+2
| | | | llvm-svn: 140637
* Treat list-initialization of scalars as a first-class citizen in C++11.Sebastian Redl2011-09-241-2/+7
| | | | | | | | | Allow empty initializer lists for scalars, which mean value-initialization. Constant evaluation for single-element and empty initializer lists for scalars. Codegen for empty initializer lists for scalars. Test case comes in next commit. llvm-svn: 140459
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-4/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+6
| | | | llvm-svn: 140367
OpenPOWER on IntegriCloud