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

28226 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman 50f089a6e1 Make sure the __invoke function for lambdas returns properly. Per bug report on IRC>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 23:37:17 +00:00
David Blaikie c9a9177e69 Debug Info: Emit vtables pointer members as artificial.
I wasn't sure where to put the test case for this, but this seemed like as good
a place as any. I had to reorder the tests here to make them legible while
still matching the order of metadata output in the IR file (for some reason
making it virtual changed the ordering).

Relevant commit to fix up LLVM to actually respect 'artificial' member
variables is coming once I write up a test case for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170154 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 22:29:06 +00:00
Argyrios Kyrtzidis 5e24f2d830 [PCH] Make the new PCH format (control block) backwards compatible and
don't crash when loading a PCH with the older format.

The introduction of the control block broke compatibility with PCHs from
older versions. This patch allows loading (and rejecting) PCHs from an older
version and allows newer PCHs to be rejected from older clang versions as well.

rdar://12821386

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 21:38:23 +00:00
Rafael Espindola de39d1752f Add support for current Ubuntu Quantal and the upcoming Raring.
Patch by Martin Nowack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 20:26:05 +00:00
Nadav Rotem 5bdbc114da Revert 170049 because it fails with an assertion on one of the spec2000 workloads.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 19:58:10 +00:00
Jordan Rose 45397f92bb [analyzer] Fix doc error (wrong param name) in ObjCSuperCallChecker.
Thanks for the -Wdocumentation catch, Dmitri!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 18:26:05 +00:00
Roman Divacky fc2929fdb7 Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
specifies not to. Dont build ASTMatchers with Rewriter disabled and
StaticAnalyzer when it's disabled.

Without all those three, the clang binary shrinks (x86_64) from ~36MB
to ~32MB (unstripped).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170135 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 16:09:42 +00:00
Alexander Kornienko 40b66a000d Rename StmtDumper to ASTDumper.
Patch contributed by Philip Craig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 13:59:55 +00:00
Guy Benyei 8a03357d13 Remove little endian specification from SPIR data layout - SPIR doesn't define endiannes in the data layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 13:22:48 +00:00
Richard Smith 463b48ba7e ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
bit-patterns which are not valid values for enumerated or boolean types.
These checks are the ubsan analogue of !range metadata.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 07:11:50 +00:00
Richard Smith cdc2e82c31 Simplify. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 05:41:48 +00:00
Rafael Espindola 27fa2364b0 Initial support for FreeBSD on ARM.
Patch by Andrew Turner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 04:17:14 +00:00
Jordan Rose e14999e768 [analyzer] Generalize ObjCMissingSuperCallChecker.
We now check a few methods for UIResponder, NSResponder, and NSDocument.

Patch by Julian Mayer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 03:06:45 +00:00
Eli Friedman 6febf1265b Using CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,
and make sure additional uses don't get introduced.  <rdar://problem/12858424>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 01:43:21 +00:00
Anna Zaks 1812652c24 [analyzer] Fix a self-init checker false positive.
This is a Band-Aid fix to a false positive, where we complain about not
initializing self to [super init], where self is not coming from the
init method, but is coming from the caller to init.

The proper solution would be to associate the self and it's state with
the enclosing init.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170059 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 00:42:19 +00:00
Fariborz Jahanian 0c252fa8b7 objc: DOn't complain if a (SEL) expression is typecast
to (SEL). Fixes // rdar://12859590


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 00:42:06 +00:00
Eli Friedman 206491dcbe Add missing check for error return from DefaultLvalueConversion. Fixes <rdar://problem/12857416>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 00:37:17 +00:00
Eli Friedman 0fdcd1e81d More hacking on mapDiagnosticRanges to make it handle more cases.
This still isn't quite right, but it fixes a crash.

I factored out findCommonParent because we need it on the result of 
getImmediateExpansionRange: for a function macro, the beginning
and end of an expansion range can come out of different
macros/macro arguments, which means the resulting range is a complete
mess to handle consistently.

