Commit Graph

52435 Commits

Author SHA1 Message Date
Reid Kleckner c9bb8b5af4 Use %clang_cc1 in rewrite-includes-messages.c test and drop REQUIRES: shell
This test passes on Windows with lit's shell interpreter.

llvm-svn: 207810
2014-05-01 22:45:16 +00:00
Lubos Lunak 1f03d08a8c do not hide clang stderr output during a test
I don't know why this fails on the buildbot.

llvm-svn: 207808
2014-05-01 22:40:00 +00:00
David Blaikie 09acbf35e2 Fix some -Wabsolute-value warnings introduced in r207796.
llvm-svn: 207806
2014-05-01 22:23:56 +00:00
David Blaikie eef6b5c154 Revert "Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))"
Seems to be crashing clang (3.3 and 3.4) on some buildbots...

This reverts commit r207792.

llvm-svn: 207799
2014-05-01 21:40:37 +00:00
Lubos Lunak adc2fde016 use 'diff' rather than 'cmp -s' in a test
That's what all tests use, no idea where I got the latter from.

llvm-svn: 207797
2014-05-01 21:36:08 +00:00
Kaelyn Takata b96b3be899 When sorting overload candidates, sort arity mismatches in ascending
order by the number of missing or extra parameters. This is useful if
there are more than a few overload candidates with arity mismatches,
particularly in the presence of -fshow-overloads=best.

llvm-svn: 207796
2014-05-01 21:15:24 +00:00
Lubos Lunak 4526b46ee6 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207795
2014-05-01 21:11:57 +00:00
Lubos Lunak 72cad68b30 do not use "1" for line marker for the predefines "file" either
Similar to r207764.

llvm-svn: 207794
2014-05-01 21:10:08 +00:00
David Blaikie de9527c232 Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))
llvm-svn: 207792
2014-05-01 20:46:30 +00:00
Richard Smith 06900a0ffb Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.
llvm-svn: 207789
2014-05-01 20:04:39 +00:00
Arnaud A. de Grandmaison 59615698d5 PR19601: testcase improvement
The test can now catch all cases:
 - no removal of the 'no-integrated-as' flag
 - bogus removal of the flag, like when the remove_if was not followed by an erase

llvm-svn: 207787
2014-05-01 19:36:13 +00:00
David Blaikie 1c286f6d8f PR19623: Support typedefs (and alias templates) of void.
llvm-svn: 207781
2014-05-01 18:25:19 +00:00
David Blaikie 80bec83d8d Fix debug-info-alias test to add CHECK to some lines that were missing it.
To simplify source location offsets, this test uses line directives to
force particular lines of interest to have known line numbers so that
adjustments before/after those points don't require updates to the CHECK
lines.

llvm-svn: 207779
2014-05-01 18:13:24 +00:00
David Majnemer daff37013c AST: Mangle reference temporaries reliably
Summary:
Previously, we would generate a single name for all reference
temporaries and allow LLVM to rename them for us.  Instead, number the
reference temporaries as we build them in Sema.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3554

llvm-svn: 207776
2014-05-01 17:50:17 +00:00
Dinesh Dwivedi 0db806b7f9 Fix typo (first commit to test commit access).
llvm-svn: 207775
2014-05-01 17:19:34 +00:00
Reid Kleckner 756199ccea Fix declspec-thread.cpp test with a triple
Not all triples support it.

llvm-svn: 207772
2014-05-01 17:12:20 +00:00
Reid Kleckner e502507d34 MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors
We accept 'void *p; p->~void();' for MSVC compatibility since r148682.
However, we were returning ExprError, rather than producing an AST,
despite only diagnosing it with a warning.  CodeGen noticed that the
template function specialization had an invalid AST, and therefore
didn't generate code for it.  This change makes us produce an AST with a
void pseudo-dtor call.

Part of PR18256.

