Граф коммитов

4951 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 131c981d63 And now a test fix in +Asserts mode, which I broke.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:48:34 +00:00
Daniel Dunbar 47d1e82867 Fix some tests in -Asserts mode.
- FileCheck is a *huuuuge* improvement here.

 - Still feels like we could use a better tool for this though, either teach
   llvm-dis to spit out the FileCheck syntax, or provide another tool to turn a
   .ll into a "matchable" input.

 - Also on my Christmas list is better FileCheck diagnostics with missing
   variables or mismatches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:48:26 +00:00
John McCall a52ef08b26 Apparently the following idiom is specifically encouraged:
if (self = [super init])
Recognize it and only warn if -Wparentheses is explicitly enabled.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 02:41:58 +00:00
Douglas Gregor 788cd06cf8 Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames. 

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
  - the inability to use dependent template names as template template
  arguments
  - template template parameter default arguments cannot be
  instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:00:40 +00:00
John McCall f7f3d0db75 Create a new Scope when parsing a declaration with a C++ scope specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:21:18 +00:00
Fariborz Jahanian b03bfa55d0 Diagnose illegally typed operator new/new[].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:47:18 +00:00
Eli Friedman 7f1de456fe Fix for PR5454: make sure to use the right block as the predecessor in the
generated PHI node for the null check of a new operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:39:09 +00:00
Ted Kremenek dfcaf060d5 Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses <rdar://problem/7381735>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:16:29 +00:00
Fariborz Jahanian 88f4280f6b This patch implements Code gen. for destruction of
global array of objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 19:24:06 +00:00
John McCall 12ea5780e7 Make a somewhat more convincing test case for unqualified lookup through
using directives, and fix a bug thereby exposed:  since we're playing
tricks with pointers, we need to make certain we're always using the same 
pointers for things.
Also tweak an existing error message.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 09:20:04 +00:00
John McCall cdc89c485c Simple test case for [basic.lookup.udir].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:56:40 +00:00
John McCall d7be78a052 Fix unqualified lookup through using directives.
This is a pretty minimal test case;  I'll make a better one later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:01:13 +00:00
Anders Carlsson b76cd3d0c1 When trying to assign a regular string literal to an Objective-C 'id' type or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:
@class NSString;

@interface Test
+ (void)test:(NSString *)string;
@end

void g(NSString *a);

void f() {
  NSString *a = "Foo";
  g("Foo");
  [Test test:"Foo"];
}

will produce

t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
  NSString *a = "Foo";
                ^~~~~
                @
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
  g("Foo");
    ^~~~~
    @
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
  [Test test:"Foo"];
             ^~~~~
             @
