Commit Graph

77370 Commits

Author SHA1 Message Date
Fariborz Jahanian 06769f9197 Fix up rewriting of protocol qualified types in objc rewriter.
Fixes radar 7589414.

llvm-svn: 95097
2010-02-02 18:35:07 +00:00
Sebastian Redl ccdb5ff17d Fix a C++ regression where redefinitions weren't diagnosed.
llvm-svn: 95096
2010-02-02 17:55:12 +00:00
Douglas Gregor efbaf99dca Include <stdlib.h>, so that we're sure to get atoi.
llvm-svn: 95095
2010-02-02 17:49:52 +00:00
Chris Lattner afe6a840d4 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.

llvm-svn: 95094
2010-02-02 17:32:27 +00:00
Daniel Dunbar ffa70e8b27 Driver/Darwin: Don't error/warn on conflicting deployment targets. Apparently
this is still a popular thing to do.

llvm-svn: 95093
2010-02-02 17:31:12 +00:00
Duncan Sands fa5f5965de Adding missing methods for creating Add, Mul, Neg and Sub with NUW.
llvm-svn: 95086
2010-02-02 12:53:04 +00:00
Chandler Carruth 173bfe477b Use the Arg variable rather than re-computing it. This also silences GCC's
unused variable warning.

llvm-svn: 95085
2010-02-02 12:15:55 +00:00
John McCall 03c4848bf4 Mark dtors for parameter variables and eliminate some redundant type munging.
llvm-svn: 95079
2010-02-02 09:10:11 +00:00
John McCall 6781b05a92 Access control for implicit destructor calls. Diagnostic could be orders of
magnitude clearer.

llvm-svn: 95078
2010-02-02 08:45:54 +00:00
John McCall 49786a6c31 Codegen CXXConstructExprs with trivial constructors as constants.
Eliminates a lot of spurious global initializers, fixing PR6205.

llvm-svn: 95077
2010-02-02 08:02:49 +00:00
Anders Carlsson 75b1f959da Check in a test case and a nasty workaround for PR6199.
llvm-svn: 95076
2010-02-02 07:10:35 +00:00
Zhongxing Xu 30678293f1 Return value on every path.
llvm-svn: 95075
2010-02-02 07:05:31 +00:00
Zhongxing Xu 0bb19a0483 simplify code.
llvm-svn: 95074
2010-02-02 06:33:32 +00:00
Zhongxing Xu b6c17a84d1 More logic correction: RemoveOverlap should always create new tree. Add a
parameter to record whether changes actually happened.

llvm-svn: 95073
2010-02-02 06:22:08 +00:00
John McCall 1acbbb5a4c Extract a common base class between UnresolvedLookupExpr and
UnresolvedMemberExpr and employ it in a few places where it's useful.

llvm-svn: 95072
2010-02-02 06:20:04 +00:00
Daniel Dunbar c4c7db6b71 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.

llvm-svn: 95071
2010-02-02 05:41:30 +00:00
Zhongxing Xu 4e9418ab28 Add a lookup method to the IntervalMap. The difference from the original
lookup is that if the lookup key is contained in the key, we return the data.

llvm-svn: 95070
2010-02-02 05:23:23 +00:00
Chris Lattner 0b8ecb511c this is reasonably complete by now.
llvm-svn: 95069
2010-02-02 05:23:01 +00:00
Daniel Dunbar a43a1eea87 CIndex: Use 'env' instead of relying on bash environment-variable setting
syntax.

llvm-svn: 95068
2010-02-02 05:20:37 +00:00
Daniel Dunbar 64ee535382 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.

llvm-svn: 95067
2010-02-02 05:19:57 +00:00
Anders Carlsson e8bfe412ec Improve handling of emitting 'null' pointers to data members.
llvm-svn: 95066
2010-02-02 05:17:25 +00:00
Daniel Dunbar a4a2e5dd5b CIndex: Fix a crash in clang_createTranslationUnitFromSourceFile when using
external ASTs, and the ASTUnit fails to load.

Also, move getLocationFromExpr outside extern "C" block.