llvm-svn: 207771
2014-05-01 16:50:23 +00:00
Joey Gouly 81228382cf [libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.
This bumps CINDEX_VERSION_MINOR up (to 26).

llvm-svn: 207767
2014-05-01 15:41:58 +00:00
Aaron Ballman d6459e5c43 Fixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial types. Replaced with std::copy. No functional changes intended since all uses of this functionality either use pointers or integers.
llvm-svn: 207766
2014-05-01 15:21:03 +00:00
Tobias Grosser 86a85678f2 Support 'remark' in VerifyDiagnosticConsumer
After Diego added support for -Rpass=inliner we have now in-tree remarks which
we can use to properly test this feature.

llvm-svn: 207765
2014-05-01 14:06:01 +00:00
Lubos Lunak 10961c0eab do not use "1" for line marker for the main file
"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

llvm-svn: 207764
2014-05-01 13:50:44 +00:00
Lubos Lunak 64568ca18a revert r207756
There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

llvm-svn: 207762
2014-05-01 13:37:55 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Lubos Lunak c5f2bca866 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207756
2014-05-01 12:45:08 +00:00
Ben Langmuir 05f82ba252 Avoid a potential race between stat() and open() of ASTFile
We need to open an ASTFile while checking its expected size and
modification time, or another clang instance can modify the file between
the stat() and the open().

llvm-svn: 207735
2014-05-01 03:33:36 +00:00
Reid Kleckner 7d6d2705f6 Add support for __declspec(thread) under -fms-extensions
Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D3551

llvm-svn: 207734
2014-05-01 03:16:47 +00:00
Reid Kleckner ac64060c80 MS ABI x64: Don't destroy arguments twice on x64
We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

llvm-svn: 207733
2014-05-01 03:07:18 +00:00
Richard Smith 09d5b3a928 Make typo-correction of inheriting constructors work a bit better. Limit
correction to direct base class members, and recover properly after we apply
such a correction.

llvm-svn: 207731
2014-05-01 00:35:04 +00:00
Dmitri Gribenko 0b2026de6b Comment parsing: remove HTML attribute validation
Since the community says that a blacklist is not good enough, and I don't have
enough time now to implement a proper whitelist, let's just remove the
attribute validation.

But, nevertheless, we can still communicate in the generated XML if our parser
found an issue with the HTML.  But this bit is best-effort and is specifically
called out in the schema as such.

llvm-svn: 207712
2014-04-30 21:54:30 +00:00
Arnaud A. de Grandmaison e1265143e2 PR19601: std::remove_if does not really remove the elements.
It moves them at the end of the range instead, so an extra erase is needed.

It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests.

llvm-svn: 207696
2014-04-30 19:59:22 +00:00
Reid Kleckner f1dccebe6a Fix typos in carries_dependency docs
llvm-svn: 207686
2014-04-30 18:50:03 +00:00
David Majnemer deca705593 Sema: Implement DR477
Summary: Friend declarations shouldn't mention explicit or virtual.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3562

llvm-svn: 207682
2014-04-30 18:24:01 +00:00
Richard Smith d94f2f16bd When typo-correcting a member using declaration, don't exclude member templates.
llvm-svn: 207681
2014-04-30 18:15:00 +00:00
Richard Smith 21866c3267 When typo-correcting a member using-declaration, only consider members of base classes.
llvm-svn: 207680
2014-04-30 18:03:21 +00:00
Richard Smith 30a615dca8 Fix crash if typo correction corrects a member using-declaration to a
non-member declaration. Patch by Dinesh Dwivedi!

llvm-svn: 207677
2014-04-30 17:40:35 +00:00
Reid Kleckner 92fc0178c6 __thread: Move constant init check to CheckCompleteVariableDeclaration
We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:

struct S { S(); };
__thread S s;

llvm-svn: 207675
2014-04-30 17:10:18 +00:00
Reid Kleckner 121b1a1fa5 -Wunused-parameter: Don't fire on defaulted or deleted functions
Patch by Dinesh Dwivedi!

Differential Revision: http://reviews.llvm.org/D3376

llvm-svn: 207672
2014-04-30 16:31:28 +00:00
Logan Chien 28f87f80e2 Android uses -fpic for arm64 as well.
llvm-svn: 207642
2014-04-30 12:18:12 +00:00
James Molloy 7c39a5ad02 Add a test for big-endian NEON on ARM64.
The enabled test #includes <arm_neon.h>, which is sufficient to test all
the code in r207624.

llvm-svn: 207641
2014-04-30 12:12:45 +00:00
Bradley Smith 4da7dd837d [ARM64] Port remaining relevant AArch64 clang tests over to ARM64
llvm-svn: 207632
2014-04-30 10:52:05 +00:00
James Molloy fa40368d9d [ARM64] Add arm64_be where it was accidentally missed from a bunch of if-conditions.
I think this is the last commit for ARM64 big endian in clang. This commit makes
arm_neon.h compile correctly.

llvm-svn: 207624
2014-04-30 10:11:40 +00:00
Andrea Di Biagio c7ce72c9f2 Simplify test. No functional change intended.
llvm-svn: 207623
2014-04-30 10:04:58 +00:00
Nico Weber ae360dc36c Add a triple to new test.
NULL is just 0 on Windows, so the Wsentinel part of the test doesn't pass there.

llvm-svn: 207607
2014-04-30 04:54:42 +00:00
Nico Weber 272bcf6768 Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.
glibc expects that stddef.h only defines a single thing if either of these
defines is set.  For example, before this change, a C file containing

  #include <stdlib.h>
  int ptrdiff_t = 0;

would compile with gcc but not with clang. Now it compiles with clang too.

This also fixes PR12997, where older versions of the Linux headers would define
NULL incorrectly, and glibc would define __need_NULL and expect stddef.h to
redefine NULL with the correct definition.

llvm-svn: 207606
2014-04-30 04:35:09 +00:00
Richard Smith d1c4674603 Defer loading any pending update records until we've finished deserializing.
This fixes a bug where an update record causes us to load an entity that refers
to an entity we've not finished loading yet, resulting in badness.

llvm-svn: 207603
2014-04-30 02:24:17 +00:00
Rafael Espindola b5b622a03c Drop non-cfi assembly support from clang.
After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and
always print assembly that uses cfi directives.

In llvm, MC itself supports cfi since the end of 2010 (support started
in r119972, is reported in the 2.9 release notes).

In binutils the support has been around for much longer. It looks like
support started to be added in May 2003. It is available in 2.15
(31-Aug-2011, 2.14 is from 12-Jun-2003).

llvm-svn: 207602
2014-04-30 02:22:09 +00:00
Andrea Di Biagio e653811af2 Add test case for revision 207575 to verify that on Windows, clang doesn't
crash with an assertion failure when 'nul' is passed in input.

Modified clang/test/lit.py to add feature 'system-windows' if
`platform.system()` returns 'Windows'.

llvm-svn: 207576
2014-04-29 20:19:13 +00:00
Hans Wennborg df51ee6c50 scanf analysis: handle scanlists that start with ^] (PR19559)
llvm-svn: 207573
2014-04-29 19:42:27 +00:00
Argyrios Kyrtzidis fe6b880de5 [PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a driver only thing and doesn't affect any language/preprocessor/etc. semantics.
rdar://16714526

llvm-svn: 207570
2014-04-29 18:45:01 +00:00
Logan Chien 4ecf0158a4 Android uses -fpic for aarch64.
llvm-svn: 207567
2014-04-29 18:18:58 +00:00
Jordan Rose 6017348856 [analyzer] Improve test from r207486.
The constructor that comes right before a variable declaration in the CFG might
not be the initialization of that variable. Previously, we just checked that
the variable's initializer expression was different from the construction
expression, but forgot to see whether the variable had an initializer expression
at all.

Thanks for the prompting, David.

llvm-svn: 207562
2014-04-29 17:08:17 +00:00
Jordan Rose 62ac9ecadc [analyzer] Don't assert when combining using .* on a temporary.
While we don't model pointer-to-member operators yet (neither .* nor ->*),
CallAndMessageChecker still checks to make sure the 'this' object is not
null or undefined first. However, it also expects that the object should
always have a valid MemRegion, something that's generally important elsewhere
in the analyzer as well. Ensure this is true ahead of time, just like we do
for member access.

PR19531

llvm-svn: 207561
2014-04-29 17:08:12 +00:00
Ben Langmuir b92de02f17 Reapply r207477 and r207479 without cyclic dependency
Fixed by moving ProcessWarningOptions from Frontend into Basic. All of
the dependencies for ProcessWarningOptions were already in Basic, so
this was a small change.

llvm-svn: 207549
2014-04-29 16:25:26 +00:00
Fariborz Jahanian f1a22f487e Objective-C. Improve diagnosis of bridging types.
// rdar://16737117

llvm-svn: 207542
2014-04-29 16:12:56 +00:00
Daniel Jasper 883ae9d9a3 clang-format: Don't bin-pack text-proto-formatted options.
Before:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,
                              bbbbbbb: BBBB, bbbb: BBB}];

After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,
                              bbbbbbb: BBBB,
                              bbbb: BBB}];

llvm-svn: 207538
2014-04-29 15:54:14 +00:00
Daniel Jasper c282e54eb6 clang-format: Remove accidentally added debug output.
llvm-svn: 207533
2014-04-29 15:35:28 +00:00
Daniel Jasper 35995679c6 clang-format: Allow single-line function in WebKit style.
Before:
  void f() {
      return; }

After:
  void f() { return; }

llvm-svn: 207527
2014-04-29 14:05:20 +00:00
Alexey Volkov 6468f5d309 Add comments regarding isPIEDefault usage for r207520
Differential Revision: http://reviews.llvm.org/D2668

llvm-svn: 207521
2014-04-29 12:07:34 +00:00
Alexey Volkov 0692103653 Pass -pie to linker when generating executable on Android
This fixes problem with LTO on Android.

Differential Revision: http://reviews.llvm.org/D2668

llvm-svn: 207520
2014-04-29 10:25:20 +00:00
David Majnemer 35b02bc7ab AST: Fix visibility calculation for VarTemplateSpecializationDecl
It is possible that a variable template specialization might not have a
VisibilityAttr attached to it while the template that it specializes
does, in fact, have one.

We should consider the template in such cases.

This fixes PR19597.

llvm-svn: 207498
2014-04-29 07:32:26 +00:00
NAKAMURA Takumi 366363dac1 Revert r207477 (and r207479), "Check -Werror options during module validation"
It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization.

llvm-svn: 207497
2014-04-29 06:58:59 +00:00
David Majnemer 846c2833ec CodeGen: Reference temporaries inherit visibility
Reference temporaries inherited many properties from the variable that
they correspond to but visibility wasn't one of them.

llvm-svn: 207496
2014-04-29 06:18:53 +00:00
Adrian Prantl c4405c87c6 Make test independent of label. Thanks to Richard Smith for catching this!
llvm-svn: 207489
2014-04-29 02:27:33 +00:00
Richard Smith dfbe47650e Run this test through instnamer to stop it failing on non-asserts clang builds.
llvm-svn: 207488
2014-04-29 02:18:35 +00:00
Jordan Rose bcd889730d [analyzer] Don't crash when a construction is followed by an uninitialized variable.
This could happen due to unfortunate CFG coincidences.

PR19579

llvm-svn: 207486
2014-04-29 01:56:12 +00:00
Jordan Rose 90d09146e0 scan-build: Don't use realpath when the user provides an explicit path.
PR19583

llvm-svn: 207484
2014-04-29 01:37:19 +00:00
Nico Weber f077c51a70 Revert r207482; I fail at reading IRC.
llvm-svn: 207483
2014-04-29 01:25:49 +00:00
Nico Weber 8af28c1e61 Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.
See the bug and the cfe-commits thread "[patch] Let stddef.h redefine NULL if
__need_NULL is set" for discussion.

