summaryrefslogtreecommitdiffstats
path: root/clang/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-1391/+0
| | | | | | | | | | 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
* remove the source location arguments to various target query methods.Chris Lattner2008-03-051-38/+17
| | | | llvm-svn: 47954
* Removed VarDecl::hasStaticStorage() (redundant with hasGlobalStorage())Ted Kremenek2008-02-271-8/+8
| | | | | | | | | | | Removed VarDecl::hasAutoStorage() (only used by hasLocalStorage()) Merged logic from VarDecl::hasAutoStorage() into VarDecl::hasLocalStorage(), and expanded (fixed) the logic of hasLocalStorage() to handle Extern and PrivateExtern. Renamed Expr::hasStaticStorage() to Expr::hasGlobalStorage(). llvm-svn: 47681
* implement codegen support for sizeof(void), fixing PR2080.Chris Lattner2008-02-211-11/+25
| | | | llvm-svn: 47429
* Alternate address spaces work:Chris Lattner2008-02-201-2/+3
| | | | | | | | | rename QualType::getQualifiers to getCVRQualifiers. Add some fixme's and clean up some code relevant to qualifiers. Change ASQualType to contain a Type* instead of a QualType. Any CVR qualifiers should be on the outer qual type. llvm-svn: 47398
* Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.Steve Naroff2008-02-181-1/+1
| | | | llvm-svn: 47269
* Fix bug where we would report the wrong value for __alignof__ with an expr ↵Anders Carlsson2008-02-181-5/+6
| | | | | | that is not a type. llvm-svn: 47259
* Make sizeof and __alignof work correctly with packed structs.Anders Carlsson2008-02-161-6/+8
| | | | llvm-svn: 47202
* Remove useless parameter from isConstantSizeType.Eli Friedman2008-02-151-4/+4
| | | | llvm-svn: 47156
* Fix a minor bug in isNullPointerConstant triggered by the linux Eli Friedman2008-02-131-1/+1
| | | | | | | | | tgmath.h. Note that there is another issue with tgmath.h, so mandel.c still doesn't work. llvm-svn: 47069
* Move IgnoreParenCasts to be a method on Expr.Chris Lattner2008-02-131-0/+17
| | | | llvm-svn: 47040
* Refine bug fix to Expr::isLvalue (commit r46917).Steve Naroff2008-02-101-0/+4
| | | | llvm-svn: 46919
* Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 ↵Steve Naroff2008-02-101-3/+0
| | | | | | | | submitted by Neil Booth. Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise. llvm-svn: 46917
* Make CallExpr::isBuiltinConstantExpr slightly more efficient.Anders Carlsson2008-01-311-3/+10
| | | | llvm-svn: 46594
* Add support for CallExpr::isBuiltinConstantExpr(). For now, this hook is ↵Steve Naroff2008-01-311-0/+20
| | | | | | | | | | | | | | used to support CFConstantStrings. Can be extended to support other built-in functions. This allows the following code to compile without error... #include <CoreFoundation/CoreFoundation.h> #define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V); CONST_STRING_DECL(kCFTimeZoneSystemTimeZoneDidChangeNotification, "kCFTimeZoneSystemTimeZoneDidChangeNotification") llvm-svn: 46592
* Implement first round of feedback on __builtin_overloadNate Begeman2008-01-301-1/+1
| | | | llvm-svn: 46572
* Implement __builtin_offsetof.Anders Carlsson2008-01-291-1/+47
| | | | llvm-svn: 46515
* fix isIntegerConstantExpr evaluation of unary !.Chris Lattner2008-01-251-1/+1
| | | | llvm-svn: 46364
* Support checking and codegen of constant vector globalsNate Begeman2008-01-251-1/+2
| | | | llvm-svn: 46343
* Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman2008-01-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | __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); llvm-svn: 46132
* Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.Ted Kremenek2008-01-171-0/+8
| | | | | | | Refactored the use of this method into both the Sema module and Analysis module, which were using their own static functions that did the same thing. llvm-svn: 46129
* Record if a compound literal expression is @ file scope. This allows us to ↵Steve Naroff2008-01-141-0/+2
| | | | | | | | implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable. Bug/patch by Eli Friedman! llvm-svn: 45966
* Revert r45951, Chris says it violates the C99 spec.Steve Naroff2008-01-141-30/+19
| | | | llvm-svn: 45961
* Rewrite Expr::isNullPointerConstant() to deal with multiple levels of ↵Steve Naroff2008-01-141-19/+29
| | | | | | | | explicit casts. Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0" llvm-svn: 45951
* Fix the type of predefined identifiers like __func__. Patch byChris Lattner2008-01-121-0/+4
| | | | | | Eli Friedman! llvm-svn: 45906
* - Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I ↵Steve Naroff2008-01-101-3/+14
| | | | | | | | | | noticed it was missing). - Rename CheckInitializer() to CheckInitializerTypes(). - Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately. - Added CheckForConstantInitializer(). llvm-svn: 45840
* Fix isIntegerConstantExpr to compare against zero for casts to bool instead ofChris Lattner2008-01-091-1/+12
| | | | | | | | | | | | | | truncating. This allows us to compile: void foo() { static _Bool foo = 4; } into: @foo1 = internal global i8 1 instead of: @foo1 = internal global i8 4 llvm-svn: 45779
* Teach Expr::isConstantExpr() about CompoundLiterals.Steve Naroff2008-01-091-0/+4
| | | | llvm-svn: 45764
* Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek2008-01-071-2/+2
| | | | | | | some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. llvm-svn: 45715
* Fix PR1895: a crash on an ugly gcc extension.Chris Lattner2008-01-021-2/+8
| | | | llvm-svn: 45505
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* Add accessors + iterator interface.Chris Lattner2007-12-281-0/+30
| | | | llvm-svn: 45378
* Fix the location we emit the "not a constant" error for this:Chris Lattner2007-12-181-4/+12
| | | | | | | | | | | int foo() { typedef int x[foo()]; static int y = sizeof(x); } previously we'd emit it on the typedef, which made not sense at all. llvm-svn: 45154
* Fixed another case where sizeof() returns the size in bytes, not bits.Ted Kremenek2007-12-171-2/+8
| | | | | | | | | | | This parallels a previous patch (duplicate logic caused the bug to appear in multiple locations): r44316 (http://llvm.org/viewvc/llvm-project?rev=44316&view=rev). Patch provided by Nuno Lopes. llvm-svn: 45098
* Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to beTed Kremenek2007-12-151-2/+2
| | | | | | so useful and introduced a few bugs. llvm-svn: 45051
* Added "mode" to StmtIterator to record if the expression being iteratedTed Kremenek2007-12-141-2/+2
| | | | | | | | | over is the subexpression of a sizeof(expression). Different clients will wish to handle iteration over such subexpressions differently, and can now easily query if they are iterating over such statements using the StmtIterator's inSizeOfExpr(). llvm-svn: 45047
* Added support to StmtIterator to traverse the size expression of a VLA typeTed Kremenek2007-12-141-2/+7
| | | | | | | | | | | declared in a sizeof. For example: sizeof(int[foo()]); the expression "foo()" is an expression that is executed during the evaluation of sizeof. llvm-svn: 45043
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-121-1/+3
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* Fix a case where we'd return "is not a constant expr" withoutChris Lattner2007-12-111-2/+7
| | | | | | return a location. llvm-svn: 44889
* Recognize CompoundLiteralExpr's as valid lvalue's.Steve Naroff2007-12-051-0/+2
| | | | | | Also updated a FIXME in Sema::CheckInitializer()... llvm-svn: 44602
* Compute side-effect for conditional expression.Fariborz Jahanian2007-12-011-0/+7
| | | | llvm-svn: 44492
* make the unused expression warning less noisy by not warning about comma ↵Chris Lattner2007-12-011-2/+9
| | | | | | | | exprs whose LHS and RHS both have side effects. llvm-svn: 44486
* String literals are always valid LValues.Anders Carlsson2007-11-301-0/+1
| | | | llvm-svn: 44472
* GCC has an extension where the left hand side of the ? : operator can be ↵Anders Carlsson2007-11-301-3/+5
| | | | | | omitted. Handle this in a few more places. llvm-svn: 44462
* fix compilation error noticed by Nuno LopesChris Lattner2007-11-281-1/+2
| | | | llvm-svn: 44388
* add several cases that Expr::hasStaticStorage missed, pointed out by Oliver HuntChris Lattner2007-11-271-0/+9
| | | | llvm-svn: 44376
* sizeof is defined by bitsin(char) not by units of 8 bits.Chris Lattner2007-11-271-4/+7
| | | | llvm-svn: 44369
* sizeof() return size in bytes, not bits, patch by Nuno Lopes!Chris Lattner2007-11-251-1/+1
| | | | llvm-svn: 44316
* Finish up variadic methods/messages.Steve Naroff2007-11-151-10/+10
| | | | llvm-svn: 44172
* improve handling of address of global when checking forChris Lattner2007-11-131-0/+22
| | | | | | constants and initializers. Patch by Sanghyeon Seo, thanks! llvm-svn: 44049
OpenPOWER on IntegriCloud