summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Treat -Wformat=0 as an alias for -Wformat.Hans Wennborg2012-01-171-0/+3
| | | | | | Fixes PR9195. llvm-svn: 148300
* Revert r148271; this requires more thought.Eli Friedman2012-01-171-2/+1
| | | | llvm-svn: 148276
* Change the behavior of the lvalue-to-rvalue conversion for varargs in ↵Eli Friedman2012-01-171-1/+2
| | | | | | | | PotentiallyPotentiallyEvaluated contexts so that we model it in a sane way in most cases, and give up for the edge case which hopefully doesn't matter too much. In preparation for correctly treating sizeof() as a PotentiallyPotentiallyEvaluated context. llvm-svn: 148271
* Improve diagnostics for dangling '}'.Nico Weber2012-01-172-2/+2
| | | | | | Fixes PR6484. Patch from Jason Switzer! llvm-svn: 148270
* Add new line.Tanya Lattner2012-01-161-1/+1
| | | | llvm-svn: 148255
* Add support for OpenCL 1.1 logical operations.Tanya Lattner2012-01-161-0/+9
| | | | llvm-svn: 148254
* Make the auto-detection hack for the iOS simulator set the target triple ↵Eli Friedman2012-01-161-0/+1
| | | | | | correctly. Getting the target triple wrong mostly appears to work, but messes up in subtle cases; for example, we incorrectly conclude that fwrite is actually named fwrite$UNIX2003. Also shuffles around the auto-detection code a bit to try and make it a bit more reliable. Fixes <rdar://problem/10664848>. llvm-svn: 148249
* Another test for 148243 Fariborz Jahanian2012-01-161-0/+22
| | | | | | non-constant-folded-switch containing a constant-folded switch. llvm-svn: 148247
* A little more elaborate test for r148243Fariborz Jahanian2012-01-161-1/+7
| | | | llvm-svn: 148245
* Patch for r148243 which was left behind.Fariborz Jahanian2012-01-161-0/+12
| | | | llvm-svn: 148244
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-164-0/+46
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* When deserializing the definition of a C++ class/ObjC class/ObjCDouglas Gregor2012-01-153-0/+13
| | | | | | | | | | | | | | | protocol, record the definition pointer in the canonical declaration for that entity, and then propagate that definition pointer from the canonical declaration to all other deserialized declarations. This approach works well even when deserializing declarations that didn't know about the original definition, which can occur with modules. A nice bonus from this definition-deserialization approach is that we no longer need update records when a definition is added, because the redeclaration chains ensure that the if any declaration is loaded, the definition will also get loaded. llvm-svn: 148223
* decltype(e) is type-dependent if e is instantiation-dependent. Scary but true.Richard Smith2012-01-151-1/+8
| | | | | | | 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-159-21/+19
| | | | | | | | 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-1/+1
| | | | | | | 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-5/+3
| | | | | | | | 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
* objc: disallow __block attribute on method params.Fariborz Jahanian2012-01-141-0/+12
| | | | llvm-svn: 148197
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-144-1/+198
| | | | | | | | | | | | | | | | | | | | 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-0/+8
| | | | | | data. llvm-svn: 148176
* Remember if a type has its visibility set explicitly or implicitly.Rafael Espindola2012-01-141-5/+24
| | | | | | | | 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
* (Implicit) parameters deserialized as part of a function type must notDouglas Gregor2012-01-132-0/+8
| | | | | | | 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-131-3/+5
| | | | | | | | 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-0/+2
| | | | | | <rdar://problem/10691092>. llvm-svn: 148157
* Convert SemaTemplate*.cpp to pass a callback object to CorrectTypo.Kaelyn Uhrain2012-01-131-1/+10
| | | | | | | | 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-0/+3
| | | | | | | 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-2/+2
| | | | | | | | | | | | | 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
* Revert r148138; it's causing test failures.Eli Friedman2012-01-1371-239/+241
| | | | llvm-svn: 148141
* Convert SemaExprMember.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-132-3/+7
| | | | | | | | | 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
* rename -ccc-host-triple into -targetSebastian Pop2012-01-1371-241/+239
| | | | llvm-svn: 148138
* Reinstate test case accidentally reverted by r148028Douglas Gregor2012-01-131-4/+14
| | | | llvm-svn: 148118
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-1/+1
| | | | llvm-svn: 148117
* PR11754: Reject non-static constexpr member functions in classes with virtualRichard Smith2012-01-131-0/+4
| | | | | | base classes. llvm-svn: 148094
* A base subobject type doesn't make sense for unions; don't try to compute ↵Eli Friedman2012-01-131-6/+3
| | | | | | 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-0/+6
| | | | | | report on cfe-dev. llvm-svn: 148090
* A few minor improvements to error recovery trying to access member of a ↵Eli Friedman2012-01-131-0/+10
| | | | | | 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-131-0/+4
| | | | | | incomplete return type. llvm-svn: 148088
* [analyzer] Unwrap the pointers when ignoring the const cast.Anna Zaks2012-01-131-0/+3
| | | | | | radar://10686991 llvm-svn: 148081
* [analyzer] RegionStoreManager::getBinding() should not crash whenAnna Zaks2012-01-131-0/+4
| | | | | | looking up value at a CodeTextRegion even when the type is not provided. llvm-svn: 148079
* objc parsing. Fixes a crash when parsing array initializationFariborz Jahanian2012-01-131-0/+23
| | | | | | 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-15/+109
| | | | | | | | | | | | | | | | | | | | | | | - 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-0/+11
| | | | | | Original message: Make sure adding a field to a struct never reduces its size. PR11745. llvm-svn: 148070
* Revert r148056 while I investigate failures.Eli Friedman2012-01-121-11/+0
| | | | llvm-svn: 148068
* Make sure adding a field to a struct never reduces its size. PR11745.Eli Friedman2012-01-121-0/+11
| | | | llvm-svn: 148056
* Adjust set of default checkers.Ted Kremenek2012-01-121-1/+0
| | | | llvm-svn: 148055
* Convert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-121-0/+8
| | | | | | improvng the typo correction results in certain situations. llvm-svn: 148052
* objc: do not warn when converting to a const id qualfied by itsFariborz Jahanian2012-01-121-0/+21
| | | | | | list of protools. // rdar://10669694 llvm-svn: 148051
* Convert SemaInit.cpp to pass a callback object to CorrectTypo.Kaelyn Uhrain2012-01-121-0/+12
| | | | | | | And once again improve the typo correction results in certain situations just by moving the existing checks on the correction. llvm-svn: 148037
* [analyzer] fix inlining's handling of mapping actual to formal arguments and ↵Ted Kremenek2012-01-121-0/+30
| | | | | | limit the call stack depth. The analyzer can now accurately simulate factorial for limited depths. llvm-svn: 148036
* constexpr: initialization of a union from an empty initializer-list shouldRichard Smith2012-01-122-0/+26
| | | | | | | | | zero-initialize the first union member. Also fix a bug where initializing an array of types compatible with wchar_t from a wide string literal failed in C, and fortify the C++ tests in this area. This part can't be tested without a code change to enable array evaluation in C (where an existing test fails). llvm-svn: 148035
* scanf: parse the 'm' length modifier, and check that the right argumentsHans Wennborg2012-01-122-3/+24
| | | | | | are used with that and the 'a' length modifier. llvm-svn: 148029
OpenPOWER on IntegriCloud