Fixes PR12997 and is similar to the __need_wint_t bits already in this file.

llvm-svn: 207482
2014-04-29 01:19:21 +00:00
Adrian Prantl 2cede0f92c Debug info: Improve line table for functions with cleanups an early exit
and no return expr at the end of the function.
The "function has only simple returns" check in FinishFunction tests
whether the number of simple return exprs equals the number of return
exprs, but so far a fallthrough at the end of a function was not counted
as a return, which would result in cleanup code being associated with the
wrong source line.

rdar://problem/16733984.

llvm-svn: 207480
2014-04-29 01:07:59 +00:00
Ben Langmuir c829f19e24 Add missing triple to make -isysroot work
llvm-svn: 207479
2014-04-29 01:04:34 +00:00
Jordan Rose 1057e09432 [analyzer] Clean up the lists of current and potential checkers.
Patch by Anton Yartsev, modified by me.

llvm-svn: 207478
2014-04-29 00:46:17 +00:00
Ben Langmuir be84adbf1b Check -Werror options during module validation
This patch checks whether the diagnostic options that could lead to
errors (principally -Werror) are consistent between when a module was
built and when it is loaded.  If there are new -Werror flags, then the
module is rebuilt.  In order to canonicalize the options we do this
check at the level of the constructed DiagnosticsEngine, which contains
the final set of diag to diagnostic level mappings.  Currently we only
rebuild with the new diagnostic options, but we intend to refine this in
the future to include the union of the new and old flags, since we know
the old ones did not cause errors.  System modules are only rebuilt when
-Wsystem-headers is enabled.

One oddity is that unlike checking language options, we don’t perform
this diagnostic option checking when loading from a precompiled header.
The reason for this is that the compiler cannot rebuild the PCH, so
anything that requires it to be rebuilt effectively leaks into the build
system.  And in this case, that would mean the build system
understanding the complex relationship between diagnostic options and
the underlying diagnostic mappings, which is unreasonable.  Skipping the
check is safe, because these options do not affect the generated AST.
You simply won’t get new build errors due to changed -Werror options
automatically, which is also true for non-module cases.

llvm-svn: 207477
2014-04-29 00:36:53 +00:00
Reid Kleckner 982a589d3a LLVM supports TLS on Windows and we can use it from Clang
Patch by Martell Malone!

Differential Revision: http://reviews.llvm.org/D3421

llvm-svn: 207470
2014-04-29 00:11:30 +00:00
Paul Robinson f44157d6ab When Driver::generateCompilationDiagnostics is filtering the list of
inputs to the preprocessor, check for invalid types first because not
all linker inputs have an option value to retrieve.

llvm-svn: 207454
2014-04-28 22:24:44 +00:00
Eli Bendersky 3468d9d929 Move all CUDA testing inputs to Inputs/ subdirectory inside the tests.
llvm-svn: 207453
2014-04-28 22:21:28 +00:00
David Majnemer 27d69dbbd0 CodeGen: Fix linkage of reference temporaries
Summary:
A reference temporary should inherit the linkage of the variable it
initializes.  Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3515

llvm-svn: 207451
2014-04-28 22:17:59 +00:00
Justin Bogner f24d9c9158 [cleanup] Fix an 80-column violation
llvm-svn: 207446
2014-04-28 20:58:58 +00:00
Chad Rosier 136d67dc64 [driver] Disable the slp vectorizer at -O0, -O1, and -Oz. This mirrors the
behavior of the loop vectorizer, which is enabled at -O2, -O3, -O4, -Ofast
and -Os.
PR19568

llvm-svn: 207433
2014-04-28 19:30:57 +00:00
Nico Weber 47d387c9ec Remove unused using statement.
llvm-svn: 207427
2014-04-28 17:54:37 +00:00
Aaron Ballman 35897d97a3 Renaming range-based for loop variables so they don't appear iterator-like.
llvm-svn: 207422
2014-04-28 14:56:59 +00:00
Aaron Ballman fe46e62e99 [C++11] Converting to range-based for loops. No functional changes intended.
llvm-svn: 207416
2014-04-28 13:01:32 +00:00
Daniel Jasper 942d971c84 clang-format: Improve binary operator detection.
Before:
  *(int *)(p &~3UL) = 0;

After:
  *(int *)(p & ~3UL) = 0;

This fixes llvm.org/PR19464.

llvm-svn: 207405
2014-04-28 09:19:28 +00:00
Daniel Jasper 031e2409f9 clang-format: Fixes spaces in case statements.
This fixes llvm.org/PR19482.

Before:
  switch (a) {
    case(B) :
      return;
  }

After:
  switch (a) {
    case (B):
      return;
  }

