summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-2/+2
| | | | | | just letting them be implicitly created. llvm-svn: 216528
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-091-1/+6
| | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210498
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-4/+5
| | | | llvm-svn: 208517
* Make some assertions on constant expressions static.Benjamin Kramer2014-03-151-1/+1
| | | | llvm-svn: 204012
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-2/+1
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* Reapply r198845, reverted in r198849, with a fix to make it valid C++98, notRichard Smith2014-01-101-35/+39
| | | | | | | | | | | just valid C++11 =) Original commit message: PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on SPARC, where uint64_t apparently requires higher alignment than void*. llvm-svn: 198903
* Revert "PR18427: Use an appropriately-aligned buffer in APValue, to avoid a ↵Argyrios Kyrtzidis2014-01-091-40/+34
| | | | | | | | | crash on" It broke building. This reverts commit r198845. llvm-svn: 198849
* PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash onRichard Smith2014-01-091-34/+40
| | | | | | SPARC, where uint64_t apparently requires higher alignment than void*. llvm-svn: 198845
* Pacify compilers that think you can drop off a fully covered switch.Benjamin Kramer2013-06-031-0/+1
| | | | llvm-svn: 183155
* Fix memory leak for APValues that do memory allocation.Manuel Klimek2013-06-031-0/+33
| | | | | | | | | This patch ensures that APValues are deallocated with the ASTContext by registering a deallocation function for APValues to the ASTContext. Original version of the patch by James Dennett. llvm-svn: 183101
* Don't crash while printing APValues that are lvalues casted to aDouglas Gregor2013-01-291-0/+2
| | | | | | decidedly non-reference, non-pointer type. Fixes <rdar://problem/13090123>. llvm-svn: 173747
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Store SourceManager pointer on PrintingPolicy in the case where we're dumping,Richard Smith2012-08-161-3/+2
| | | | | | | | | and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. llvm-svn: 162011
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-3/+3
| | | | | | | | | | | | | 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
* Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix upRichard Smith2012-03-231-1/+4
| | | | | | some calling code to actually pass in a non-null type, to avoid a crash. llvm-svn: 153358
* Assign APValues by swapping from a temporary. Removes a bunch of unnecessaryRichard Smith2012-03-101-42/+47
| | | | | | | | copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on 403.gcc/combine.c. The performance differences on my constexpr torture tests are below the noise floor. llvm-svn: 152455
* [AST] APValue: Split the fast path of MakeUninit to be inline.Daniel Dunbar2012-03-081-1/+1
| | | | | | | - This change seems to be a tiny loss on 403.gcc/combine.c (.2%), but I think it is the right thing to do. llvm-svn: 152330
* Implement DR1454. This allows all intermediate results in constant expressionsRichard Smith2012-02-151-4/+15
| | | | | | | | | | | | to be core constant expressions (including pointers and references to temporaries), and makes constexpr calculations Turing-complete. A Turing machine simulator is included as a testcase. This opens up the possibilty of removing CCValue entirely, and removing some copies from the constant evaluator in the process, but that cleanup is not part of this change. llvm-svn: 150557
* Add an APValue representation for the difference between two ↵Eli Friedman2012-01-041-1/+16
| | | | | | | | | | address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer. With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary. Fixes PR11705. llvm-svn: 147561
* Add missing flush call. This is an attempt to fix a broken Windows buildbot.Eli Friedman2011-12-161-0/+1
| | | | llvm-svn: 146760
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-161-57/+192
| | | | | | | | | | fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit argument to driver and frontend, to control the maximum number of notes so produced (default 10). Fix APValue printing to be able to pretty-print all APValue types, and move the testing for this functionality from a unittest to a -verify test now that it's visible in clang's output. llvm-svn: 146749
* Constant expression evaluation: add support for evaluation of member pointersRichard Smith2011-11-171-16/+105
| | | | | | and base-to-derived casts, and add proper handling of temporaries. llvm-svn: 144926
* Represent an APValue based on a Decl as that Decl, rather than a DeclRefExprRichard Smith2011-11-121-9/+4
| | | | | | | | or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions. llvm-svn: 144468
* Constant expression evaluation: support for evaluation of structs and unions ofRichard Smith2011-11-101-12/+78
| | | | | | | literal types, as well as derived-to-base casts for lvalues and derived-to-virtual-base casts. llvm-svn: 144265
* Constant expression evaluation: support for arrays.Richard Smith2011-11-071-2/+43
| | | | llvm-svn: 143922
* Fix 32-bit build bots and remove some casting-away-const warnings.Richard Smith2011-11-071-2/+6
| | | | llvm-svn: 143914
* Constant expression evaluation: preserve subobject designator when flattening aRichard Smith2011-11-071-8/+63
| | | | | | core constant value down to an APValue. llvm-svn: 143909
* constexpr function substitution:Richard Smith2011-10-291-4/+3
| | | | | | | | Track the function invocation where an lvalue referring to a constexpr function parameter originated from, and use it to substitute the correct argument and to determine whether such an argument's lifetime has ended. llvm-svn: 143296
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+2
| | | | llvm-svn: 140367
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Define DiagnosticBuilder<<APValue so it's easy to include APValues inJeffrey Yasskin2011-07-181-0/+45
| | | | | | diagnostics. llvm-svn: 135398
* Refactoring of constant expression evaluatorPeter Collingbourne2011-05-131-4/+4
| | | | | | | | | This introduces a generic base class for the expression evaluator classes, which handles a few common expression types which were previously handled separately in each class. Also, the expression evaluator now uses ConstStmtVisitor. llvm-svn: 131281
* Fix -Wcast-qual warnings.Dan Gohman2010-04-191-1/+2
| | | | llvm-svn: 101786
* Convert the type of the LValue offset variable in APValue to CharUnits, movingKen Dyck2010-01-151-0/+33
| | | | | | the LValue-related methods of APValue out of line to avoid header file leaching. llvm-svn: 93512
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-1/+1
| | | | llvm-svn: 81346
* Make sure to access APValue's data via a char array (rather thanDouglas Gregor2009-09-081-7/+7
| | | | | | | | through an array of void*), so that we don't run afoul of the strict-aliasing rules in C++ 3.10p15. Unfortunately, GCC 4.4 still complains about this code. llvm-svn: 81251
* Remove some now-unneeded calls to llvm::errs().flush().Daniel Dunbar2009-03-101-1/+0
| | | | llvm-svn: 66555
* Support evaluation of vector constant expressions, and codegen of same.Nate Begeman2009-01-181-1/+3
| | | | llvm-svn: 62455
* Add support for vectors to APValue. Vector constant evaluator and tests coming.Nate Begeman2009-01-181-0/+10
| | | | llvm-svn: 62438
* add dump and print methods, add operator<< for APValue.Chris Lattner2008-11-161-0/+97
llvm-svn: 59411
OpenPOWER on IntegriCloud