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

19054 Коммитов

Автор SHA1 Сообщение Дата
John McCall d4bbdfebe9 Dump the constructor type for a CXXConstructExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 19:03:45 +00:00
John McCall 41593e3b7d Fix this comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 19:02:38 +00:00
Sebastian Redl 4cae1b343c Check for redefinitions in MergeVarDecl. This finds redefinitions of globals without an initializer in C++ and thus fixes PR5451.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 18:35:11 +00:00
Fariborz Jahanian 84aa9464a4 Fix up rewriting of protocol qualified types in objc rewriter.
Fixes radar 7589414.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 18:35:07 +00:00
Sebastian Redl e2c52d29e4 Fix a C++ regression where redefinitions weren't diagnosed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 17:55:12 +00:00
Douglas Gregor c6277a0a42 Include <stdlib.h>, so that we're sure to get atoi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 17:49:52 +00:00
Chris Lattner 99c9520466 the declspec of a declaration can have storage-class specifiers,
type qualifiers and type specifiers in any order.   For example,
this is valid: struct x {...} typedef y;

This fixes PR6208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 17:32:27 +00:00
Daniel Dunbar 39053672d4 Driver/Darwin: Don't error/warn on conflicting deployment targets. Apparently
this is still a popular thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 17:31:12 +00:00
Chandler Carruth 878b55ce6c Use the Arg variable rather than re-computing it. This also silences GCC's
unused variable warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 12:15:55 +00:00
John McCall 68c6c9a21e Mark dtors for parameter variables and eliminate some redundant type munging.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 09:10:11 +00:00
John McCall 4f9506a27c Access control for implicit destructor calls. Diagnostic could be orders of
magnitude clearer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 08:45:54 +00:00
John McCall fb8b69aef3 Codegen CXXConstructExprs with trivial constructors as constants.
Eliminates a lot of spurious global initializers, fixing PR6205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 08:02:49 +00:00
Anders Carlsson 2e13db8bc6 Check in a test case and a nasty workaround for PR6199.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 07:10:35 +00:00
John McCall 7bb12da2b0 Extract a common base class between UnresolvedLookupExpr and
UnresolvedMemberExpr and employ it in a few places where it's useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 06:20:04 +00:00
Daniel Dunbar b217bcce14 XFAIL two tests on Win32 until some cares to investigate... the problem on
dyncast is just due to \r\n newline interaction w/ regexps. The remap-load.c
failure is a bit stranger (the end of the extent is on the next line), but I
don't care to investigate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:41:30 +00:00
Chris Lattner 88aad88df1 this is reasonably complete by now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95069 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:23:01 +00:00
Daniel Dunbar 96a86600b4 CIndex: Use 'env' instead of relying on bash environment-variable setting
syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:20:37 +00:00
Daniel Dunbar 74198af85e CIndex: Respect TMPDIR/TEMP/TMP when making temporary files for remapping. As a
side effect, this also fixes some cases on Windows where the file would end up
on a different drive, because tmpnam doesn't include the drive component. PR3837
strikes again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:19:57 +00:00
Anders Carlsson 2c12d0319a Improve handling of emitting 'null' pointers to data members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:17:25 +00:00
Daniel Dunbar c29f4c3960 CIndex: Fix a crash in clang_createTranslationUnitFromSourceFile when using
external ASTs, and the ASTUnit fails to load.

Also, move getLocationFromExpr outside extern "C" block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:00:22 +00:00
Anders Carlsson 45147d0098 Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 03:37:46 +00:00
Anders Carlsson 63b071f28e Merge a test into pointers-to-data-members.cpp and convert it to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 03:32:35 +00:00
Anders Carlsson fe40456f0c Rename a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 03:23:38 +00:00
John McCall 0519fe2e11 FIXME complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 03:10:28 +00:00
John McCall 5920dbba96 Improve the diagnostic used when an incompatible overload set is passed
as an argument during overload resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:42:52 +00:00
John McCall eff92135d3 Implement C++ [temp.deduct.call]p6, template argument deduction for overloaded
arguments.  Fix a bug where incomplete explicit specializations were being
passed through as legitimate.  Fix a bug where the absence of an explicit
specialization in an overload set was causing overall deduction to fail.

Fixes PR6191.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95052 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:21:27 +00:00
Ted Kremenek d0ed448120 Add a stop gap to Sema::CorrectTypo() to correct only up to 20 typos.
This is to address a serious performance problem observed when running
'clang -fsyntax-only' on really broken source files.  In one case,
repeatedly calling CorrectTypo() caused one source file to be rejected
after 2 minutes instead of 1 second.

This patch causes typo correction to take neglible time on that file
while still providing correction results for the first 20 cases.  I
felt this was a reasonable number for moderately broken source files.