llvm-svn: 207402
2014-04-28 07:48:36 +00:00
Hao Liu a19a2e2da6 [ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.
llvm-svn: 207401
2014-04-28 07:36:12 +00:00
Daniel Jasper 437c3f5188 clang-format: Don't wrap after @interface.
This fixes llvm.org/PR19450.

Before:
  @interface
  BookmarkHomeHandsetViewController ()<BookmarkAllCollectionViewDelegate,
                                       BookmarkFolderCollectionViewDelegate,
                                       BookmarkMenuViewControllerDelegate,
                                       BookmarkSearchViewControllerDelegate> {
  }

After:
  @interface aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ()<
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> {
  }

llvm-svn: 207400
2014-04-28 07:34:48 +00:00
Nico Weber 10bf95d61b Follow-up to r207071: Let newFrontendActionFactory() return a unique_ptr.
This exposed a leak, fix that.

llvm-svn: 207396
2014-04-28 04:57:14 +00:00
Alp Toker 59c6bc5882 libclang: split out the documentation comment API
It's possible that the "comment AST" may be replaced or split out in the
midterm, any anyway this makes the headers easier to read.

Developers don't currently need to include "clang-c/Documentation.h" explicitly
and there's no macro to test for availability yet.

The raw comment and brief comment accessors have been kept in Index.h though
brief support may also move here as a separate proposal.

This is not a deprecation, just a gentle separation of concerns as we look to
simplify the built-in representation of comment nodes and support external
comment processors.

llvm-svn: 207392
2014-04-28 02:39:27 +00:00
Argyrios Kyrtzidis 7dd3133433 [objcmt] Revert r191796, it's not needed anymore.
rdar://16223810

llvm-svn: 207391
2014-04-28 02:38:51 +00:00
Saleem Abdulrasool 2b99f2f7a4 CodeGen: remove an unused variable
llvm-svn: 207390
2014-04-28 02:29:11 +00:00
Argyrios Kyrtzidis d6eb2b9f4d [SemaCXX] Silence -Wconstant-logical-operand if the operand is a 0/1 from a macro.
Libraries specify enabled/disabled features using macro defs of 0/1, in such cases the -Wconstant-logical-operand
is noise.

rdar://15410291

llvm-svn: 207386
2014-04-28 00:20:16 +00:00
Argyrios Kyrtzidis 7daabbd5d0 [Index/DocComments] When cloning a full comment, pick the template parameters from the original FullComment,
if the parameters are not already set (e.g. because it is a typedef).

Fixes crash of rdar://16128173

llvm-svn: 207382
2014-04-27 22:53:03 +00:00
Sylvestre Ledru 7db5ab49cd remove less relevant information + about packaging/Mac OS X + link to cfe-dev
llvm-svn: 207362
2014-04-27 15:17:15 +00:00
Sylvestre Ledru ba3f838e70 Remove no longer relevant information in the gcc/llvm comparison page + minor updates
llvm-svn: 207361
2014-04-27 15:02:05 +00:00
Sylvestre Ledru 464902589e remove useless code
llvm-svn: 207360
2014-04-27 14:57:31 +00:00
Sylvestre Ledru 39f85b185c Remove deprecated information about performances:
* It is better if we leave third parties to do "independent" benchmark.
* We compare Clang (version unspecified) with gcc 4.0 or 4.2.
* The graphs have not been updated for a while.
* Clang is well known now. I don't think we still need to explain why
Clang is great.

llvm-svn: 207358
2014-04-27 14:54:11 +00:00
Daniel Jasper 66935020c4 clang-format: Fix bug when aligning trailing /**/-comments in macros.
Previously this could lead to a column limit violation with the
required escaped newlines.

llvm-svn: 207351
2014-04-27 10:03:19 +00:00
Sylvestre Ledru d08e5b9655 Fix the method len of the CompletionString object. Patch by Christopher Greene
llvm-svn: 207348
2014-04-27 04:42:55 +00:00
NAKAMURA Takumi 7c301b4b86 c-arcmt-test/Makefile: Update USEDLIBS for -static.
llvm-svn: 207340
2014-04-27 03:40:51 +00:00
Argyrios Kyrtzidis 357b36a2c0 [SemaObjC] Fix ObjCInterfaceDecl::inheritsDesignatedInitializers(), if there are no
designated initializers in the super class hierarchy then it should return false.

rdar://16692535

llvm-svn: 207332
2014-04-26 21:28:41 +00:00
Argyrios Kyrtzidis ea75aad379 [Sema] Adjust Sema::getCurBlock()/getCurLambda() to take into account that we may have
switch CurContext due to class template instantiation.

Fixes crash of the included test case.
rdar://16527205

llvm-svn: 207325
2014-04-26 18:29:13 +00:00
Alp Toker 87d3975369 libclang: remove 'CXDiagnostic_Remark'
The change was landed without review or test cases.

It trivially broke almost any stable application checking for Severity >=
CXDiagnostic_Error or indeed any other kind of severity comparison upon
encountering a 'remark'.

Mapped to CXDiagnostic_Warning until a workable solution is proposed to the
list that preserves API stability.

(It's also not clear why the rest of r202475 wasn't simply implemented as a
modifier to the existing 'warning' level.)

llvm-svn: 207319
2014-04-26 14:43:53 +00:00
Nick Lewycky 0c2986f78e Add mangling for attribute enable_if. The demangling patch for libcxxabi is still in review.
llvm-svn: 207296
2014-04-26 00:14:00 +00:00
Warren Hunt f0ffdb2e60 Fixed Assert In CGRecordLowering
Prior to this patch, CGRecordLower assumed that virtual bases could not 
be placed before the nvsize of an object.  This isn't true in Itanium 
mode, virtual bases are placed at dsize rather than vnsize and in the 
case of zero sized non-virtual bases nvsize can be larger than dsize.  
This patch fixes CGRecordLowering to avoid an assert and to clip 
bitfields properly in this case.  A test case is included.

llvm-svn: 207280
2014-04-25 21:56:30 +00:00
Saleem Abdulrasool b9f07e3dbc CodeGen: add __yield intrinsic for ARM
The __yield intrinsic generates a hint instruction to indicate that the thread
is not performing any useful operations at the moment.  This is for
compatibility with MSVC, although, the intrinsic is also part of the ACLE, and
is enabled globally as a result.

llvm-svn: 207275
2014-04-25 21:13:29 +00:00
Benjamin Kramer 694acb3375 Make test pass on 32 bit architectures.
llvm-svn: 207268
2014-04-25 20:49:10 +00:00
Benjamin Kramer 1adc8c3391 Print detailed vector type information on diagnostics.
We never aka vector types because our attributed syntax for it is less
comprehensible than the typedefs. This leaves the user in the dark when
the typedef isn't named that well.

Example:
  v2s v; v4f w;
  w = v;

The naming in this cases isn't even that bad, but the error we give is
useless without looking up the actual typedefs.
t.c:6:5: error: assigning to 'v4f' from incompatible type 'v2s'

Now:
t.c:6:5: error: assigning to 'v4f' (vector of 4 'float' values) from
    incompatible type 'v2s' (vector of 2 'int' values)

We do this for all diagnostics that print a vector type.

llvm-svn: 207267
2014-04-25 20:41:38 +00:00
Nico Weber e68b847fdb Fix leak of GlobalModuleIndex::IdentifierIndex, found by LSan.
llvm-svn: 207262
2014-04-25 19:45:23 +00:00
Richard Smith 6c6ef822b0 PR19558: don't produce an "unused variable" warning for a variable template partial specialization.
llvm-svn: 207260
2014-04-25 19:21:40 +00:00
Saleem Abdulrasool 0fd930e86c CodeGen: replace use of @llvm.arm.sevl with @llvm.arm.hint
Use the new generic @llvm.arm.hint hint intrinsic rather than the specialised
@llvm.arm.sevl hint instruction.

llvm-svn: 207243
2014-04-25 17:25:46 +00:00
David Majnemer 01bbd1b1c3 CodeGen: Cleanup variable linkage calculation
Almost all linkage calculation for VarDecls occured inside of
GetLLVMLinkageVarDefinition except for static data members.  Centralize
the logic so that it can be more readily reused.

No functionality change.

llvm-svn: 207241
2014-04-25 17:08:41 +00:00
David Majnemer f6acb76cb6 CodeGen: Refactor linkage/visibility calculation
It turns out that linkage and visibility have rather similar logic for
both functions and non-variable globals.  Split the calculation out so
that both sides may share this code.

No functionality change.

llvm-svn: 207239
2014-04-25 17:07:16 +00:00
David Blaikie 103a2de0b4 Push unique_ptr ownership of ASTUnits further back into their factories.
llvm-svn: 207237
2014-04-25 17:01:33 +00:00
Hans Wennborg 26a4430ee5 clang-cl: /fallback only applies to C or C++ files
We would previously hit an assert if using /fallback with an .ll file.

llvm-svn: 207234
2014-04-25 16:44:17 +00:00
Hans Wennborg bbb5f07626 clang-cl: pass -debug flag to the linker when compiling with debug info
llvm-svn: 207233
2014-04-25 16:24:19 +00:00
David Blaikie 39808ff901 Improve ownership of ASTUnits in libTooling by using std::unique_ptr.
llvm-svn: 207229
2014-04-25 14:49:37 +00:00
Rafael Espindola f828526268 Revert "Reland r206934 with a hopefully fixed test"
This reverts commit r207155.
The test was still failing.

llvm-svn: 207225
2014-04-25 13:29:03 +00:00
Kostya Serebryany d0f841ce4a fix a test-only leak found by lsan, PR19521
llvm-svn: 207223
2014-04-25 12:58:42 +00:00
Justin Bogner 3212b18bbf CodeGen: Avoid instrumenting implicit Decls more effectively
We don't assign counters for implicit Decls, but we were emitting code
to increment the (non-existent) counters and adding empty counter
lists in the output. This fixes the checks in assignRegionCounters and
emitInstrumentationData to do the right thing, and adds an assert for
the pathological case of emitting zero counters.

llvm-svn: 207203
2014-04-25 07:20:05 +00:00
Saleem Abdulrasool 05f9613610 bindings: expose C++ access specifiers
Expose the enum CX_CXXAccessSpecifier in the python bindings as a property of
the cursor.  If access specifier is not applicable to the node, return the
INVALID specifier rather than raising an exception.

Patch by Tamás Szeli!

llvm-svn: 207173
2014-04-25 02:58:03 +00:00
Reid Kleckner 02fefcfc3b Reland r206934 with a hopefully fixed test
llvm-svn: 207155
2014-04-24 23:06:17 +00:00
Richard Smith eb36ddf462 If we see an explicit instantiation declaration or definition of a function
after we've already instantiated a definition for the function, pass it to the
ASTConsumer again so that it knows the specialization kind has changed and can
update the function's linkage.

This only matters if we instantiate the definition of the function before we
reach the end of the TU; this can happen in at least three different ways:
C++11 constexpr functions, C++14 deduced return types, and functions
instantiated within modules.

llvm-svn: 207152
2014-04-24 22:45:46 +00:00
Nico Weber d19e6a7e54 MicrosoftVTableContext: Don't leak VPtrInfos. Found by LSan, PR19522.
llvm-svn: 207138
2014-04-24 19:52:12 +00:00
Nico Weber 655af097a1 Fix a tiny test-only leak, found by LSan.
llvm-svn: 207137
2014-04-24 19:04:10 +00:00
Hans Wennborg ac156e2225 Intrin.h: remove __rdtsc and __rdtscp declarations
Since r207132, these are defined in ia32intrin.h.

llvm-svn: 207134
2014-04-24 18:40:06 +00:00
Andrea Di Biagio 7ceec07cf6 [X86] Add Clang support for intrinsics __rdtsc and __rdtscp.
This patch:
 1. Adds a definition for two new GCCBuiltins in BuiltinsX86.def:
   __builtin_ia32_rdtsc;
   __builtin_ia32_rdtscp;

 2. Replaces the already existing definition of intrinsic __rdtsc in
    ia32intrin.h with a simple call to the new GCC builtin __builtin_ia32_rdtsc.

 3. Adds a definition for the new intrinsic __rdtscp in ia32intrin.h

llvm-svn: 207132
2014-04-24 18:26:35 +00:00
Jordan Rose 7d2a5e6862 Squelch leak found by LSan by handling missing switch case.
Also, use the enum type in the switch so this doesn't happen again.

PR19523

llvm-svn: 207128
2014-04-24 17:27:18 +00:00
Daniel Sanders 81ea601b54 [mips] Support 128-bit int in N32 ABI by overriding TargetInfo::hasInt128Type()
Summary: The condition in the base class is rather strange. It says a target has the 128-bit integer type if the size of a pointer is >= 64-bits. N32 has 32-bit pointers but 64-bit integers. I'm a bit reluctant to change this for all targets so this patch makes the method virtual and overrides it for MIPS64.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D3472

llvm-svn: 207121
2014-04-24 16:05:26 +00:00
Tim Northover f4aee52345 AArch64: update tests to new way of printing NEON lists.
llvm-svn: 207117
2014-04-24 14:06:31 +00:00
NAKAMURA Takumi 3f27673e40 CommentToXMLConverter: Don't use "default" to method(s). It is unavailable in msc17.
llvm-svn: 207107
2014-04-24 12:44:34 +00:00
Daniel Sanders ff1c044ada [mips] Correct size_t and ptrdiff_t for N32.
Summary:
Correct size_t to be unsigned int and ptrdiff_t to be signed long. The types were the correct size before this change but
the exact type matters for name mangling and exception handling in C++.

Reviewers: atanasyan

Reviewed By: atanasyan

Differential Revision: http://reviews.llvm.org/D3470

llvm-svn: 207093
2014-04-24 09:58:52 +00:00
Dmitri Gribenko 4f4dd17d05 Comment to XML conversion: use unique_ptr for SimpleFormatContext
llvm-svn: 207087
2014-04-24 07:52:31 +00:00
Argyrios Kyrtzidis edfe07fca0 Simplify leak fix of r207076, by just disposing the previous CXString.
llvm-svn: 207081
2014-04-24 06:05:40 +00:00
Nico Weber dc493cf13b Don't leak _all_ directives in -verify mode. Found by LSan, PR19520.
llvm-svn: 207079
2014-04-24 05:39:55 +00:00
Nico Weber 568dacc4aa Don't leak invalid RegexDirectives. Probably a small part of PR19520.
llvm-svn: 207077
2014-04-24 05:32:03 +00:00
Nico Weber aacf0313a5 Fix two leaks found by LSan.
A CursorPlatformAvailability can have several "unavailable" attributes, don't
leak all but the first.  I'm not sure if there can be several "deprecate"ds too,
but add the same logic there to keep the two code paths looking the same.

llvm-svn: 207076
2014-04-24 05:16:45 +00:00
Nico Weber dbd07fadae Fix two leaks found by LSan (one is test-only).
The result of llvm::MemoryBuffer::getMemBuffer() needs to be freed. Don't
pass "don't free" flag to overrideFileContents() to fix.

llvm-svn: 207075
2014-04-24 04:58:41 +00:00
Nico Weber 4fcf0c7b29 Fix two test-only leaks found by LSan.
The result of getBufferForFile() must be freed.
(Should we change functions that expect the caller to assume ownership so
that they return unique_ptrs instead? Then the type system makes sure we get
this right.)

llvm-svn: 207074
2014-04-24 04:26:18 +00:00
Nico Weber 82098cb6df Fix two leaks in c-index-test found by LSan.
The result of clang_getCursorSpelling() needs to be clang_getCursorSpelling()ed.

llvm-svn: 207073
2014-04-24 04:14:12 +00:00
Nico Weber 52fbbb16a1 Fix four more test-only leaks found by LSan.
Tool::run() doesn't take ownership of the passed action.

llvm-svn: 207071
2014-04-24 03:48:09 +00:00
Nico Weber 1f29ccf3fb Revert the "don't leak" part of r207065, looks like the bots don't like it :-/
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/22506

llvm-svn: 207070
2014-04-24 03:31:27 +00:00
Nico Weber 7c3ccb032e Fix 3 test-only leaks found by LSan.
llvm-svn: 207068
2014-04-24 03:30:22 +00:00
Nico Weber 7deebef657 More spellchecking for Index.h
llvm-svn: 207067
2014-04-24 03:17:47 +00:00
Nico Weber dd9c19fe94 compeltions are never appropriate.
llvm-svn: 207066
2014-04-24 03:06:18 +00:00
Nico Weber 7de358e936 Don't leak objects in load-from-ast path unless DisableFree is set.
Also update a comment to match a code change that was done in r110978.

llvm-svn: 207065
2014-04-24 02:42:04 +00:00
Richard Smith f17fdbd791 When two templates get merged together, also merge their pattern declarations
together. This is extremely hairy, because in general we need to have loaded
both the template and the pattern before we can determine whether either should
be merged, so we temporarily violate the rule that all merging happens before
reading a decl ends, but *only* in the case where a template's pattern is being
loaded while loading the template itself.

In order to accomodate this for class templates, delay loading the injected
class name type for the pattern of the template until after we've loaded the
template itself, if we happen to load the template first.

llvm-svn: 207063
2014-04-24 02:25:27 +00:00
Michael J. Spencer 807cf41e2f Fix test to not depend on llvm optimizations.
llvm-svn: 207062
2014-04-24 02:16:29 +00:00
Nico Weber 1ada62654f Bury leaked sema pointer when reading from AST files.
Should suppress several LSan reports.

llvm-svn: 207056
2014-04-24 00:51:03 +00:00
Nico Weber 303ff60693 Fix another leak in ParseMicrosoftAsmStatement(), found by LSan.
llvm-svn: 207040
2014-04-23 22:07:21 +00:00
Reid Kleckner cae82a205e Suppress unused variable warning
llvm-svn: 207039
2014-04-23 22:03:04 +00:00
Richard Trieu d19d9dd365 Change -Wfloating-point-conversion to -Wfloat-conversion.
llvm-svn: 207037
2014-04-23 21:53:59 +00:00
Abramo Bagnara 6a9eaa2ebf Fixed comments (thanks to Richard Smith).
llvm-svn: 207036
2014-04-23 21:49:00 +00:00
Nico Weber 2d942deb19 Make RewriteRope less confusing for me. No intended behavior change.
llvm-svn: 207032
2014-04-23 21:42:27 +00:00
Nico Weber 795f6a9d7c Fix leak introduced in r194610, found by LSan.
LSan folks: LSan pointed to
    #0 0x4953e0 in operator new[](unsigned long) llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:64
    #1 0x7fb82af5372f in clang::RewriteRope::MakeRopeString(char const*, char const*) llvm/tools/clang/lib/Rewrite/Core/RewriteRope.cpp:796
instead of to the actual leak, which made tracking this down slower than
it could have been.

llvm-svn: 207031
2014-04-23 21:41:51 +00:00
Abramo Bagnara b8dcece68f Moved operator delete to public area to appease gcc and conform to C++ standard.
llvm-svn: 207027
2014-04-23 21:28:18 +00:00
Ben Langmuir ffbafa2af0 Do not print inferred submodules explicitly in __inferred_module.map
Otherwise including a header in your source file that is not included by
framework's umbrella header will silently add an empty submodule with that
name.

is automatically translated to
@import Foo.NotInModule;

which then would have succeeded because the inferred module map
contained an empty submodule called NotInModule.

llvm-svn: 207024
2014-04-23 21:10:46 +00:00
Nico Weber 01708cdcad Fix a memory leak found by LSan.
llvm-svn: 207013
2014-04-23 19:19:20 +00:00
John Thompson 2d94bbb0c0 Quick fix for layering that broke shared library build.
llvm-svn: 207011
2014-04-23 19:04:32 +00:00
Reid Kleckner e9591b33e2 MS ABI: Use a different guard variable for each weak global
We were using the same guard variable and failing to initialize the
second global.

Clang is still not MS ABI compatible in this area.  Fixing that is
PR16959, which will require LLVM changes to @llvm.global_ctors.

llvm-svn: 207008
2014-04-23 18:22:11 +00:00
Richard Smith 5b21db89d0 Make TypeDecl much less friendly.
llvm-svn: 207007
2014-04-23 18:20:42 +00:00
Fariborz Jahanian 9da2a799ab Objective-C [IRGen]. Fixes a crash in IRGen involving use of
'typeof' to extract type of an @encode expression used
in an initializer. // rdar://16655340

llvm-svn: 207004
2014-04-23 17:44:58 +00:00
Jordan Rose e811ab9582 [analyzer] Fix a leak found by LSan.
PR19524

llvm-svn: 207001
2014-04-23 16:54:52 +00:00
Alexander Kornienko fe65998777 Don't pass llvm::DenseSet<> by value.
Summary: Fixes massive performance problems on large translation units.

Reviewers: jordan_rose

Reviewed By: jordan_rose

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3471

llvm-svn: 206999
2014-04-23 16:39:41 +00:00
Diego Novillo 9e43084fb4 Review feedback.
llvm-svn: 206997
2014-04-23 15:21:23 +00:00
Diego Novillo 897c59ce09 Review feedback.
llvm-svn: 206996
2014-04-23 15:21:21 +00:00
Diego Novillo 8ebff32487 Review feedback
llvm-svn: 206995
2014-04-23 15:21:20 +00:00
Diego Novillo a5256bf9fd Add documentation for sample profiling support.
Summary:
This documents the usage of sample profilers with Clang and the
profile format expected by LLVM's optimizers. It also documents the
profile conversion tool used by Linux Perf.

Reviewers: doug.gregor

CC: cfe-commits

Differential Revision: http://reviews.llvm.org/D3402

llvm-svn: 206994
2014-04-23 15:21:07 +00:00
NAKAMURA Takumi ec9a7c0449 Prune \param introduced in r206977, possibly committed ahead. [-Wdocumentation]
llvm-svn: 206993
2014-04-23 15:13:39 +00:00
Logan Chien bf9e3843c4 Add missing test input for r206979.
llvm-svn: 206992
2014-04-23 15:00:03 +00:00
Aaron Ballman 47bff44d3d The rewrite constructor should actually rewrite.
llvm-svn: 206987
2014-04-23 14:40:19 +00:00
Aaron Ballman 8e8026d5b3 Replacing a naked pointer with a unique_ptr. No functional changes intended.
llvm-svn: 206986
2014-04-23 14:26:59 +00:00
Aaron Ballman b834050953 Minor formatting and simplification cleanup -- no functional changes intended.
llvm-svn: 206985
2014-04-23 14:22:06 +00:00
Aaron Ballman bf58a6a892 Updated to be a bit more const friendly. Also switched the linkage to be static since this function is file-local. No functional changes intended.
llvm-svn: 206982
2014-04-23 13:58:21 +00:00
John Thompson e0a5afe812 Fix unused variable.
llvm-svn: 206981
2014-04-23 13:45:44 +00:00
Logan Chien 6a00cc8306 Add aarch64-linux-android triple for Android.
llvm-svn: 206979
2014-04-23 13:36:23 +00:00
John Thompson 2255f2ce90 Initial implementation of -modules-earch-all option, for searching for symbols in non-imported modules.
llvm-svn: 206977
2014-04-23 12:57:01 +00:00
Timur Iskhodzhanov 9f23b203d3 Add yet another vtordisp test
llvm-svn: 206974
2014-04-23 12:46:26 +00:00
Rafael Espindola e3e047e768 This reverts commit r206934 and r206935.
The original messages were:
  "Driver: Honor %INCLUDE% when built with MinGW"
  "Add missing test triples"

The test was still failing on OS X.

llvm-svn: 206973
2014-04-23 12:38:13 +00:00
Evgeniy Stepanov eeb820f572 Update Target::createMCAsmParser calls for the LLVM interface change.
Patch by Yuri Gorshenin.

llvm-svn: 206970
2014-04-23 11:15:49 +00:00
James Molloy 3a9a023eb6 [ARM64] Enable more CodeGen tests for ARM64. The crypto and neon intrinsics tests needed changing slightly due to the naming differences between AArch64 and ARM64.
llvm-svn: 206964
2014-04-23 10:26:23 +00:00
James Molloy 8bdd24b1a9 [ARM64] Change inline assembly constraints to be more lax, to match the behaviour of Clang/AArch64 and GCC.
GCC allows sub-64bit values to use the 'r' register constraint.

llvm-svn: 206963
2014-04-23 10:26:19 +00:00
James Molloy a7a23c1cce [ARM64] Enable the test aarch64-type-sizes.c for ARM64 BE.
This completes the port of r203918 (cpirker "AArch64_be specific clang target settings") to ARM64.

llvm-svn: 206962
2014-04-23 10:26:12 +00:00
James Molloy 7f4ba53ef0 [ARM64] Add a missed case label for arm64_be, and enable the aarch64-varargs test for arm64_be.
This ensures that r203917 (cpirker "AArch64_be varargs processing for ARM ABI") is ported to ARM64.

llvm-svn: 206961
2014-04-23 10:26:08 +00:00
David Majnemer e3785bb03e MS ABI: Implement mangling for ref-qualifiers on methods
Mangle ref-qualifiers like the Nov 2013 CTP.

This fixes PR19361.

llvm-svn: 206946
2014-04-23 05:16:56 +00:00
David Majnemer b926dbcfe3 MS ABI: Use range-based for loops in the mangler
No functional change.

llvm-svn: 206945
2014-04-23 05:16:53 +00:00
David Majnemer 02e9af4032 MS ABI: Cleanup some egregious style violations
No functional change.

llvm-svn: 206944
2014-04-23 05:16:51 +00:00
David Majnemer c7b85c4380 AST: Cleanup/simplify some LV calculation code
No functional change.

llvm-svn: 206943
2014-04-23 05:16:48 +00:00
Justin Bogner 0cbb6d86c8 CodeGen: Unify handling guard variables in the Itanium C++ ABI
We previously treated ARM separately from the generic Itanium ABI for
initializing guard variables. This code duplication led to things like
the ARM path missing the memory barrier for threadsafe handling, and a
highly misleading comment about how we were (mis)using the generic ABI
for ARM64 when really it went through the ARM codepath.

This unifies the two code paths. Functionally, this changes the ARM
and ARM64 codepath to use one byte loads instead of 4 and 8,
respectively, and adds the missing atomic acquire to these loads.
Other architectures are unchanged.

llvm-svn: 206937
2014-04-23 01:50:10 +00:00
Reid Kleckner c85b9a5f54 Add missing test triples
llvm-svn: 206935
2014-04-23 00:57:34 +00:00
Reid Kleckner 9aff2ca27c Driver: Honor %INCLUDE% when built with MinGW
Users are expected to pass system includes through the INCLUDE
environment variable on Windows.  There's no reason to change behavior
based on the toolchain used to build Clang.

I didn't change the registry searching code because I'm not sure it
builds with mingw and I'm not set up to test it.

llvm-svn: 206934
2014-04-23 00:15:12 +00:00
Reid Kleckner 77b45ba301 Driver: Avoid a duplicate path separator and clean up code
llvm-svn: 206933
2014-04-23 00:15:01 +00:00
Richard Smith 70ee92fa4d Add some missing checks for C++1y digit separators that don't in fact separate
digits. Turns out we have completely separate lexing codepaths for floating
point numbers depending on whether or not they start with a zero. Who knew...
=)