I also made some changes to how findCommonParent works; it works somewhat
better in some cases, and somewhat worse in others, but I think overall
it's a better balance.  I'm coming to the conclusion that mapDiagnosticRanges
isn't using the right algorithm, though: chasing the caret is fundamentally
more complicated than any algorithm which only considers one FileID for the
caret can handle because each SourceLocation doesn't really have a single parent.
We need to follow the same path of choosing expansion locations and spelling
locations which the caret used to come up with the correct range
in the general case.

Fixes <rdar://problem/12847524>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 00:14:59 +00:00
Argyrios Kyrtzidis 489feee4eb [arcmt] When capturing ARC errors, have a sanity check to make sure
the diagnostic has a valid location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 22:48:28 +00:00
Argyrios Kyrtzidis 135aa60c61 [objc] For the ARC error that is emitted when a synthesized property implementation
has inconsistent ownership with the backing ivar, point the error location to the
ivar.

Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed.
Also provide the location of @synthesize via a note.

This also fixes the problem where an auto-synthesized property would emit an error without
any location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170039 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 22:48:25 +00:00
John McCall a923c9783e Rewrite calls to bitcast unprototyped functions when emitting a definition.
My variadics patch, r169588, changed these calls to typically be
bitcasts rather than calls to a supposedly variadic function.
This totally subverted a hack where we intentionally dropped
excess arguments from such calls in order to appease the inliner
and a "warning" from the optimizer.  This patch extends the hack
to also work with bitcasts, as well as teaching it to rewrite
invokes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170034 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 22:21:47 +00:00
Chad Rosier b2c0887457 [driver] Don't warn about an unused -flto option.
rdar://12851905

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 20:06:31 +00:00
Jordan Rose 4f69eb4daa [analyzer] Don't crash running destructors for multidimensional arrays.
We don't handle array destructors correctly yet, but we now apply the same
hack (explicitly destroy the first element, implicitly invalidate the rest)
for multidimensional arrays that we already use for linear arrays.

<rdar://problem/12858542>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 19:13:44 +00:00
Chad Rosier df76f1ea80 Marking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue
call sites as tail calls unconditionally.  While it's theoretically true that
this is just an optimization, it's an optimization that we very much want to
happen even at -O0, or else ARC applications become substantially harder to
debug.  See r169796 for the llvm/fast-isel side of things.
rdar://12553082

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 17:52:21 +00:00
Benjamin Kramer 21fa5d182f PR14581: Make SourceLocation::printToString work, or it will always return an empty string.
No test case, this is debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 14:17:17 +00:00
Manuel Klimek acaf110ec9 Speeds up parsing of global declarations in cases where the warning
is switched of by about 0.8% (tested with int i<N>).

Additionally, this puts computing the diagnostic class into the hot
path more when parsing, in preparation for upcoming optimizations
in this area.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169976 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 13:26:54 +00:00
NAKAMURA Takumi 04ee66e1fe clang/lib/Driver/Driver.cpp: Split COMPILER_PATH according to llvm::sys::PathSeparator, that is ';' in Win32 hosts.
Thanks to Bogon Kim!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 06:22:22 +00:00
Richard Smith 1fbf6fb5c7 Don't warn about disabled macro expansion if we see the name of a function-like macro which isn't immediately followed by '('. FreeBSD's stdio.h #defines foo(x) to (foo)(x), apparently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169960 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 02:46:14 +00:00
Douglas Gregor 1b257afbae Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 22:11:52 +00:00
Guy Benyei bd5da3ca59 Add SPIR32/SPIR64 targets to Clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 21:38:14 +00:00
Hal Finkel 443c999c96 Add -fslp-vectorize to enable bb-vectorize
Add -fslp-vectorize (with -ftree-slp-vectorize as an alias for gcc compatibility)
to provide a way to enable the basic-block vectorization pass. This uses the same
acronym as gcc, superword-level parallelism (SLP), also common in the literature,
to refer to basic-block vectorization.