3 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 04:46:30 +00:00
Anders Carlsson ad26b7376b If a function with a default argument is redefined and the new function also has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 03:24:44 +00:00
Zhongxing Xu 79234ca446 Add test case for PointerSubChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:45:49 +00:00
Zhongxing Xu adca27102f Refine PointerSubChecker: compare the base region instead of the original
region, so that arithmetic within a memory chunk is allowed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 02:37:53 +00:00
Mike Stump 3ada2df426 Enable the use of the new llvm objectsize intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86607 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:40:09 +00:00
Fariborz Jahanian 3451e9282a Changed error for nested type qualifier mismatch to
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 22:16:37 +00:00
Douglas Gregor ff4393c1ce Make sure that we look into nested, transparent declaration contexts
when looking for a name within a given DeclContext. Now enumerators
will show up in code-completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 21:35:27 +00:00
Fariborz Jahanian d411b3f746 For array pointee type, get its cvr qualifier from
its element type. Fixes pr5432.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 21:02:05 +00:00
Douglas Gregor d47c47d65e Make sure that we instantiate default function arguments for an
overloaded operator(). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:27:57 +00:00
Eli Friedman 80c30dad6c Add additional note to mark the cause of synthesized constructors. Mark
declaration invalid if the constructor can't be properly built.  Addresses
remaining review comments from Fariborz for r86500.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:20:36 +00:00
Douglas Gregor 0f8716b7bb Improve instantiation of default template arguments for nested
templates. The instantiation of these default arguments must be (and
now, is) delayed until the template argument is actually used, at
which point we substitute all levels of template arguments
concurrently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:17:50 +00:00
Eli Friedman d49c7b61d9 Add code generation test for r86500.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:49:09 +00:00
Fariborz Jahanian 8875334f78 Test case for Sean Hunt's patch which I left out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:48:53 +00:00
Eli Friedman 8f4c59e912 Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:38:53 +00:00
Douglas Gregor 11a82401ea Slightly more testing for instantiation of non-type template parameters in nested templates, for my own sanity's sake
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 18:29:00 +00:00
Anders Carlsson a23dcce1d0 Add a triple to try to fix the buildbot error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:54:53 +00:00
Anders Carlsson 1c03ca30ae __uint128_t is indeed an unsigned integer type. Fixes PR5435.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 17:34:18 +00:00
Douglas Gregor 4bb2c284f5 Simplify test to deal with type-based ordering variations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 16:22:45 +00:00
Douglas Gregor ac06a7ca22 Verify that code-completion is at least a little bit robust against inclusion of missing headers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 16:06:30 +00:00
Douglas Gregor 3ac738567f Minor cleanup for CIndex-based code-completion:
- Provide an actual test for code-completion via CIndex. 
  - Actually print optional strings in c-index-test
  - Export clang_getCompletionChunkCompletionString from CIndex



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 16:04:45 +00:00
Zhongxing Xu e4da0eb77c update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 13:56:44 +00:00
Zhongxing Xu ede7eb2517 Add check for pointer arithmetic on non-array variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 13:23:31 +00:00
Zhongxing Xu bd842e3f5b Add check for obsolete function call of getpw().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 12:19:26 +00:00
Zhongxing Xu 4f3dc698a1 Add checker for CWE-588: Attempt to Access Child of a Non-structure Pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 08:07:38 +00:00
Zhongxing Xu b10a7c235f Add checker for CWE-587: Assignment of a Fixed Address to a Pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 06:52:44 +00:00
Zhongxing Xu 3ce2dc358e Add checker for CWE-469: Use of Pointer Subtraction to Determine Size. This
checker does not build sink nodes. Because svaluator computes an unknown value
for the subtraction now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 05:34:10 +00:00
Eli Friedman bb4a33cdf6 Add hack to make the given testcase work. As far as I can tell, this change is
reasonably safe, but it doesn't seem like the right solution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 03:59:26 +00:00
Zhongxing Xu c24e9f3a57 Add a test case for CWE-467, and simplify the wording of the warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 02:28:12 +00:00
Eli Friedman 49c16da71b Unify the codepaths used to verify base and member initializers for explicitly
and implicitly defined constructors.  This has a number of benefits:

1. Less code.

2. Explicit and implicit constructors get the same diagnostics.

3. The AST explicitly contains constructor calls from implicit default
constructors.  This allows handing some cases that previously weren't handled
correctly in IRGen without any additional code. Specifically, implicit default
constructors containing calls to constructors with default arguments are now
handled correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 01:05:47 +00:00
Sebastian Redl a29e51bb98 Special-case default argument expression in instantiation. This should fix PR4301. Doug, please double-check my assumptions. Read the PR for more details.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 13:56:19 +00:00
Sebastian Redl 9770ef0eea When checking the namespace of a redeclaration or definition, look through linkage specs. Fixes PR5430.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 11:36:54 +00:00
Sebastian Redl 42dddbeadb Don't reprocess non-dependent initializers of non-dependent VarDecls. Fixes PR5426.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 10:16:43 +00:00
Daniel Dunbar 30eb055802 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 09:46:39 +00:00
Daniel Dunbar bc20ef3150 Drop require_and_and argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:47:35 +00:00
Daniel Dunbar 2475d76920 Remove RUN: true lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:47:25 +00:00
Daniel Dunbar 1787b70a92 Move test/Index input files into a sub directory (not scanned as tests).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:46:19 +00:00
Daniel Dunbar 4fcfde4d5c Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:45:36 +00:00
Daniel Dunbar 1e63492a14 Rework site config for cmake to be generated at configure time, and only pass
the 'build_config' value in at runtime using the new lit runtime user parameter
feature.

This simplifies things and drops a dependency on 'sed', FWIW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 23:53:32 +00:00