llvm-svn: 206932
2014-04-22 23:50:25 +00:00
Richard Smith 06ffb45ce4 PR18746: If a constexpr function has a dependent return type and no return
statements, don't diagnose; the return type might end up being 'void'.

Patch by Rahul Jain! Tiny tweaks by me.

llvm-svn: 206929
2014-04-22 23:14:23 +00:00
Justin Bogner f893a6551b Driver: Skip the -fmodules-cache-path argument in driver crash diags
The modules cache path shouldn't be included in crash reports, as it's
a system (or run) specific directory.

llvm-svn: 206922
2014-04-22 21:30:17 +00:00
Diego Novillo b344224949 Use a manipulator to add a value to the current diagnostic flag.
Summary:
This addresses the feedback to
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140421/103598.html

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3453

llvm-svn: 206920
2014-04-22 19:56:49 +00:00
Quentin Colombet 6a9cf2629a [Driver][ARM64] Add a testcase for r206227.
llvm-svn: 206914
2014-04-22 18:29:43 +00:00
Fariborz Jahanian 953d18a988 Objective-C ARC. Under ARC, addition of 'bridge' attribute
on CF type is not sufficient and bridge casting is
still required for proper ownership semantics.
// rdar://16650445

llvm-svn: 206910
2014-04-22 17:42:01 +00:00
Ben Langmuir 749323fadb Attempt to fix null ASTContext in ASTUnit error path
We don't need the ASTContext for the diagnostics, only the language
options, which we can get from the compiler invocation. It worries me
how many categorically different states the ASTUnit class can be in
depending on how it is being constructed/used.

