summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Handle bracket insertion for Objective-C class messages in a veryDouglas Gregor2010-09-152-1/+2
| | | | | | | | | | | | | narrow, almost useless case where we're inside a parenthesized expression, e.g., (NSArray alloc]) The solution to the general case still eludes me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114039 91177308-0d34-0410-b5e6-96231b3b80d8
* While handling change of file, check if _current_ file is already seen or ↵Devang Patel2010-09-151-0/+15
| | | | | | | | | not. If current file is seen then it indicates that end of previous file's lexical scope. This fixes radar 8396182. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114018 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Clean up in buildbot directories."Jakob Stoklund Olesen2010-09-151-1/+0
| | | | | | | | | This reverts commit 113814. This patch was never intended to stay in the repository. If you are reading this from the future, we apologize for the noise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113990 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve code completion for Objective-C message sends when the openingDouglas Gregor2010-09-152-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | '[' is missing. Prior commits improving recovery also improved code completion beyond the first selector, e.g., at or after the "to" in calculator add:x to:y but not after "calculator". We now provide the same completions for calculator <CC> that we would for [calculator <CC> if "calculator" is an expression whose type is something that can receive Objective-C messages. This code completion works for instance and super message sends, but not class message sends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113976 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend bracket insertion to message sends to "super", e.g.,Douglas Gregor2010-09-151-0/+14
| | | | | | | | | | super method:arg] will now recover nicely and insert the '[' before 'super'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113971 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend bracket insertion to handle nullary selectors, e.g.Douglas Gregor2010-09-151-0/+2
| | | | | | | | | a getFoo] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113969 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | part of parser recovery. For example, given: a method1:arg]; we detect after parsing the expression "a" that we have the start of a message send expression. We pretend we've seen a '[' prior to the a, then parse the remainder as a message send. We'll then give a diagnostic+fix-it such as: fixit-objc-message.m:17:3: error: missing '[' at start of message send expression a method1:arg]; ^ [ The algorithm here is very simple, and always assumes that the open bracket goes at the beginning of the message send. It also only works for non-super instance message sends at this time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113968 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak regex not to accidentally match a trailing \r.Benjamin Kramer2010-09-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113966 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pointer-signext.c test case: it was relying on value names, which don't ↵Cameron Esfahani2010-09-151-3/+3
| | | | | | appear in the non-assert build. Switch to using check-next as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113964 91177308-0d34-0410-b5e6-96231b3b80d8
* Test hardening.John McCall2010-09-151-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113963 91177308-0d34-0410-b5e6-96231b3b80d8
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-152-2/+106
| | | | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax assertion in CFG builder when processing ForStmts. This fixes an ↵Ted Kremenek2010-09-151-0/+6
| | | | | | | | assertion failure on code containing GNU statement expressions reported in PR 8141. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113953 91177308-0d34-0410-b5e6-96231b3b80d8
* Disallow the use of UnknownVal as the index for ElementRegions. UnknownVals ↵Ted Kremenek2010-09-151-0/+30
| | | | | | | | | | | | | | | | | can be used as the index when the value evaluation isn't powerful enough. By creating ElementRegions with UnknownVals as the index, this gives the false impression that they are the same element, when they really aren't. This becomes really problematic when deriving symbols from these regions (e.g., those representing the initial value of the index), since two different indices will get the same symbol for their binding. This fixes an issue with the idempotent operations checker that would cause two indices that are clearly not the same to make it appear as if they always had the same value. Fixes <rdar://problem/8431728>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113920 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Windows64 target info so pointer arithmetic is done correctly, and no ↵Cameron Esfahani2010-09-151-0/+32
| | | | | | sign extension code is emitted: PtrDiffType needs to be a signed long long. Add a corresponding test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113910 91177308-0d34-0410-b5e6-96231b3b80d8
* Microsoft's flexible array rules relaxation:Francois Pichet2010-09-151-0/+21
| | | | | | | - in union - as the only element of a struct/class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113909 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new code-completion context for a parenthesizedDouglas Gregor2010-09-141-0/+16
| | | | | | | | | expression, e.g., after the '(' that could also be a type cast. Here, we provide types as code-completion results in C/Objective-C (C++ already had them), although we wouldn't in a normal expression context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113904 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix destructor and assignment operator lookup in the has_nothrow traits.Sebastian Redl2010-09-141-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113897 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't divide-by-zero in RegionStoreManager::getSizeInElements() when getting ↵Ted Kremenek2010-09-141-0/+27
| | | | | | | | the size of a VLA. We don't track VLA extents yet, but we should at least not crash. Fixes <rdar://problem/8424269>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113888 91177308-0d34-0410-b5e6-96231b3b80d8
* RHS of property expression assignment requiresFariborz Jahanian2010-09-141-0/+34
| | | | | | | | copy initialization before passing it to a setter. Fixes radar 8427922. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113885 91177308-0d34-0410-b5e6-96231b3b80d8
* When marking the declarations in a default argument expression asDouglas Gregor2010-09-141-0/+22
| | | | | | | | | | "used", at the time that the default argument itself is used, also mark destructors that will be called by this expression. This fixes a regression that I introduced in r113700, which broke WebKit, and fixes <rdar://problem/8427926>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
* The paired 'operator delete' for a placement 'operator new' is always aJohn McCall2010-09-141-0/+18
| | | | | | | | | placement 'operator delete', even if there are no placement args (i.e. overload resolution selected an operator new with default arguments). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113861 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the EH cleanup to call 'operator delete' if a new-expression throwsJohn McCall2010-09-141-13/+205
| | | | | | | | (but not if destructors associated with the full-expression throw). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113836 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix CFGBuilder crash reported in PR 8141.Ted Kremenek2010-09-141-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113826 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VLA miscompilation.Argyrios Kyrtzidis2010-09-141-1/+16
| | | | | | | llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes. Fixes r8403108. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113822 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up in buildbot directories.Jakob Stoklund Olesen2010-09-131-0/+1
| | | | | | | | This test created a statements.ll file until about a month ago. Some buildbots still have this file in their source dir. This is the easiest way to remove the file on all bots. Then I'll revert. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113814 91177308-0d34-0410-b5e6-96231b3b80d8
* Add __char16_t and __char32_t as aliases for the C++0x char16_t andDouglas Gregor2010-09-132-1/+5
| | | | | | | | | char32_t, respectively, but which can also be used in C++98/03 mode. Fixes <rdar://problem/8418510>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113813 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new kind of cursor into libclang, which covers a referenceDouglas Gregor2010-09-134-3/+24
| | | | | | | | | | to an "overloaded" set of declarations. This cursor kind works for unresolved references to functions/templates (e.g., a call within a template), using declarations, and Objective-C class and protocol forward declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113805 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash when using type traits on a class with a constructor template.Sebastian Redl2010-09-131-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113796 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function ↵Sebastian Redl2010-09-131-0/+1
| | | | | | due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to get this to stop leaving a temporary file on linux.Eric Christopher2010-09-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113793 91177308-0d34-0410-b5e6-96231b3b80d8
* Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem ↵Sebastian Redl2010-09-131-0/+1
| | | | | | with not finding implicitly declared copy constructors, part of PR8107. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113784 91177308-0d34-0410-b5e6-96231b3b80d8
* Recognize .ll as input files.Devang Patel2010-09-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle %test_debuginfo on a RUN command line. This set up now allows one to write small test cases to check debug info. e.g. ; RUN: %clang -O0 -g %s -c -o %t.o ; RUN: %clang %t.o -o %t.out ; RUN: %test_debuginfo %s %t.out define i32 @f1(i32 %i) nounwind ssp { ; DEBUGGER: break f1 ; DEBUGGER: r ; DEBUGGER: p i ; CHECK: $1 = 42 entry: %i.addr = alloca i32, align 4 ... ... } It is also possible now to write test cases in c/c++. The plan is to store these debug info testcases in a separate place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113780 91177308-0d34-0410-b5e6-96231b3b80d8
* When applying 'delete' on a pointer-to-array type match GCC and EDG behavior ↵Argyrios Kyrtzidis2010-09-132-0/+16
| | | | | | | | and treat it as 'delete[]'. Also offer a fix-it hint adding '[]'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
* Block description for trivial block literals haveFariborz Jahanian2010-09-131-0/+8
| | | | | | | | their 'isa' field scanned regardless. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113749 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix C++ PCH issue.Argyrios Kyrtzidis2010-09-131-0/+5
| | | | | | | | The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing. Write and read it from PCH. Fixes http://llvm.org/PR8134 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113744 91177308-0d34-0410-b5e6-96231b3b80d8
* Congruent diagnostic for void* arithmetic.Abramo Bagnara2010-09-132-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
* Parentheses around address non-type template argument is demoted to an ↵Abramo Bagnara2010-09-132-2/+2
| | | | | | extension warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113739 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assert when attempting to take the address of an overloadedDouglas Gregor2010-09-121-0/+8
| | | | | | | | function fails due to ambiguities in partial ordering of function templates. Fixes PR8033. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113725 91177308-0d34-0410-b5e6-96231b3b80d8
* When performing overload resolution, only compare the final conversionDouglas Gregor2010-09-121-0/+10
| | | | | | | | sequences for two conversion functions when in fact we are in the text of initialization by a user-defined conversion sequences. Fixes PR8034. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113724 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose the instantiation of variables (including static dataDouglas Gregor2010-09-121-0/+12
| | | | | | | members) with function type. Fixes PR8047. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113723 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't complain about useless user-defined conversion functions whenDouglas Gregor2010-09-121-0/+18
| | | | | | | | they were instantiated from a template. In template metaprogramming, stuff happens. Fixes PR8065. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113722 91177308-0d34-0410-b5e6-96231b3b80d8
* When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade theDouglas Gregor2010-09-124-9/+248
| | | | | | | | | | | | error to a warning if we're in a case that would be allowed in C++0x. This "fixes" PR8084 by making Clang accept more code than GCC and (non-strict) EDG do. Also, add the missing test case for the C++0x semantics, which should have been in r113717. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113718 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic support for Microsoft enum forward declaration. Francois Pichet2010-09-121-0/+4
| | | | | | Assigning an underlying integral type to an enum forward declaration will come in a next patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113716 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the "note" in C++ [over.built]p1, which is actually meant toDouglas Gregor2010-09-121-0/+16
| | | | | | | | | be a semantic requirement that a built-in overloaded operator is not added to the overload set of there is already a user-defined overloaded operator with the same parameter types. Fixes PR8087. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113713 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't perform integral promotions from an incompletion enumerationDouglas Gregor2010-09-121-0/+5
| | | | | | | type. Fixes PR8089 in a slightly different way than had been suggested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113711 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the EvaluatedExprVisitor and its client, which marksDouglas Gregor2010-09-111-0/+18
| | | | | | | | | declarations in potentially-evaluated subexpressions, about recursion. Fixes the release-mode self-host failure I introduced in r113700. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113708 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix last test still failing on Win32. 100% pass rate now!Francois Pichet2010-09-111-11/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113702 91177308-0d34-0410-b5e6-96231b3b80d8
* When parsing default function arguments, do not mark any declarationsDouglas Gregor2010-09-111-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | used in the default function argument as "used". Instead, when we actually use the default argument, make another pass over the expression to mark any used declarations as "used" at that point. This addresses two kinds of related problems: 1) We were marking some declarations "used" that shouldn't be, because we were marking them too eagerly. 2) We were failing to mark some declarations as "used" when we should, if the first time it was instantiated happened to be an unevaluated context, we wouldn't mark them again at a later point. I've also added a potentially-handy visitor class template EvaluatedExprVisitor, which only visits the potentially-evaluated subexpressions of an expression. I bet this would have been useful for noexcept... Fixes PR5810 and PR8127. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113700 91177308-0d34-0410-b5e6-96231b3b80d8
* The two libclang crash-recovery tests that involve precompiledDouglas Gregor2010-09-112-2/+4
| | | | | | | | | | | preambles end up leaving the precompiled preambles around. This is by design, since we do minimal cleanup during crash recovery. However, it's unfortunate for testing, so introduce a hook that allows these two tests to put the precompiled preamble somewhere where we can delete them after testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113698 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak GetPreamblePCHPath() to more closely match the behavior of theDouglas Gregor2010-09-111-1/+1
| | | | | | | | | Windows GetTempPath() function, and be sure to create the directory in which the precompiled preamble will reside before creating the temporary file itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113695 91177308-0d34-0410-b5e6-96231b3b80d8