summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix a crash triggered by printing a note on a default argumentAnna Zaks2013-05-071-0/+230
| | | | | | Instead, use the location of the call to print the note. llvm-svn: 181337
* Weaken an assertion in memcpyization to account forJohn McCall2013-05-071-0/+41
| | | | | | | | | | | unnamed bitfields. Unnamed bitfields won't have an explicit copy operation in the AST, which breaks the strong form of the invariant. rdar://13816940 llvm-svn: 181289
* C++1y constant expression evaluation: support for compound assignments on ↵Richard Smith2013-05-071-3/+55
| | | | | | integers. llvm-svn: 181287
* Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the ↵Argyrios Kyrtzidis2013-05-072-0/+3
| | | | | | | | | | | FileID. This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location when the the FileID is for an empty file. rdar://13803893 llvm-svn: 181285
* C++1y: an assignment operator is implicitly 'constexpr' if it would only ↵Richard Smith2013-05-072-0/+55
| | | | | | call 'constexpr' assignment operators for a literal class type. llvm-svn: 181284
* DebugInfo: Support imported modules (using directives) within lexical blocks.David Blaikie2013-05-061-5/+11
| | | | llvm-svn: 181272
* Grab-bag of bit-field fixes:John McCall2013-05-065-4/+90
| | | | | | | | | | | | | | - References to ObjC bit-field ivars are bit-field lvalues; fixes rdar://13794269, which got me started down this. - Introduce Expr::refersToBitField, switch a couple users to it where semantically important, and comment the difference between this and the existing API. - Discourage Expr::getBitField by making it a bit longer and less general-sounding. - Lock down on const_casts of bit-field gl-values until we hear back from the committee as to whether they're allowed. llvm-svn: 181252
* Have the RecursiveASTVisitor traverse the type source info of an objc class ↵Argyrios Kyrtzidis2013-05-061-0/+9
| | | | | | message. llvm-svn: 181237
* [analyzer] Handle CXXTemporaryObjectExprs in compound literals.Jordan Rose2013-05-061-1/+34
| | | | | | | | | | | | This occurs because in C++11 the compound literal syntax can trigger a constructor call via list-initialization. That is, "Point{x, y}" and "(Point){x, y}" end up being equivalent. If this occurs, the inner CXXConstructExpr will have already handled the object construction; the CompoundLiteralExpr just needs to propagate that value forwards. <rdar://problem/13804098> llvm-svn: 181213
* Fix representation of compound literals for C++ objects with destructors.Jordan Rose2013-05-061-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this compound literal expression (a GNU extension in C++): (AggregateWithDtor){1, 2} resulted in this AST: `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...]) `-CompoundLiteralExpr [...] 'struct AggregateWithDtor' `-CXXBindTemporaryExpr [...] 'struct AggregateWithDtor' (CXXTemporary [...]) `-InitListExpr [...] 'struct AggregateWithDtor' |-IntegerLiteral [...] 'int' 1 `-IntegerLiteral [...] 'int' 2 Note the two CXXBindTemporaryExprs. The InitListExpr is really part of the CompoundLiteralExpr, not an object in its own right. By introducing a new entity initialization kind in Sema specifically for compound literals, we avoid the treatment of the inner InitListExpr as a temporary. `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...]) `-CompoundLiteralExpr [...] 'struct AggregateWithDtor' `-InitListExpr [...] 'struct AggregateWithDtor' |-IntegerLiteral [...] 'int' 1 `-IntegerLiteral [...] 'int' 2 llvm-svn: 181212
* Add SystemZ supportUlrich Weigand2013-05-065-3/+341
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181211
* R600: Update GPU variants in -mcpu optionTom Stellard2013-05-061-6/+8
| | | | | | | | We've added the RS880 variant in the LLVM backend to represent an R600 GPU with no vertex cache, so we need to update the GPU mappings for -mcpu. llvm-svn: 181202
* Remove forward slashes from check; should unbreak Windows buildbots.Douglas Gregor2013-05-061-1/+1
| | | | llvm-svn: 181199
* Require the containing type to be complete when we seeJohn McCall2013-05-061-0/+52
| | | | | | | | | | | | __alignof__ of a field. This problem can only happen in C++11. Also do some petty optimizations. rdar://13784901 llvm-svn: 181185
* C++1y: support range-based for loops in constant expressions.Richard Smith2013-05-061-0/+54
| | | | llvm-svn: 181184
* C++1y: support 'for', 'while', and 'do ... while' in constant expressions.Richard Smith2013-05-063-32/+71
| | | | llvm-svn: 181181
* Fix assert if __extension__ or _Generic is used when initializing a char ↵Richard Smith2013-05-061-1/+1
| | | | | | array from a string literal. llvm-svn: 181174
* C++1y: support for increment and decrement in constant expression evaluation.Richard Smith2013-05-052-8/+74
| | | | llvm-svn: 181173
* Factor out duplication between lvalue-to-rvalue conversions and variableRichard Smith2013-05-052-4/+11
| | | | | | | assignments in constant expressions. No significant functionality changes (slight improvement to potential constant expression checking). llvm-svn: 181170
* Use lexical contexts when checking for conflicting language linkages.Rafael Espindola2013-05-051-0/+8
| | | | | | | This fixes pr14958. I will audit other calls to isExternCContext to see if there are any similar bugs left. llvm-svn: 181163
* Handle parens properly when initializing a char array from a string literal.Richard Smith2013-05-052-0/+15
| | | | llvm-svn: 181159
* Properly parsing __declspec(safebuffers), though there is no semantic ↵Aaron Ballman2013-05-041-1/+1
| | | | | | hookup. For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx llvm-svn: 181123
* Reverting r181004 since it has broken test/Sema/wchar.c.Aaron Ballman2013-05-042-24/+0
| | | | llvm-svn: 181122
* Moved pretty printer test for thread local storage in its own fileEnea Zaffanella2013-05-042-7/+9
| | | | | | and specified the triple. llvm-svn: 181115
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-041-0/+9
| | | | llvm-svn: 181113
* AArch64: teach Clang about __clear_cache intrinsicTim Northover2013-05-042-0/+22
| | | | | | | libgcc provides a __clear_cache intrinsic on AArch64, much like it does on 32-bit ARM. llvm-svn: 181111
* Implement most of N3638 (return type deduction for normal functions).Richard Smith2013-05-043-1/+401
| | | | | | | Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. llvm-svn: 181108
* Don't build a call expression referring to a function which we're not allowedRichard Smith2013-05-041-1/+3
| | | | | | | | | to use. This makes very little difference right now (other than suppressing follow-on errors in some cases), but will matter more once we support deduced return types (we don't want expressions with undeduced return types in the AST). llvm-svn: 181107
* Say 'decltype(auto)' not 'auto' as appropriate in mismatched-deduction ↵Richard Smith2013-05-041-0/+4
| | | | | | diagnostic. llvm-svn: 181103
* Implement template support for CapturedStmtWei Pan2013-05-041-0/+114
| | | | | | | | - Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 llvm-svn: 181101
* Separate out and special-case the diagnostic for 'auto' in aRichard Smith2013-05-042-2/+2
| | | | | | | conversion-type-id, in preparation for this becoming valid in c++1y mode. No functionality change; small diagnostic improvement. llvm-svn: 181089
* <rdar://problem/13806270> A template argument list is a constant-evaluated ↵Douglas Gregor2013-05-031-0/+9
| | | | | | context. llvm-svn: 181076
* Revert r177218.Argyrios Kyrtzidis2013-05-031-3/+2
| | | | | | Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. llvm-svn: 181073
* [Doc parsing] Provide diagnostics for unknown documentation Fariborz Jahanian2013-05-032-1/+2
| | | | | | commands. // rdar://12381408 llvm-svn: 181071
* When building a module, forward diagnostics to the outer diagnostic consumer.Douglas Gregor2013-05-035-2/+46
| | | | | | | | | | | | | | | Previously, we would clone the current diagnostic consumer to produce a new diagnostic consumer to use when building a module. The problem here is that we end up losing diagnostics for important diagnostic consumers, such as serialized diagnostics (where we'd end up with two diagnostic consumers writing the same output file). With forwarding, the diagnostics from all of the different modules being built get forwarded to the one serialized-diagnostic consumer and are emitted in a sane way. Fixes <rdar://problem/13663996>. llvm-svn: 181067
* Reapply r180982 with repaired logic and an additional testcase.Adrian Prantl2013-05-032-0/+41
| | | | | | | | | | | | | | Un-break the gdb buildbot. - Use the debug location of the return expression for the cleanup code if the return expression is trivially evaluatable, regardless of the number of stop points in the function. - Ensure that any EH code in the cleanup still gets the line number of the closing } of the lexical scope. - Added a testcase with EH in the cleanup. rdar://problem/13442648 llvm-svn: 181056
* Serialization for captured statementsBen Langmuir2013-05-031-0/+42
| | | | | | | | | | | Add serialization for captured statements and captured decls. Also add a const_capture_iterator to CapturedStmt. Test contributed by Wei Pan Differential Revision: http://llvm-reviews.chandlerc.com/D727 llvm-svn: 181048
* PR15906: The body of a lambda is not an evaluated subexpression; don't visit ↵Richard Smith2013-05-031-0/+12
| | | | | | it when visiting such subexpressions. llvm-svn: 181046
* Add support for -march=btver2.Benjamin Kramer2013-05-031-0/+46
| | | | llvm-svn: 181006
* Support __wchar_t in -fms-extensions and -fms-compatibility modes.Hans Wennborg2013-05-032-0/+24
| | | | | | | | | | | | | | MSVC provides __wchar_t, either as an alias for the built-in wchar_t type, or as a separate type depending on language (C vs C++) and flags (-fno-wchar). In -fms-extensions, Clang will simply accept __wchar_t as an alias for whatever type is used for wide character literals. In -fms-compatibility, we try to mimic MSVC's behavior by always making __wchar_t a builtin type. This fixes PR15815. llvm-svn: 181004
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-033-4/+24
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* [analyzer] Check the stack frame when looking for a var's initialization.Jordan Rose2013-05-031-0/+21
| | | | | | | | | | | | | FindLastStoreBRVisitor is responsible for finding where a particular region gets its value; if the region is a VarRegion, it's possible that value was assigned at initialization, i.e. at its DeclStmt. However, if a function is called recursively, the same DeclStmt may be evaluated multiple times in multiple stack frames. FindLastStoreBRVisitor was not taking this into account and just picking the first one it saw. <rdar://problem/13787723> llvm-svn: 180997
* [analyzer] Fix trackNullOrUndef when tracking args that have nil receivers.Jordan Rose2013-05-032-0/+380
| | | | | | | | | | | | | | | There were actually two bugs here: - if we decided to look for an interesting lvalue or call expression, we wouldn't go find its node if we also knew we were at a (different) call. - if we looked through one message send with a nil receiver, we thought we were still looking at an argument to the original call. Put together, this kept us from being able to track the right values, which means sub-par diagnostics and worse false-positive suppression. Noticed by inspection. llvm-svn: 180996
* Revert "Attempt to un-break the gdb buildbot."Adrian Prantl2013-05-031-24/+0
| | | | | | This reverts commit 180982. llvm-svn: 180990
* [ms-cxxabi] Emit non-virtual member function pointersReid Kleckner2013-05-031-4/+55
| | | | | | | | | | | | | | Without any conversion, this is pretty straightforward. Most of the fields can be zeros. The order is: - field offset or pointer - nonvirtual adjustment (for MI functions) - vbptr offset (for unspecified) - virtual adjustment offset (for virtual inheritance) Differential Revision: http://llvm-reviews.chandlerc.com/D699 llvm-svn: 180985
* Attempt to un-break the gdb buildbot.Adrian Prantl2013-05-031-0/+24
| | | | | | | | | | | | | - Use the debug location of the return expression for the cleanup code if the return expression is trivially evaluatable, regardless of the number of stop points in the function. - Ensure that any EH code in the cleanup still gets the line number of the closing } of the lexical scope. - Added a testcase with EH in the cleanup. rdar://problem/13442648 llvm-svn: 180982
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-15/+62
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-022-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180973
* Revert r180970; it's causing breakage.Douglas Gregor2013-05-022-22/+2
| | | | llvm-svn: 180972
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-022-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180970
OpenPOWER on IntegriCloud