llvm-svn: 206909
2014-04-22 17:40:12 +00:00
Timur Iskhodzhanov 6b12850d27 Fix PR19487, PR19505 and PR19506 -- redundant vtordisp thunks when the final overrider is present in both a vbase and nvbase
Reviewed at http://reviews.llvm.org/D3449

llvm-svn: 206908
2014-04-22 17:32:02 +00:00
DeLesley Hutchins f1a311653a Thread safety analysis: add array operations to SExpr.
llvm-svn: 206907
2014-04-22 17:31:23 +00:00
DeLesley Hutchins 7834001496 Thread safety analysis: fix warning.
llvm-svn: 206899
2014-04-22 14:51:04 +00:00
NAKAMURA Takumi 7c0cd63d0d Try to fix warnings to escape '@' as '\@'. [-Wdocumentation-html]
clang/include/clang/Format/Format.h:185:8: error: HTML tag 'tt' requires an end tag [-Werror,-Wdocumentation-html]
    /// <tt>@property (readonly)</tt> instead of <tt>@property(readonly)</tt>.
        ~^~~

llvm-svn: 206893
2014-04-22 13:28:08 +00:00
Alexander Musman 8dba66412b [OPENMP] parsing 'linear' clause (for directive 'omp simd')
Differential Revision: http://reviews.llvm.org/D3272