Nadav suggested this as a follow-up to the adding of -fvectorize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 19:59:32 +00:00
Fariborz Jahanian 34db84fdb0 objective-C blocks: Check for record type when deciding if
byref variable requires extended layout info. to prevent 
a crash involving arrays declared __block. // rdar://12787751


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 19:58:01 +00:00
Douglas Gregor 86f6cf6800 Don't complain about incomplete implementations for methods that are
unavailable due to availability attributes. <rdar://problem/12798237>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169903 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 18:53:07 +00:00
Benjamin Kramer a07b59e5e9 Speed up looking up static diagnostic infos.
Instead of doing a binary search over the whole diagnostic table (which weighs
a whopping 48k on x86_64), use the existing enums to compute the index in the
table. This avoids loading any unneeded data from the table and avoids littering
CPU caches with it. This code is in a hot path for code with many diagnostics.

1% speedup on -fsyntax-only gcc.c, which emits a lot of warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 18:00:22 +00:00
Chad Rosier c04d0934df [driver] Add the -fvectorize flag to enable the loop vectorization passes.
rdar://12839978 

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 17:12:28 +00:00
Alexander Kornienko 21c8b19a28 StmtDumper coding style changes
Summary:
A few small coding style changes for StmtDumper, including:
- rename Dump* methods to dump*
- uninline some methods
- comment fixes
- whitespace fixes

Please review and commit if okay.

Reviewers: alexfh

Reviewed By: alexfh

CC: cfe-commits, alexfh, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D190

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169866 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 15:28:09 +00:00
Alexander Kornienko d5bc359971 Rename StmtDumper::DumpSubTree() to dumpStmt()
Summary:
Also rename DumpDeclarator() to dumpDecl(). Once Decl dumping is added, these will be the two main methods of the class, so this is just for consistency in naming.

There was a DumpStmt() method already, but there was no point in having it, so I have merged it into VisitStmt(). Similarly, DumpExpr() is merged into VisitExpr().

Reviewers: alexfh

Reviewed By: alexfh

CC: cfe-commits, alexfh

Differential Revision: http://llvm-reviews.chandlerc.com/D156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169865 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 15:20:44 +00:00
Argyrios Kyrtzidis e5d30e3b40 Extend stat query APIs to explicitly specify if the query is for
a file or directory, allowing just a stat call if a file descriptor
is not needed.

Doing just 'stat' is faster than 'open/fstat/close'.
This has the effect of cutting down system time for validating the input files of a PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 07:48:23 +00:00
Argyrios Kyrtzidis f64d25c633 [PCH] Remove redundant stat call when validating the input files.
This became redundant after we removed the stat cache.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 07:48:14 +00:00
Argyrios Kyrtzidis a89b618a04 [PCH] When writing out the list of input files, avoid emitting duplicate
entries of the same file.

This can happen because the file was "included" multiple times and is
referenced by multiple SLocEntries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 07:48:08 +00:00
NAKAMURA Takumi 007c44ccbd BackendUtil.cpp: Add #include "llvm/TargetTransformInfo.h"
llvm/Target/TargetMachine.h will not provide "llvm/TargetTransformInfo.h" any more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 05:53:24 +00:00
Richard Smith 1d28caf3b5 PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 01:14:52 +00:00
Anna Zaks c2cca2361a [analyzer] Don't generate a summary for "freeWhenDone" if method is
inlined.

Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 00:17:53 +00:00
Bill Wendling d56f403413 Add support to Darwin for the -export_dynamic' flag to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 21:48:41 +00:00
Argyrios Kyrtzidis 44dfff681f Return true from HeaderSearch::isFileMultipleIncludeGuarded if the file
was #import'ed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169761 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 20:08:37 +00:00
Bill Wendling 44f4a2d8a9 Specify if `-mno-red-zone' was used when creating the GCOV instrucmentation pass.
This prevents the functions generated by that pass from using the red zone.
<rdar://problem/12843084>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169755 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 19:47:53 +00:00
Daniel Jasper 8b39c6693a Addi formatting tests for pointer template parameters.
Fix spacing before ",".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 18:59:13 +00:00
Alexander Kornienko 56e49c5cc2 Clang-format: error recovery for access specifiers
Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D198

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 16:34:48 +00:00
Benjamin Kramer 29573b0a82 Unbreak the clang build after r169712.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169713 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 21:58:24 +00:00
Aaron Ballman fff3248e69 Virtual method overrides can no longer have mismatched calling conventions. This fixes PR14339.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 17:45:41 +00:00