summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* decltype(e) is type-dependent if e is instantiation-dependent. Scary but true.Richard Smith2012-01-151-1/+4
| | | | | | | Don't consider decltype(e) for an instantiation-dependent, but not type-dependent, e to be non-type-dependent but canonical(!). llvm-svn: 148210
* Pedantic diagnostic correction: in C++, we have integral constant expressions,Richard Smith2012-01-151-9/+8
| | | | | | | | not integer constant expressions. In passing, fix the 'folding is an extension' diagnostic to not claim we're accepting the code, since that's not true in -pedantic-errors mode, and add this diagnostic to -Wgnu. llvm-svn: 148209
* constexpr: casts to void* are allowed in constant expressions, don't set theRichard Smith2012-01-151-3/+3
| | | | | | | designator invalid. (Since we can't read the value of such a pointer, this only affects the quality of diagnostics.) llvm-svn: 148208
* Change linkage computation so it doesn't depend on FunctionDecl::isExternC ↵Eli Friedman2012-01-151-39/+27
| | | | | | | | or VarDecl::isExternC, and instead queries what it actually cares about: whether the given declaration is inside an extern "C" context. Fundamentally, figuring out whether a function/variable uses C linkage requires knowing the linkage, and the logic in FunctionDecl::isExternC and VarDecl::isExternC was getting it wrong. Given that, fix FunctionDecl::isExternC and VarDecl::isExternC to use much simpler implementations that depend on the fixed linkage computation. Fixes a regression to test/SemaCXX/linkage.cpp caused by a new warning exposing the fact that the internal state was wrong. llvm-svn: 148207
* Use a smaller vector than SmallVector.Benjamin Kramer2012-01-142-6/+4
| | | | | | Shrinks OverloadCandidate from 208 to 168 bytes. llvm-svn: 148204
* Clear ImplicitConversionSequence the obvious way which turns out to be less ↵Benjamin Kramer2012-01-141-4/+3
| | | | | | fragile. llvm-svn: 148200
* Give OverloadCandidateSet the responsibility for destroying the implicit ↵Benjamin Kramer2012-01-141-1/+5
| | | | | | conversion sequences so we don't get double frees when the vector reallocates. llvm-svn: 148198
* objc: disallow __block attribute on method params.Fariborz Jahanian2012-01-141-0/+4
| | | | llvm-svn: 148197
* De-virtualize getPreviousDecl() and getMostRecentDecl() when we knowDouglas Gregor2012-01-1417-74/+74
| | | | | | | | | | | | we have a redeclarable type, and only use the new virtual versions (getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have that type information. This keeps us from penalizing users with strict type information (and is the moral equivalent of a "final" method). Plus, settle on the names getPreviousDecl() and getMostRecentDecl() throughout. llvm-svn: 148187
* Pool allocate ImplicitConversionSequences.Benjamin Kramer2012-01-141-9/+10
| | | | | | | | | | | | | | | | To avoid malloc thrashing give OverloadCandidateSet an inline capacity for conversion sequences. We use the fact that OverloadCandidates never outlive the OverloadCandidateSet and have a fixed amount of conversion sequences. This eliminates the oversized SmallVector from OverloadCandidate shrinking it from 752 to 208 bytes. On the test case from the "Why is CLANG++ so freaking slow" thread on llvmdev this avoids one gig of vector reallocation (including memcpy) which translates into 5-10% speedup on Lion/x86_64. Overload candidate computation is still the biggest malloc contributor when compiling templated c++ code. llvm-svn: 148186
* OverloadCandidateSet: Stop exposing SmallVector internalsBenjamin Kramer2012-01-141-22/+9
| | | | | | | Replace push_back with addCandidate which will let us make use of the fixed size of the conversion sequence vector soon. llvm-svn: 148185
* Introduce Decl::getPreviousDecl() and Decl::getMostRecentDecl(),Douglas Gregor2012-01-142-66/+9
| | | | | | | | virtual functions that provide previous/most recent redeclaration information for any declaration. Use this to eliminate the redundant, less efficient getPreviousDecl() functions. llvm-svn: 148184
* Revert accidental commitDouglas Gregor2012-01-141-3/+1
| | | | llvm-svn: 148183
* Add a FIXME for mutation of the common pointer of a ↵Douglas Gregor2012-01-142-2/+8
| | | | | | RedeclarableTemplateDecl. It is not clear that it's worth delaying the allocation of said pointer llvm-svn: 148182
* Reimplement RedeclarableTemplateDecl in terms ofDouglas Gregor2012-01-144-120/+68
| | | | | | | | | | | Redeclarable<RedeclarableTemplateDecl>, eliminating a bunch of redeclaration-chain logic both in RedeclarableTemplateDecl and especially in its (de-)serialization. As part of this, eliminate the RedeclarableTemplate<> class template, which was an abstraction that didn't actually save anything. llvm-svn: 148181
* Remove a redundant word.Zhongxing Xu2012-01-141-1/+1
| | | | llvm-svn: 148179
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-1412-233/+440
| | | | | | | | | | | | | | | | | | | | APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. llvm-svn: 148178
* [analyzer] Taint: add system and popen as undesirable sinks for taintAnna Zaks2012-01-141-20/+77
| | | | | | data. llvm-svn: 148176
* Remember if a type has its visibility set explicitly or implicitly.Rafael Espindola2012-01-142-48/+53
| | | | | | | | With that, centralize the way we merge visibility, always preferring explicit over implicit and then picking the most restrictive one. Fixes pr10113 and pr11690. llvm-svn: 148163
* Fix 80-column violation.Chad Rosier2012-01-141-1/+2
| | | | llvm-svn: 148162
* (Implicit) parameters deserialized as part of a function type must notDouglas Gregor2012-01-131-2/+4
| | | | | | | get added to the identifier chains as part of deserialization, because they should not be visible to name lookup. llvm-svn: 148159
* Progress towards making isUsed() reflect whether a declaration is odr-used; ↵Eli Friedman2012-01-133-12/+3
| | | | | | | | don't set isUsed for local variables which are referenced in unevaluated contexts. Make other code use isReferenced() (which basically indicates that a declaration isn't dead) where appropriate. I was forced to change test/SemaCXX/linkage.cpp because we aren't actually modeling extern "C" in the AST the way that testcase expects; we were not printing a warning only because we skipped the relevant check. Someone who actually understands the semantics here should fix that. llvm-svn: 148158
* Fix a silly mistake in ComplexExprEvaluator::ZeroInitialization. ↵Eli Friedman2012-01-131-1/+1
| | | | | | <rdar://problem/10691092>. llvm-svn: 148157
* Convert SemaTemplate*.cpp to pass a callback object to CorrectTypo.Kaelyn Uhrain2012-01-132-15/+31
| | | | | | | | The change to SemaTemplateVariadic.cpp improves the typo correction results in certain situations, while the change to SemaTemplate.cpp does not change existing behavior. llvm-svn: 148155
* Make sure to consider non-DeclContext scopes properly when findingDouglas Gregor2012-01-131-10/+30
| | | | | | | multiple name lookup results in C/Objective-C. Fixes a regression a caused in r147533, found by Enea Zaffanella! llvm-svn: 148154
* When inferring a module for a framework, first determine whether thatDouglas Gregor2012-01-131-3/+44
| | | | | | | | | | | | | framework is actually a subframework within a top-level framework. If so, only infer a module for the top-level framework and then dig out the appropriate submodule. This helps us cope with an amusing subframeworks anti-pattern, where one uses -F <framework>/Frameworks to get direct include access to the subframeworks of a framework (which otherwise would not be permitted). llvm-svn: 148148
* Move identification of memory setting and copying functions (memset,Anna Zaks2012-01-132-88/+97
| | | | | | | memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic could be reused in the analyzer. llvm-svn: 148142
* Revert r148138; it's causing test failures.Eli Friedman2012-01-132-2/+2
| | | | llvm-svn: 148141
* Convert SemaExprMember.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-131-12/+23
| | | | | | | | | improving the typo correction results in certain situations. This is also the first typo correction callback conversion to affect an existing unit test. :) llvm-svn: 148140
* remove assertions in the Hexagon backend specific clang driverSebastian Pop2012-01-132-51/+40
| | | | | | | | | | | | | | | | | | | Patch from Jyotsna Verma: I have made the changes to remove assertions in the Hexagon backend specific clang driver. Instead of asserting on invalid arch name, it has been modified to use the default value. I have changed the implementation of the CPU flag validation for the Hexagon backend. Earlier, the clang driver performed the check and asserted on invalid inputs. In the new implementation, the driver passes the last CPU flag (or sets to "v4" if not specified) to the compiler (and also to the assembler and linker which perform their own check) instead of asserting on incorrect values. This patch changes the setCPU function for the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the compiler to error out on incorrect CPU flag values. llvm-svn: 148139
* rename -ccc-host-triple into -targetSebastian Pop2012-01-132-2/+2
| | | | llvm-svn: 148138
* rename DefaultHostTriple into DefaultTargetTripleSebastian Pop2012-01-132-11/+11
| | | | llvm-svn: 148137
* Refactor for clarity.Richard Smith2012-01-131-18/+24
| | | | llvm-svn: 148135
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-14/+1
| | | | llvm-svn: 148117
* Remove --hash-style from link command on Android.Evgeniy Stepanov2012-01-131-1/+4
| | | | | | Gnu hash is not supported by the Android loader. llvm-svn: 148113
* PR11754: Reject non-static constexpr member functions in classes with virtualRichard Smith2012-01-131-17/+19
| | | | | | base classes. llvm-svn: 148094
* A base subobject type doesn't make sense for unions; don't try to compute ↵Eli Friedman2012-01-131-1/+1
| | | | | | it. Based on patch by Yin Ma. Fixes PR11751. llvm-svn: 148093
* constexpr is allowed on static member functions of non-literal classes. Per ↵Eli Friedman2012-01-131-1/+1
| | | | | | report on cfe-dev. llvm-svn: 148090
* A few minor improvements to error recovery trying to access member of a ↵Eli Friedman2012-01-131-7/+5
| | | | | | function. In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back. llvm-svn: 148089
* Don't crash while trying to diagnose a function declared at block scope with anRichard Smith2012-01-132-3/+6
| | | | | | incomplete return type. llvm-svn: 148088
* Fix up the calls to CorrectTypo in Sema*ObjC.cpp to use callbackKaelyn Uhrain2012-01-132-48/+81
| | | | | | | objects, and add a basic CorrectionCandidateCallback template class to simplify the fixups. llvm-svn: 148085
* Revert previous commit. Something has gone wonky with my local configurationDouglas Gregor2012-01-131-1/+0
| | | | llvm-svn: 148084
* When inferring a module map for a framework, add the 'private'Douglas Gregor2012-01-131-0/+1
| | | | | | | requirement to headers under PrivateHeaders. We don't want to build them as part of the module (yet). llvm-svn: 148082
* [analyzer] Unwrap the pointers when ignoring the const cast.Anna Zaks2012-01-131-1/+28
| | | | | | radar://10686991 llvm-svn: 148081
* [analyzer] Taint: when looking up a binding, provide the type.Anna Zaks2012-01-131-1/+4
| | | | llvm-svn: 148080
* [analyzer] RegionStoreManager::getBinding() should not crash whenAnna Zaks2012-01-131-2/+6
| | | | | | looking up value at a CodeTextRegion even when the type is not provided. llvm-svn: 148079
* [analyzer] Fix a typo in a warning message.Anna Zaks2012-01-131-1/+1
| | | | llvm-svn: 148078
* objc parsing. Fixes a crash when parsing array initializationFariborz Jahanian2012-01-131-5/+6
| | | | | | inside a class implementation with parse errors. // rdar://10633434 llvm-svn: 148074
* Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:Richard Smith2012-01-126-38/+75
| | | | | | | | | | | | | | | | | | | | | | | - If the declarator is at the start of a line, and the previous line contained another declarator and ended with a comma, then that comma was probably a typo for a semicolon: int n = 0, m = 1, l = 2, // k = 5; myImportantFunctionCall(); // oops! - If removing the parentheses would correctly initialize the object, then produce a note suggesting that fix. - Otherwise, if there is a simple initializer we can suggest which performs value-initialization, then provide a note suggesting a correction to that initializer. Sema::Declarator now tracks the location of the comma prior to the declarator in the declaration, if there is one, to facilitate providing the note. The code to determine an appropriate initializer from the -Wuninitialized warning has been factored out to allow use in both that and -Wvexing-parse. llvm-svn: 148072
* Recommit r148056 with fixes to deal with weirdness with bitfields in unions.Eli Friedman2012-01-121-4/+4
| | | | | | Original message: Make sure adding a field to a struct never reduces its size. PR11745. llvm-svn: 148070
OpenPOWER on IntegriCloud