llvm-svn: 206891
2014-04-22 13:09:42 +00:00
Tim Northover 761aa37e3e ARM64: update NEON test to improved backend codegen
llvm-svn: 206890
2014-04-22 12:45:55 +00:00
Dmitri Gribenko 6db07e2ab7 Comment parsing: close a hole in CDATA escaping in XML output
llvm-svn: 206886
2014-04-22 12:34:52 +00:00
Dmitri Gribenko 93043620bc Comment parsing: in the generated XML file, mark HTML that is safe to pass
through to the output even if the input comment comes from an untrusted source

Attribute filtering is currently based on a blacklist, which right now includes
all event handler attributes (they contain JavaScipt code).  It should be
switched to a whitelist, but going over all of the HTML5 spec requires a
significant amount of time.

llvm-svn: 206882
2014-04-22 10:59:13 +00:00
NAKAMURA Takumi f7e53446cd DiagnosticsEngine::Report(): Fix a warning. [-Wdocumentation]
llvm-svn: 206871
2014-04-22 08:32:01 +00:00
NAKAMURA Takumi 1fce16934f Update clang/test/PCH/single-token-macro.c corresponding to r206791.
__stdcall is defined as __attribute__((__stdcall__)) for targeting mingw32.

llvm-svn: 206870
2014-04-22 08:16:58 +00:00
Chandler Carruth 1034666777 [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, clang edition.

If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.

llvm-svn: 206849
2014-04-22 03:17:02 +00:00
Richard Smith e334c01773 Move the C++11 ExtWarn for converting a string literal to 'char*' out of
-Wc++11-compat-deprecated-writable-strings. It's neither a C++11 compatibility
warning nor a deprecated feature, it's just ill-formed.

In passing, add that warning to -Wdeprecated, where it belongs.

llvm-svn: 206833
2014-04-22 01:11:06 +00:00
Richard Trieu 393197a08e Move the warning of implicit cast of a floating point to an integer out of
-Wconversion and into it's own group, -Wfloating-point-conversion.

llvm-svn: 206832
2014-04-22 01:01:05 +00:00
DeLesley Hutchins f8b412adbb Thread safety analysis: misc updates to SExpr handling. Fix to minimal SSA,
function parameters, and compound assignment.

llvm-svn: 206827
2014-04-21 23:18:18 +00:00
Diego Novillo 9f23997732 Allow adding a value to a flag in diagnostics.
Summary:
This allows callers of Diags.Report() to append a value to the name of
the flag associated with the diagnostic. This is useful in cases like
the -Rpass flag, where we want the diagnostic to show the name of the
pass that matched the pattern. Instead of showing "... [-Rpass]", this
allows us to show "... [-Rpass=passname]".

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://reviews.llvm.org/D3441

llvm-svn: 206826
2014-04-21 23:16:03 +00:00
Chandler Carruth 57f5fbe3b2 [Modules] Update Clang's two files that use DEBUG(...) without defining
DEBUG_TYPE to do so. LLVM's Debug.h requires this as of r206822.

llvm-svn: 206823
2014-04-21 22:55:36 +00:00
Chandler Carruth 48ec7c0569 [Modules] Remove the only use of the DEBUG(...) macro in the compiler
parts of Clang. I don't really have any opinion about whether using that
macro is good or bad, but its odd that this is the only one, and Eric
seemed happy with just nuking it for now.

llvm-svn: 206806
2014-04-21 22:32:54 +00:00
Reid Kleckner 70cfa66fe3 Try to fix bad Twine usage in r206791 with std::string
I'm pretty sure I was referencing destroyed temporaries here.  I'm open
to suggestions on how to write this better.

llvm-svn: 206804
2014-04-21 22:29:45 +00:00
Reid Kleckner 4760683b04 MinGW: Define __stdcall&co when -fms-extensions is disabled
This is for compatibility with GCC.

Reviewers: asl

Differential Revision: http://reviews.llvm.org/D3444

llvm-svn: 206791
2014-04-21 20:58:00 +00:00
Timur Iskhodzhanov d60ae72c42 Split out the rest of MS ABI multiple inheritance tests
Intentionally duplicate base class definitions per test, so it's easier to copy tests while debugging failures.

llvm-svn: 206782
2014-04-21 20:23:34 +00:00
Fariborz Jahanian 29cdbc6319 Objective-C. Patch to allow use of dot syntax on class
objects to fund root class's instance methods.
// rdar://16650575

llvm-svn: 206781
2014-04-21 20:22:17 +00:00
Ben Langmuir 4898cde4e1 Allow submodule inferrences with a missing umbrella when the module is unavailable
If the module is unavailable because of a missing header, don't diagnose
a "module * {}" declaration for having a missing umbrella.

llvm-svn: 206776
2014-04-21 19:49:57 +00:00
Ted Kremenek dd21b89a25 Handle possible trailing '/' in xcode-select output. Patch by Jeff Olson.
llvm-svn: 206752
2014-04-21 14:13:22 +00:00
Richard Smith 86dbed7577 Initialize clang::Module::IsMissingRequirement. Fix msan issue and hopefully some builder failures.
llvm-svn: 206736
2014-04-21 07:28:16 +00:00
Bob Wilson 373af73ad4 ARM64: Do not expand variadic HFA/HVA arguments with the Darwin ABI.
Unlike the standard AAPCS64 ABI, variadic arguments are always passed on the
stack with the Darwin ABI, and this was not being considered when deciding
whether to expand HFA/HVA arguments in a call. An HFA argument with a "float"
base type was being expanded into separate "float" arguments, each of which
was then extended to a double, resulting in a serious mismatch from what is
expected by the va_arg implementation. <rdar://problem/15777067>

llvm-svn: 206729
2014-04-21 01:23:39 +00:00
Bob Wilson 3abf169549 Fix a comment typo.
llvm-svn: 206728
2014-04-21 01:23:36 +00:00
Alp Toker 3a3ee3e376 cindex.py: Avoid deprecated function
Implement Diagnostic::category_name() using clang_getDiagnosticCategoryText()
instead of the deprected clang_getDiagnosticCategoryName().

Preserves existing behaviour and API covered by existing tests.

llvm-svn: 206712
2014-04-20 01:07:03 +00:00
Alp Toker 5f072d814f Remove some empty statements
Cleanup only.

llvm-svn: 206709
2014-04-19 23:55:49 +00:00
Alp Toker f424a597df Fix and restore the macro-multiline.c test
This test didn't work as intended and was ultimately disabled some years ago in
r169458.

Indeed it's not clear if the '\n' was ever passed through to the driver
correctly given that lit would insert '&& {' at the newline.

Test rewritten to use printf/xargs to insert '\n' in a more reliable manner and
to use FileCheck for verification.

llvm-svn: 206703
2014-04-19 21:40:58 +00:00
Alp Toker 07508405f4 Disallow driver use in more Sema tests
There are now only a handful of Sema tests remaining that use %clang in
SemaCXX, SemaObjC and SemaTemplate.

llvm-svn: 206688
2014-04-19 19:07:31 +00:00
Alp Toker 8ee5b01f34 Move ObjC Cocoa.h header test to Headers
This tests for broad compatibility with platform SDK headers using the clang
driver and so belongs alongside the other header ingtegration tests.

llvm-svn: 206687
2014-04-19 19:07:24 +00:00
Alp Toker 7591a05d14 Re-enable the C++11 modules integration test on OS X
XCode 5.1.1 has shipped with fixed SDK headers.

This reverts commit r200256.

Fixes PR18322.

llvm-svn: 206686
2014-04-19 19:07:19 +00:00
NAKAMURA Takumi f0c40f7952 clang/test/Index/pch-with-errors.c: Remove XFAIL added in r206294. It has been fixed since r206644.
llvm-svn: 206685
2014-04-19 16:49:22 +00:00
Richard Smith 3c326b36cc Speculative fix for buildbot failure. Apparently Clang 3.1 got move semantics wrong.
llvm-svn: 206682
2014-04-19 04:28:00 +00:00
DeLesley Hutchins a9db0019a2 Thread Safety Analysis: Convert to minimal SSA.
llvm-svn: 206681
2014-04-19 03:54:41 +00:00
Richard Smith cd45dbc5f2 When a module completes the definition of a class template specialization imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations.
llvm-svn: 206680
2014-04-19 03:48:30 +00:00
DeLesley Hutchins ae497deddf Thread Safety Analysis: Update SSA pass to handle loops.
llvm-svn: 206676
2014-04-19 00:35:54 +00:00
Ben Langmuir 993055f860 Fix a hole with nested unavailable submodules from r206664
If a module doesn't meet a requirement, neither do its submodules. If we
don't propogate that, we might think it's an error to be missing a
header in one of those submodules.

llvm-svn: 206673
2014-04-18 23:51:00 +00:00
Justin Bogner 8776638235 CodeGen: Remove an unused include
llvm-svn: 206667
2014-04-18 22:31:07 +00:00
Ben Langmuir ec8c975214 Don't build modules with (submodules with) missing headers
Unless they are in submodules that aren't available anyway, due to
requirements not being met.  Also, mark children as unavailable when the
parent is.

llvm-svn: 206664
2014-04-18 22:07:31 +00:00
Reid Kleckner 230f662d12 Fix sphinx-build warnings in clang docs.
llvm-svn: 206661
2014-04-18 21:55:49 +00:00
Reid Kleckner 5d21c4990f Add support for building Sphinx documentation when being inside LLVM source tree and using CMake
Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

llvm-svn: 206660
2014-04-18 21:55:46 +00:00
Justin Bogner 837a6f6f79 CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read
instrumentation based profile data. This also switches us from the
naive text format to the binary format, since that's what's
implemented in the reader.

llvm-svn: 206658
2014-04-18 21:52:00 +00:00
Justin Bogner fc83c1105c [Cleanup] Remove a trailing whitespace
llvm-svn: 206657
2014-04-18 21:51:09 +00:00
Ben Langmuir 532fdc0d4f Don't read CompilerInstance fields that don't exist in ASTUnit
When transferring data from a CompilerInstance in an error path we need
to consider cases where the various fields are uninitialized.

llvm-svn: 206644
2014-04-18 20:39:48 +00:00
Justin Bogner 25463f1577 Teach users of OnDiskHashTable to define hash_value and offset types
This paves the way to making OnDiskHashTable work with hashes that are
not 32 bits wide and to making OnDiskHashTable work very large hash
tables. The LLVM change to use these types is upcoming.

llvm-svn: 206640
2014-04-18 20:27:24 +00:00
Justin Bogner bb094f0669 Remove OnDiskHashTable.h, since it's been moved to llvm
llvm-svn: 206637
2014-04-18 19:57:06 +00:00
Timur Iskhodzhanov 675bf27ab7 Split out the no-thunk multiple inheritance tests
Also, intentionally duplicate base class definitions per test, so it's easier to copy tests while debugging failures

llvm-svn: 206614
2014-04-18 15:10:05 +00:00
Dmitri Gribenko 62bcd925c0 Add more constness to module-related APIs
llvm-svn: 206595
2014-04-18 14:36:51 +00:00
Tim Northover 4dab69815c ARM64: make sure the caller is expected to extend in AAPCS.
This is one of those DarwinPCS differences. It'd been caught in
arguments, but not return values.

llvm-svn: 206594
2014-04-18 13:46:08 +00:00
Aaron Ballman 0491afaf5f Updating to use more range-based for loops, nullptr and auto. No functional changes.
llvm-svn: 206590
2014-04-18 13:13:15 +00:00
Tim Northover 07f1624aa2 ARM64: make sure HFAs on the stack get properly aligned.
Another AAPCS bug, part of PR19432.

llvm-svn: 206580
2014-04-18 10:47:44 +00:00
Reid Kleckner 7c1db7676e Fix a -Wmicrosoft warning on an unrepresentable enum
0x80000000 isn't representable as an int, which is the default enum
type.

llvm-svn: 206545
2014-04-18 01:21:55 +00:00