Commit Graph

19311 Commits

Author SHA1 Message Date
Reid Kleckner f9486598b5 clang-cl: Ignore the /wd n flag for disabling a warning
Clang doesn't have a table mapping cl.exe to clang warnings.  While some
warnings like -Wsign-compare exist in both compilers, the majority do
not correspond and should usually be ignored.

llvm-svn: 188732
2013-08-19 23:57:44 +00:00
Reid Kleckner a04cdbb97c clang-cl: Add /MP[n] to the list of unsupported and ignored flags
This flag tells cl.exe to use up to n processes to compile the provided
source files.  I have no plans to implement this in clang.

llvm-svn: 188729
2013-08-19 23:52:36 +00:00
Eli Friedman 4628cf763b Handle init lists and _Atomic fields.
Fixes PR16931.

llvm-svn: 188718
2013-08-19 22:12:56 +00:00
Richard Smith a6c8703e5b PR16727: don't try to evaluate a potentially value-dependent expression when
checking for missing parens in &&/|| expressions.

llvm-svn: 188716
2013-08-19 22:06:05 +00:00
Michael Gottesman 349542b171 Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class"""
This reverts commit r188642.

This change is causing LTO builds to cause our 16 GB machines to swap and OOM
all weekend. I am going to work with Dave Blaikie to resolve the issue.

Sorry Dave =(.

llvm-svn: 188687
2013-08-19 18:46:16 +00:00
David Blaikie eb0911f59d Simplify assert-neutral matching in test case.
Originally committed in r188651, improved/fixed to be assert-neutral by
Takumi in r188661.

llvm-svn: 188686
2013-08-19 18:35:25 +00:00
Hans Wennborg c0fbccc885 clang-cl: Expose the -Xclang option
llvm-svn: 188685
2013-08-19 18:32:59 +00:00
Jordan Rose 804a655dea [analyzer] Add a triple to test/Analysis/cfg.cpp
llvm-svn: 188683
2013-08-19 17:46:55 +00:00
Jordan Rose 95cdf9d603 [analyzer] Don't run unreachable code checker on inlined functions.
This is still an alpha checker, but we use it in certain tests to make sure
something is not being executed.

This should fix the buildbots.

llvm-svn: 188682
2013-08-19 17:03:12 +00:00
Jordan Rose 60619a639b [analyzer] Assume that strings are no longer than SIZE_MAX/4.
This keeps the analyzer from making silly assumptions, like thinking
strlen(foo)+1 could wrap around to 0. This fixes PR16558.

Patch by Karthik Bhat!

llvm-svn: 188680
2013-08-19 16:27:34 +00:00
Jordan Rose 5374c07ab9 Omit arguments of __builtin_object_size from the CFG.
This builtin does not actually evaluate its arguments for side effects,
so we shouldn't include them in the CFG. In the analyzer, rely on the
constant expression evaluator to get the proper semantics, at least for
now. (In the future, we could get ambitious and try to provide path-
sensitive size values.)

In theory, this does pose a problem for liveness analysis: a variable can
be used within the __builtin_object_size argument expression but not show
up as live. However, it is very unlikely that such a value would be used
to compute the object size and not used to access the object in some way.

<rdar://problem/14760817>

llvm-svn: 188679
2013-08-19 16:27:28 +00:00
Alexey Samsonov 0c127d7c71 Re-apply r188666
llvm-svn: 188675
2013-08-19 13:59:22 +00:00
NAKAMURA Takumi 053704f959 clang/Driver: [PR12920] Don't forward any -W arguments to gcc-as and gcc-ld.
AFAIK, there are no -W options for gcc-as and gcc-ld.
It caused failure to build clang with gcc-4.7 on cygwin.

FIXME: Could we recategorize Options for gcc-as and gcc-ld?
llvm-svn: 188668
2013-08-19 11:51:51 +00:00
Alexey Samsonov bca169c185 Revert r188666: it breaks the buildbots
llvm-svn: 188667
2013-08-19 11:42:54 +00:00
Alexey Samsonov 828e5e141d Fix PR16768: properly report malformed sanitizer blacklist file contents
llvm-svn: 188666
2013-08-19 10:41:30 +00:00
Robert Lytton 7d1db15ae1 XCore target: Add target specific EmitVAArg
This is so aggregates can be passed as var args too.

llvm-svn: 188664
2013-08-19 09:46:39 +00:00
Robert Lytton a7d1d865e5 XCore target: correct test layout
llvm-svn: 188663
2013-08-19 09:46:32 +00:00
Alexey Samsonov 22735c8a57 Explicitly specify triple in driver test from r188660
llvm-svn: 188662
2013-08-19 09:45:19 +00:00
NAKAMURA Takumi 7127300e41 clang/test/CodeGenObjC/2010-02-09-DbgSelf.m: Tweak for -Asserts in r188651.
llvm-svn: 188661
2013-08-19 09:37:23 +00:00
Alexey Samsonov 609213f9eb Move SanitizerArgs to the clang Driver
Summary:
This change turns SanitizerArgs into high-level options
stored in the Driver, which are parsed lazily. This fixes an issue of multiple copies of the same diagnostic message produced by sanitizer arguments parser.

Reviewers: rsmith

Reviewed By: rsmith

CC: chandlerc, eugenis, cfe-commits

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

llvm-svn: 188660
2013-08-19 09:14:21 +00:00
Dmitri Gribenko b3e8172e9e Comment parsing tests: move tests where they belong
Move C++-specific tests that were checking if we attach a base class comment to
a derived class to an existing test comment-to-html-xml-conversion.cpp.  Note
that the original testing approach was not actually testing the class--comment
relationship.  It only checked that we attached the comment *somewhere*.

The rest of subclass-comment.mm should be also moved elsewhere.

llvm-svn: 188658
2013-08-19 07:13:02 +00:00
Dmitri Gribenko 46dd39ed3c Comment parsing tests: move tests where they belong
comment-misc-tags.m is mostly about miscellaneous Doxygen tags.  Move out tests
that check if the comment is attached to an ObjC decl.  Because the exitsting
test for this is in C++ (annotate-comments.cpp), create a new test --
annotate-comments-objc.m.

The rest of comment-misc-tags.m should be also moved elsewhere.

llvm-svn: 188657
2013-08-19 07:10:13 +00:00
David Blaikie 7fceebf5aa DebugInfo: Do not include line/file info for artificial parameters & parameters of artificial functions
llvm-svn: 188651
2013-08-19 03:37:48 +00:00
David Blaikie 25b2085490 Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class""
This reverts commit r188600.

r188640/r188639 fixed the root cause of the crash-on-valid that r188600
originally introduced. This now appears to bootstrap debug clang
successfully to the best of my testing.

llvm-svn: 188642
2013-08-18 17:59:12 +00:00
David Blaikie d278589329 DebugInfo: Avoid duplicating types that may be created during the process of creating their context
A partner to r188639, this is a somewhat heavy-handed fix to the general
issue, since even after that prior change the issue does still
unavoidably arise with template parameters (see test case).

There are other ways we could consider addressing this (see FIXME).

llvm-svn: 188640
2013-08-18 17:36:19 +00:00
David Blaikie adfbf993d6 DebugInfo: Don't emit vbase 'containing types' for context chain limited types
Possible minor reduction in debug info & avoid some cases where creating
a context chain could lead to the type the context chain is being
created for, being created. (this is still possible with template
parameters - tests/fixes/improvements to follow)

llvm-svn: 188639
2013-08-18 16:55:33 +00:00
David Blaikie 5043815a60 DebugInfo: don't require full definitions for friend classes
Fixes a crash-on-valid introduced by r188486 (which should've occurred
earlier but for a blatant bug where calling createFwdDecl from the
requireCompleteType callback was useless under -flimit-debug-info and we
were just getting lucky with other later callbacks requiring the type
anyway).

llvm-svn: 188622
2013-08-18 04:50:23 +00:00
David Blaikie 949939cdbb PR16927: Don't assert (or, previously, skip) static data members of enumeration type
llvm-svn: 188612
2013-08-17 20:01:53 +00:00
Juergen Ributzka 2c2dbf4542 Fix the name and the type of the argument for intrinisc
_mm256_broadcastsi128_si256 to align with the Intel documentation.

This fixes bug PR 16581 and rdar:14747994.

llvm-svn: 188609
2013-08-17 16:40:09 +00:00
Richard Smith f9b1510576 Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.

llvm-svn: 188602
2013-08-17 00:46:16 +00:00
David Blaikie 7d5d7c7e90 Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class"
This reverts commit r188576.

Reverting while I investigate a selfhosting buildbot failure on Darwin.

llvm-svn: 188600
2013-08-17 00:06:55 +00:00
Rafael Espindola 87198cd35c Don't reject attribute used in an "extern const" variable definition.
Before this patch we would warn and drop the attribute in
extern const char test3[] __attribute__((used)) = "";

llvm-svn: 188588
2013-08-16 23:18:50 +00:00
David Blaikie 9fdedec489 DebugInfo: Canonicalize namespaces to avoid emitting multiple namespaces with the same name but different lines
Updated test case to not rely on line numbers in more cases (it's hard
to use the @ check syntax for debug info test cases (due to the
interesting ordering of metadata) and this case in particular (given the
hash-line directive)) - left a few in there to cover the line number
information for these.

llvm-svn: 188585
2013-08-16 22:52:07 +00:00
David Blaikie 9eddbbd563 DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class
This reduces Clang's .dwo (fission debug info) size by 23% over
Clang+LLVM.

llvm-svn: 188576
2013-08-16 20:40:29 +00:00
DeLesley Hutchins d40542213c Thread safety analysis: new test case
llvm-svn: 188571
2013-08-16 18:28:00 +00:00
David Majnemer f0a84f200a Parse: Do not 'HandleTopLevelDecl' on templated functions.
Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 188536
2013-08-16 08:29:13 +00:00
Jordan Rose 367843a04c [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.
This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)

One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.

Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.

llvm-svn: 188514
2013-08-16 01:06:30 +00:00
Eli Friedman 9ee175d8f0 Don't allow unary negation on scoped enums.
PR16900.

llvm-svn: 188511
2013-08-16 00:09:18 +00:00
Eli Friedman 2a1d9a9290 Fix for dependent contexts in alias templates.
When we are parsing a type for an alias template, we are not entering
the context, so we can't look into dependent classes.  Make sure the
parser handles this correctly.

PR16904.

llvm-svn: 188510
2013-08-15 23:59:20 +00:00
DeLesley Hutchins 9f5193cf61 Thread Safety Analysis: fix bug when using TryLock with && and || expressions.
llvm-svn: 188505
2013-08-15 23:06:33 +00:00
Fariborz Jahanian f63f0bf395 ObjetiveC migrator: fix the test in my last patch
to define real CF_RETURNS_RETAINED/CF_NO_RETURNS_RETAINED
pairs.

llvm-svn: 188497
2013-08-15 22:26:10 +00:00
Eli Friedman 89fe0d5842 Properly track l-paren of a CXXFucntionalCastExpr.
In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

llvm-svn: 188495
2013-08-15 22:02:56 +00:00
Fariborz Jahanian 84ac1ded83 ObjectiveC migrator. Start annotating CF functions
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.

llvm-svn: 188493
2013-08-15 21:44:38 +00:00
David Majnemer bbecd09658 CodeGen: __uuidof should work even with an incomplete _GUID type
Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

This fixes PR16856.

Reviewers: rsmith, rnk, thakis

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 188481
2013-08-15 19:59:14 +00:00
Fariborz Jahanian 313ae7009e Add another test to my last patch (NS_OPTION vs. NS_ENUM)
ObjectiveC migration.

llvm-svn: 188480
2013-08-15 19:27:42 +00:00
Fariborz Jahanian be7bc11f94 ObjectiveC migrator: In deciding NS_OPTION over
NS_ENUM, at least one power of 2 enumerator 
must be greater than two.

llvm-svn: 188470
2013-08-15 18:46:37 +00:00
Jordan Rose 2f8b0229cb [analyzer] If realloc fails on an escaped region, that region doesn't leak.
When a region is realloc()ed, MallocChecker records whether it was known
to be allocated or not. If it is, and the reallocation fails, the original
region has to be freed. Previously, when an allocated region escaped,
MallocChecker completely stopped tracking it, so a failed reallocation
still (correctly) wouldn't require freeing the original region. Recently,
however, MallocChecker started tracking escaped symbols, so that if it were
freed we could check that the deallocator matched the allocator. This
broke the reallocation model for whether or not a symbol was allocated.

Now, MallocChecker will actually check if a symbol is owned, and only
require freeing after a failed reallocation if it was owned before.

PR16730

llvm-svn: 188468
2013-08-15 17:22:06 +00:00
Jack Carter 77dce2f905 [Mips][msa] Added most builtins from add.a to xori
Includes:
add.a, adds_a, adds_s, adds_u, addv, addvi, andi.b, asub_[su], ave_[su],
aver_[su], bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bset,
bseti, c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw],
div_[su], dotp_[su], dpadd_[su], dpsub_[su], fadd, fceq, fclass, fcl[et], fcne,
fdiv, fexp2, ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, fseq, fsle, fslt, fsne, fsqr, fsub, ftint_[su],
ftq, ilvev, ilvl, ilvod, ilvr, ldi, frcp, frsqrt, madd_q, maddr_q, maddv,
max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su], msub_q, msubr_q, msubv,
mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev, pckod, pcnt, sat_[su], shf,
sld, sldi, sll, slli, splat, splati, sr[al], sr[al]i, subs_[su], subv, subvi,
xori


Patch by Daniel Sanders

llvm-svn: 188461
2013-08-15 14:47:02 +00:00
David Majnemer efd8be3158 Add back a test that was removed in r188450
llvm-svn: 188453
2013-08-15 08:34:07 +00:00
Hao Liu 4efa1402fe Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions
llvm-svn: 188452
2013-08-15 08:26:30 +00:00