summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Extend Evaluate() to fold (int) <pointer type>.Daniel Dunbar2009-02-191-4/+11
| | | | | | | | | | - PR3463, PR3398, <rdar://problem/6553401> crash on relocatable symbol addresses as constants in static locals. - There are many more scenarious we could handle (like arithmetic on such an int) but this is the main use case. llvm-svn: 65074
* Simplify, no functionality change.Daniel Dunbar2009-02-191-6/+6
| | | | llvm-svn: 65073
* Add enough checking to ensure that non-constant block literals don'tMike Stump2009-02-192-2/+9
| | | | | | | appear to be constant. I'll probably redo this and throw it all away later once we have codegen for BlockDeclRefExprs. llvm-svn: 65070
* Change IntExprEvaluator to operate on an APValue not an APSInt.Daniel Dunbar2009-02-191-37/+55
| | | | | | - Prep for handling lvalues, no intended functionality change. llvm-svn: 65063
* Add another IntExprEvaluator::Success overload to suck up remained ofDaniel Dunbar2009-02-191-43/+49
| | | | | | | | | | | | | | | | | | manual setting of the Result. - Idiom now enforces that result will always have correct width and type; this exposed three new bugs: o Enum constant decl value can have different width than type (PR3173). o EvaluateInteger should not run an IntExprEvaluator over non-integral expressions. o FloatExprEvaluate was not handling casts correctly (it was evaluating the cast in the IntExprEvaluator!). llvm-svn: 65053
* Fix PR3619 by properly considering size modifiers and type quals whenChris Lattner2009-02-191-2/+2
| | | | | | uniquing array types. llvm-svn: 65046
* Add IntExprEvaluator::Success method.Daniel Dunbar2009-02-191-174/+77
| | | | | | | | | | | - Handles assignment to Result with appropriate type. - Simplifies & encapsulates most direct handling of the Result value; prep for allowing IntExprEvaluator to deal with LValue APValues. - No intended functionality change. llvm-svn: 65038
* Add Type::getAsFunctionNoProtoDaniel Dunbar2009-02-191-0/+4
| | | | llvm-svn: 65031
* only do one DenseMap lookup instead of two (one to find out if there isChris Lattner2009-02-191-12/+12
| | | | | | already an entry and one to insert). llvm-svn: 65030
* minor simplification.Chris Lattner2009-02-191-3/+3
| | | | llvm-svn: 65029
* use early exit to reduce indentation.Chris Lattner2009-02-191-25/+26
| | | | llvm-svn: 65028
* fix warning in no-assert mode.Chris Lattner2009-02-191-3/+1
| | | | llvm-svn: 65024
* Handle the GNU void* and function pointer arithmetic extensions for constant ↵Anders Carlsson2009-02-191-1/+7
| | | | | | expressions as well. llvm-svn: 65013
* More codegen for blocks. The type of block literals should be better.Mike Stump2009-02-191-0/+1
| | | | | | The size calculation is improved. llvm-svn: 64994
* minor name changes, no functionality change.Chris Lattner2009-02-181-3/+3
| | | | llvm-svn: 64972
* fix some subtle bugs handling the mix of cvr qualifiers, addr spaces, Chris Lattner2009-02-181-34/+52
| | | | | | | and gc attrs. Add an assert to check that we never get ExtQualType(ExtQualType(T)). llvm-svn: 64970
* rip out __builtin_overloadChris Lattner2009-02-183-42/+0
| | | | llvm-svn: 64961
* Some refactoring and simplificaiotn of objc's gcFariborz Jahanian2009-02-181-0/+16
| | | | | | ir gen. llvm-svn: 64954
* Codegen for int (^bp)(int) = 0;Mike Stump2009-02-181-2/+4
| | | | llvm-svn: 64951
* Add Type::isSpecificBuiltinType as a shortcut.Daniel Dunbar2009-02-181-3/+2
| | | | llvm-svn: 64946
* teach child iterators to walk into the child string of an ObjCStringLiteral,Chris Lattner2009-02-181-2/+2
| | | | | | so it shows up in -ast-dump. llvm-svn: 64901
* privatize all of the string literal memory allocation/creationChris Lattner2009-02-182-49/+23
| | | | | | stuff behind a private static function. llvm-svn: 64898
* change the StringLiteral AST node to track all of the SourceLocations of Chris Lattner2009-02-182-11/+27
| | | | | | | | the various PPTokens that are pasted together to make it. In the course of working on this, I discovered ParseObjCStringLiteral which needs some work. I'll tackle it next. llvm-svn: 64892
* Representation of objc gc's attribute using ExtQualType.Fariborz Jahanian2009-02-182-4/+39
| | | | | | | Note that one test attr-objc-gc.m fails. I will fix this after removing these attributes from the Decl nodes. llvm-svn: 64889
* isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.Daniel Dunbar2009-02-181-3/+16
| | | | | | | Add assert to isICE that, on success, result must be the same as EvaluateAsInt()... this enforces a minimum level of sanity. llvm-svn: 64865
* Convert isIntegerConstantExpr to use ASTContext::MakeIntValue. Daniel Dunbar2009-02-181-39/+29
| | | | | | | | | | | | | | | - This idiom ensures that the result will have the right width and type. - Tested on most of x86_64/llvm-test to satisfy my paranoia. - This fixes at least the following bugs: o UnaryTypeTraitExpr wasn't setting the width correctly. o Arithmetic on _Bool wasn't setting the width correctly. And probably a number more. llvm-svn: 64864
* Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collideDaniel Dunbar2009-02-173-3/+3
| | | | | | with Expr::Evaluate(). llvm-svn: 64850
* Implement basic parsing and semantic analysis for explicitDouglas Gregor2009-02-172-33/+32
| | | | | | | | | | | | | | | | | | specialization of class templates, e.g., template<typename T> class X; template<> class X<int> { /* blah */ }; Each specialization is a different *Decl node (naturally), and can have different members. We keep track of forward declarations and definitions as for other class/struct/union types. This is only the basic framework: we still have to deal with checking the template headers properly, improving recovery when there are failures, handling nested name specifiers, etc. llvm-svn: 64848
* Eek! getDeclAlign sometimes returned alignment in bits.Daniel Dunbar2009-02-172-4/+4
| | | | | | | | | | | - Renamed to getDeclAlignInBytes since most other query functions work in bits. - Fun to track down as isIntegerConstantExpr was getting it right, but Evaluate() was getting it wrong. Maybe we should assert they compute the same thing when they succeed? llvm-svn: 64828
* Simplified ExtQualType per Chris's feedback.Fariborz Jahanian2009-02-172-8/+5
| | | | llvm-svn: 64820
* Move DeclContext::getParent and getLexicalParent in-line.Argyrios Kyrtzidis2009-02-171-8/+0
| | | | llvm-svn: 64806
* Currently all DeclContexts are Decls as well; use cast<Decl> instead of ↵Argyrios Kyrtzidis2009-02-171-8/+2
| | | | | | dyn_cast. llvm-svn: 64805
* All Decls have a DeclContext now, hooray! Fans of consistency rejoice.Argyrios Kyrtzidis2009-02-171-4/+4
| | | | | | Pass the DeclContext to ObjCIvarDecls as well. llvm-svn: 64801
* Added support for objc's gc attribute in ExtQualType.Fariborz Jahanian2009-02-172-3/+20
| | | | llvm-svn: 64800
* Renamed ASQualType to ExtQualType to reflect its moreFariborz Jahanian2009-02-174-70/+70
| | | | | | | general use; as for, objc2's gc type attributes. No change in functionality. llvm-svn: 64778
* Static variables and functions won't collide with standard libraryDouglas Gregor2009-02-171-0/+4
| | | | | | | functions, so if we're declaring a static we should implicitly declare a library function by the same name (e.g., malloc, strdup). Fixes PR3592. llvm-svn: 64736
* Added ClassTemplateSpecializationDecl, which is a subclass ofDouglas Gregor2009-02-172-3/+39
| | | | | | | | | | | | | | | | | | CXXRecordDecl that is used to represent class template specializations. These are canonical declarations that can refer to either an actual class template specialization in the code, e.g., template<> class vector<bool> { }; or to a template instantiation. However, neither of these features is actually implemented yet, so really we're just using (and uniqing) the declarations to make sure that, e.g., A<int> is a different type from A<float>. Note that we carefully distinguish between what the user wrote in the source code (e.g., "A<FLOAT>") and the semantic entity it represents (e.g., "A<float, int>"); the former is in the sugared Type, the latter is an actual Decl. llvm-svn: 64716
* Unbreak clang.Daniel Dunbar2009-02-161-1/+1
| | | | | | | | Doug: please verify that it is expected that LastIdx can be less that NumInits. And perhaps add a comment so that Chris doesn't break your code. :) llvm-svn: 64688
* fix long lines.Chris Lattner2009-02-163-10/+14
| | | | llvm-svn: 64684
* introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's ↵Chris Lattner2009-02-161-0/+6
| | | | | | suggestion llvm-svn: 64681
* Use isa<...> instead of dyn_cast<...> where result is not needed.Fariborz Jahanian2009-02-161-1/+1
| | | | llvm-svn: 64680
* Supply the header corresponding to a library builtin as a separate argument ↵Douglas Gregor2009-02-161-17/+3
| | | | | | to the LIBBUILTIN macro llvm-svn: 64676
* Fixes a bug in property type encoding.Fariborz Jahanian2009-02-161-1/+2
| | | | llvm-svn: 64672
* Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionallyFariborz Jahanian2009-02-161-16/+0
| | | | | | the same. llvm-svn: 64657
* wrap long lines.Chris Lattner2009-02-161-6/+8
| | | | llvm-svn: 64650
* DeclContext had its "casting machinery" inside the class definition so that ↵Argyrios Kyrtzidis2009-02-161-2/+46
| | | | | | | | if a new declaration context Decl appeared, the necessary changes would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class. llvm-svn: 64630
* Make DeclContexts maintenance a bit easier.Argyrios Kyrtzidis2009-02-161-1/+1
| | | | | | | | | -In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses, it should be marked with DECL_CONTEXT_BASE. -Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions. llvm-svn: 64629
* fix build on systems where uint64_t != unsigned long longChris Lattner2009-02-151-1/+1
| | | | llvm-svn: 64605
* Fix pasto noticed by Anders Johnsen.Daniel Dunbar2009-02-151-2/+2
| | | | llvm-svn: 64595
* Add -ffreestanding to suppress the implicit declaration of library builtins ↵Douglas Gregor2009-02-142-6/+14
| | | | | | like printf and malloc. Fixes PR3586 llvm-svn: 64566
OpenPOWER on IntegriCloud