llvm-svn: 95065
2010-02-02 05:00:22 +00:00
Devang Patel 057c642486 Apparently gdb is not amused by empty lines in pubtypes section.
llvm-svn: 95064
2010-02-02 03:47:27 +00:00
Anders Carlsson 259688ce29 Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.
llvm-svn: 95063
2010-02-02 03:37:46 +00:00
Devang Patel 6d404adc1b NULL terminate name in pubtypes sections.
llvm-svn: 95062
2010-02-02 03:37:03 +00:00
Anders Carlsson 15217531f7 Merge a test into pointers-to-data-members.cpp and convert it to FileCheck.
llvm-svn: 95061
2010-02-02 03:32:35 +00:00
Anders Carlsson 2cfade1671 Rename a test.
llvm-svn: 95060
2010-02-02 03:23:38 +00:00
John McCall 9c8340b550 FIXME complete.
llvm-svn: 95059
2010-02-02 03:10:28 +00:00
Chris Lattner 8e2c471614 don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : B
for vectors.  Codegen is generating awful code or segfaulting
in various cases (e.g. PR6204).

llvm-svn: 95058
2010-02-02 02:43:51 +00:00
John McCall fb7ad0f57a Improve the diagnostic used when an incompatible overload set is passed
as an argument during overload resolution.

llvm-svn: 95057
2010-02-02 02:42:52 +00:00
Zhongxing Xu 372688757b Fix a bunch of errors in the old logic.
llvm-svn: 95056
2010-02-02 02:40:56 +00:00
Chris Lattner 302240d73e fix a crash in loop unswitch on a loop invariant vector condition.
llvm-svn: 95055
2010-02-02 02:26:54 +00:00
Chris Lattner 29bb9272a6 remove an unreduced testcase, rename another.
llvm-svn: 95054
2010-02-02 02:23:37 +00:00
Evan Cheng 55afd2564c Perform sibcall in some cases when arguments are passes memory. Look for cases
where callee's arguments are already in the caller's own caller's stack and
they line up perfectly. e.g.

extern int foo(int a, int b, int c);

int bar(int a, int b, int c) {
  return foo(a, b, c);
}

llvm-svn: 95053
2010-02-02 02:22:50 +00:00
John McCall c1f69989b1 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.

llvm-svn: 95052
2010-02-02 02:21:27 +00:00
Sean Callanan 339975e5d5 Removed an unnecessary class from the EDDisassembler
implementation.  Also made sure that the register maps
were created during disassembler initialization.

llvm-svn: 95051
2010-02-02 02:18:20 +00:00
Dale Johannesen c84816a62e Make local RA smarter about reusing input register of a copy
as output.  Needed for (functional) correctness in inline asm,
and should be generally beneficial.  7361612.

llvm-svn: 95050
2010-02-02 02:08:02 +00:00
Ted Kremenek 545168268b 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.

llvm-svn: 95049
2010-02-02 02:07:01 +00:00
Ted Kremenek fab459fc95 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>.

llvm-svn: 95048
2010-02-02 02:01:51 +00:00
Zhongxing Xu d2f8ba0b3d 11.8p1: A nested class is a member and as such has the same access rights as
any other member.

llvm-svn: 95047
2010-02-02 01:57:01 +00:00
Dan Gohman 949458d014 LangRef.html says that inttoptr and ptrtoint always use zero-extension
when the cast is extending.

llvm-svn: 95046
2010-02-02 01:44:02 +00:00
Dan Gohman f644af8bbe Factor out alignof expression folding into a separate function and
generalize it to handle more cases.

llvm-svn: 95045
2010-02-02 01:41:39 +00:00
Dan Gohman 7e5f1b2773 Various code simplifications.
llvm-svn: 95044
2010-02-02 01:38:49 +00:00
Chris Lattner 7874e6eada add another example.
llvm-svn: 95043
2010-02-02 01:35:23 +00:00
Chris Lattner cf25141d14 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.

llvm-svn: 95042
2010-02-02 01:23:29 +00:00
Daniel Dunbar 13ad81bd70 Update CMake.
llvm-svn: 95041
2010-02-02 01:12:20 +00:00
Eric Christopher 14dfc3f6df Don't need to check the last argument since it'll always be bool. We also
don't use TargetData here.

llvm-svn: 95040
2010-02-02 00:51:45 +00:00
Chris Lattner 916dbf114a 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
       ^
       ;

llvm-svn: 95039
2010-02-02 00:43:15 +00:00
Chris Lattner 245c5335b5 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
       ^
       ;

llvm-svn: 95038
2010-02-02 00:37:27 +00:00
Ted Kremenek 0059c491c1 Hoist diagnostic generation in ReturnStackAddressChecker into a separate method. No functionality change.
llvm-svn: 95037
2010-02-02 00:13:41 +00:00