I don't claim this is the best solution.  Comments welcome.  It is
necessary for us to address this issue because it is a serious
performance problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:07:01 +00:00
Ted Kremenek 61e8e1b842 Fix bug in GRExprEngine::VisitSizeOfAlignOfExpr() where we do not add
'Pred' to 'Dst' for cases we currently don't handle.  This fixes
<rdar://problem/7593875>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:01:51 +00:00
Chris Lattner 94634ccd4f add another example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 01:35:23 +00:00
Chris Lattner 4ed5d91db2 Implement PR6180, substantially improving the diagnostics we get from
forgetting a ';' at the end of a struct.  For something like:

class c {
}
void foo() {}

we now produce:

t.cc:3:2: error: expected ';' after class
}
 ^
 ;

instead of:

t.cc:4:1: error: cannot combine with previous 'class' declaration specifier
void foo() {}
^
t.cc:2:7: error: 'class c' can not be defined in the result type of a function
class c {
      ^

GCC produces:

t.cc:4: error: new types may not be defined in a return type
t.cc:4: note: (perhaps a semicolon is missing after the definition of ‘c’)
t.cc:4: error: two or more data types in declaration of ‘foo’

I *think* I got the follow set right, but if I forgot anything, we'll start 
getting spurious "expected ';' after class" errors, let me know if you see
any.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 01:23:29 +00:00
Chris Lattner ae50d501f4 improve diagnostics for C++ struct ; issues. Before:
t.cc:4:3: error: expected ';' at end of declaration list
  int y;
  ^
t.cc:6:1: error: expected ';' at end of declaration list
};
^

After:

t.cc:3:8: error: expected ';' at end of declaration list
  int x
       ^
       ;
t.cc:5:8: error: expected ';' at end of declaration list
  int z
       ^
       ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 00:43:15 +00:00
Chris Lattner 3e156ad9ad improve diagnostics on missing ; in a struct. Before:
t.c:4:3: error: expected ';' at end of declaration list
  int y;
  ^
t.c:4:8: warning: extra ';' inside a struct or union
  int y;
       ^
t.c:6:1: warning: expected ';' at end of declaration list
};
^

After:

t.c:3:8: error: expected ';' at end of declaration list
  int x  // expected-error {{expected ';' at end of declaration list}}
       ^
       ;
t.c:5:8: warning: expected ';' at end of declaration list
  int z
       ^
       ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 00:37:27 +00:00
Ted Kremenek edf21bce6e Hoist diagnostic generation in ReturnStackAddressChecker into a separate method. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 00:13:41 +00:00
Douglas Gregor 28485232e4 Make this fix-it test case actually fail when there is a problem; add
a test for access declarations and remove a (broken) test for removal
of default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:46:27 +00:00
Douglas Gregor 677e4feebe Improve handling of enumerator values for C and C++, including:
- In C++, prior to the closing '}', set the type of enumerators
    based on the type of their initializer. Don't perform unary
    conversions on the enumerator values.
  - In C++, handle overflow when an enumerator has no initializer and
    its value cannot be represented in the type of the previous
    enumerator.
  - In C, handle overflow more gracefully, by complaining and then
    falling back to the C++ rules.
  - In C, if the enumerator value is representable in an int, convert the
    expression to the type 'int'.

Fixes PR5854 and PR4515.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:36:03 +00:00
Daniel Dunbar 4581581881 ARM/APCS: Fix classification of small complex integer types as "integer like".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:31:26 +00:00
Daniel Dunbar 4cc753f450 ARM/APCS: Pass Complex types following llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:31:19 +00:00
Ted Kremenek f911eba72e Add format string type checking support for 'long double'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 23:23:50 +00:00
Devang Patel ce78c9743a Fix FIXME and surrounding comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 22:51:29 +00:00
Devang Patel 411894b96f Use appropriate context descriptor in RecordDecl's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 22:40:08 +00:00
Devang Patel d6c5a26b33 Do not use clang type name to name a local variable, e.g. Decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:52:22 +00:00
Devang Patel 239cec6179 Do not use clang type name to name a local variable, e.g. Decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:39:52 +00:00
Devang Patel eb6d79b590 Use DeclContext as getContextDescriptor() argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:34:11 +00:00
Daniel Dunbar 609508ce95 Driver/Darwin: Darwin uses -fobjc-legacy-dispatch on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:07:43 +00:00
Daniel Dunbar 2feefe8c19 NeXT: Add support for -fobjc-legacy-dispatch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:07:33 +00:00
Daniel Dunbar 984eb8611d Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 21:07:25 +00:00
Chris Lattner b9f709665a Don't explicitly force utf strings into the __TEXT,__ustring
by setting the section of the generated global.  This is an
optimization done by the code generator, and the code being
removed didn't handle the case when the string contained an
embedded nul (which the code generator does correctly 
handle).  This is rdar://7589850



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 20:59:08 +00:00
Sebastian Redl 31310a21fb In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 20:16:42 +00:00
Chris Lattner 21b91a35fb fix PR6187: various load functions in xmmintrin.h were missing 'const'.
emmintrin looks ok.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 20:14:14 +00:00
Ted Kremenek 105d41c0a4 Use early return as suggested by Cristian Draghici.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 19:38:10 +00:00