summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove a fixme which was fixed in a previous commit.Argyrios Kyrtzidis2010-12-061-2/+0
| | | | llvm-svn: 121029
* Use the unused merge() function, fixing an minor, unintended change IDouglas Gregor2010-12-061-9/+5
| | | | | | introduced in r121023. llvm-svn: 121025
* Re-implement caching for the linkage calculation of declarations.Douglas Gregor2010-12-062-33/+85
| | | | | | | | | | | | | | | | | | | | | | My previous attempt at solving the compile-time problem with many redeclarations of the same entity cached both linkage and visibility, while this patch only tackles linkage. There are several reasons for this difference: - Linkage is a language concept, and is evaluated many times during semantic analysis and codegen, while visibility is only a code-generation concept that is evaluated only once per (unique) declaration. Hence, we *must* optimize linkage calculations but don't need to optimize visibility computation. - Once we know the linkage of a declaration, subsequent redeclarations can't change that linkage. Hence, cache invalidation is far simpler than for visibility, where a later redeclaration can completely change the visibility. - We have 3 spare bits in Decl to store the linkage cache, so the cache doesn't increase the size of declarations. With the visibility+linkage cache, NamedDecl got larger. llvm-svn: 121023
* Do unary conversions on vararg arguments and *then* special-case float.John McCall2010-12-061-4/+3
| | | | | | Fixes PR8742. llvm-svn: 121022
* Use Sema's MarkDeclarationReferenced, which takes care of templates, instead ↵Argyrios Kyrtzidis2010-12-061-1/+1
| | | | | | | | of calling Decl's setUsed directly. Thanks to John for the hint! llvm-svn: 121014
* Use the source location of the parameter, when it makes sense, for ↵Argyrios Kyrtzidis2010-12-061-8/+10
| | | | | | diagnostics in HandleCleanupAttr. llvm-svn: 121013
* Revert r120808, my previous implementation of caching for the linkageDouglas Gregor2010-12-064-109/+4
| | | | | | | | | and visibility of declarations, because it was extremely messy and it increased the size of NamedDecl. An improved implementation is forthcoming. llvm-svn: 121012
* Add BlocksAttr assert on __block specificFariborz Jahanian2010-12-061-1/+6
| | | | | | routines. llvm-svn: 121007
* Un-templatetize this method. It's definition is out of line in the .cpp file,Chandler Carruth2010-12-061-54/+52
| | | | | | | | | | | | | so that's not a valid thing to do at all. Instead, switch to a ValueDecl argument, the template isn't really necessary here. When handling the types explicitly in the code, it becomes awkward to cerate the CXXBaseOrMemberInitializer object in so many places. Re-flow the code to calculate the Init expression first, and then create the initializer. If this is too gross, we can factor the init expression logic into helper functions, but it's not past my threshold yet. llvm-svn: 120997
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-0634-118/+111
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* __block variables require us to evaluate the RHS of an assignment beforeJohn McCall2010-12-063-4/+6
| | | | | | | | | | the LHS, or else the pointer might be invalid. This is kindof dumb, but go ahead and make sure we're doing that for l-value scalar assignment, which fixes a miscompile of obj-c++.dg/block-seq.mm. Leave a FIXME for how to solve this problem for agg __blocks. llvm-svn: 120992
* Clarify the logic for when to build an overloaded binop. In particular,John McCall2010-12-062-18/+28
| | | | | | | | | build one when either of the operands calls itself type-dependent; previously we were building when one of the operand types was dependent, which is not always the same thing and which can lead to unfortunate inconsistencies later. Fixes PR8739. llvm-svn: 120990
* Mark SVal constructors 'explicit'.Ted Kremenek2010-12-051-1/+1
| | | | llvm-svn: 120970
* Rename Environment::LookupExpr() toTed Kremenek2010-12-051-1/+10
| | | | | | | Environment::lookupExpr() and move its implementation out-of-line. llvm-svn: 120969
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-057-38/+71
| | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. llvm-svn: 120931
* Add a LayoutBase member function. No functionality change.Anders Carlsson2010-12-041-15/+22
| | | | llvm-svn: 120924
* Replace calls to AppendBytes with calls to AppendPadding when the bytes ↵Anders Carlsson2010-12-041-11/+6
| | | | | | appended are padding. llvm-svn: 120922
* Fix rewriter to match recent changes in property refFariborz Jahanian2010-12-041-3/+11
| | | | | | AST. llvm-svn: 120919
* Silly special case: never load when dereferencing void*.John McCall2010-12-041-1/+5
| | | | llvm-svn: 120905
* First pass at implementing the intent of ANSI C DR106.John McCall2010-12-042-2/+10
| | | | llvm-svn: 120904
* dyn_cast else unreachable -> castJohn McCall2010-12-041-4/+2
| | | | llvm-svn: 120902
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-0413-102/+107
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Don't crash when initializing a subaggregate in C from a property r-value.John McCall2010-12-041-0/+1
| | | | llvm-svn: 120899
* Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().John McCall2010-12-041-3/+11
| | | | | | Abramo noticed this. llvm-svn: 120898
* Silence "comparison between signed and unsigned integer expressions" warnings.Benjamin Kramer2010-12-041-4/+4
| | | | llvm-svn: 120897
* Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall2010-12-044-84/+79
| | | | | | | be required, and then fix up some missing loads on overloaded-operator paths which that exposed. llvm-svn: 120896
* When deciding whether to complain about the type of a boolean condition, useJohn McCall2010-12-041-2/+2
| | | | | | the type of the expression *after* array/function decay. llvm-svn: 120895
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-0420-105/+346
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Test case for the l-value base only being evaluated once.John McCall2010-12-043-64/+43
| | | | | | | | | | Also, move the l-value emission code into CGObjC.cpp and teach it, for completeness, to store away self for a super send. Also, inline the super cases for property gets and sets and make them use the correct result type for implicit getter/setter calls. llvm-svn: 120887
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-048-140/+62
| | | | | | the l-value. llvm-svn: 120884
* Implement -cl-std=Peter Collingbourne2010-12-041-0/+7
| | | | llvm-svn: 120882
* Implement -cl-mad-enablePeter Collingbourne2010-12-042-0/+2
| | | | llvm-svn: 120881
* Implement -cl-fast-relaxed-mathPeter Collingbourne2010-12-042-2/+8
| | | | llvm-svn: 120880
* Implement -cl-unsafe-math-optimizationsPeter Collingbourne2010-12-042-0/+2
| | | | llvm-svn: 120879
* Implement -cl-finite-math-onlyPeter Collingbourne2010-12-042-0/+3
| | | | llvm-svn: 120878
* Implement -cl-single-precision-constantPeter Collingbourne2010-12-042-0/+4
| | | | llvm-svn: 120877
* Implement -cl-opt-disablePeter Collingbourne2010-12-041-1/+5
| | | | llvm-svn: 120876
* Refactor optimisation level codePeter Collingbourne2010-12-041-14/+16
| | | | llvm-svn: 120875
* Introduce CompilerInvocation::setLangDefaults functionPeter Collingbourne2010-12-041-23/+33
| | | | | | | | | | | This patch refactors the CompilerInvocation code to introduce a CompilerInvocation::setLangDefaults function, which can set up a LangOptions with the defaults for a given language and language standard. This function is useful for non-command line based Clang clients which need to set up a CompilerInvocation manually for a specific language. llvm-svn: 120874
* Minor refactoring; have BugReport::getRanges return a pair of iterator, no ↵Argyrios Kyrtzidis2010-12-042-13/+13
| | | | | | functionality change. llvm-svn: 120873
* Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293Argyrios Kyrtzidis2010-12-041-0/+1
| | | | llvm-svn: 120872
* Diagnose when accessing property in a class method andFariborz Jahanian2010-12-033-8/+11
| | | | | | | no property accessor class method to be found, instead of crashing in IRGen. // rdar://8703553 llvm-svn: 120855
* Fixed typo.Abramo Bagnara2010-12-031-1/+1
| | | | llvm-svn: 120839
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-0310-18/+30
| | | | llvm-svn: 120828
* Add support for vmul_p8 Neon intrinsic. Radar 8446141.Bob Wilson2010-12-031-0/+4
| | | | llvm-svn: 120812
* Implement caching for the linkage and visibility calculations ofDouglas Gregor2010-12-034-4/+109
| | | | | | | | | | | | | | | | | | | | | | | | | declarations. The motivation for this patch is that linkage/visibility computations are linear in the number of redeclarations of an entity, and we've run into a case where a single translation unit has > 6500 redeclarations of the same (unused!) external variable. Since each redeclaration involves a linkage check, the resulting quadratic behavior makes Clang slow to a crawl. With this change, a simple test with 512 redeclarations of a variable syntax-checks ~20x faster than before. That said, I hate this change, and will probably end up reverting it in a few hours. Reasons to hate it: - It makes NamedDecl larger, since we don't have enough free bits in Decl to squeeze in the extra information about caching. - There are way too many places where we need to invalidate this cache, because the visibility of a declaration can change due to redeclarations (!). Despite self-hosting and passing the testsuite, I have no confidence that I've found all of places where this cache needs to be invalidated. llvm-svn: 120808
* Add a separate rightShift flag instead of reusing the existing "poly" variableBob Wilson2010-12-031-2/+3
| | | | | | to distinguish vsri/vsli. llvm-svn: 120806
* Add some warning messages about invalid use of common/nocommon attributes.Eric Christopher2010-12-031-2/+10
| | | | llvm-svn: 120799
* Fix an insidious bug in BugReporter whereTed Kremenek2010-12-031-54/+54
| | | | | | | | | a node in the trimmed graph might not always correctly map back to the original error node. This could cause a crash in some cases when flagging memory leaks. llvm-svn: 120795
* Also include the pointer address of the ExplodedNodeTed Kremenek2010-12-031-3/+2
| | | | | | when generating DOT output for an ExplodedGraph. llvm-svn: 120794
OpenPOWER on IntegriCloud