Commit Graph

51288 Commits

Author SHA1 Message Date
Richard Smith 5b5d21ea1a Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anything
that implicitly converts to 'bool' (such as pointers, and the first operand of
?:). Clean up issues found by this. Patch by Stephan Tolksdorf!

llvm-svn: 203735
2014-03-12 23:36:42 +00:00
Richard Smith 8e6002f3bd Fix crash if delayed template parsing meets an erroneous trailing return type.
Based on a patch and test by Stephan Tolksdorf! Refactoring and fixing adjacent
brokenness by me.

llvm-svn: 203733
2014-03-12 23:14:33 +00:00
Hans Wennborg d9be72ec44 MS intrinsics: implement the __movs and __stos intrinsics (PR19054)
llvm-svn: 203722
2014-03-12 22:00:32 +00:00
DeLesley Hutchins d13c872187 Thread Safety Analysis: new test case for lambdas
llvm-svn: 203720
2014-03-12 21:33:47 +00:00
Hans Wennborg a4421e03fa MS intrinsics: implement __readgs{byte,word,dword,qword} (PR19054)
llvm-svn: 203715
2014-03-12 21:09:05 +00:00
Hans Wennborg dd0f5304f6 MS intrinsics: don't declare __readeflags and __writeeflags in Intrin.h
They're already defined in ia32intrin.h, and this would cause including Intrin.h
in 64-bit mode to fail because of conflicting types. Update ms-intrin.cpp to
also run in 64-bit mode to catch things like this.

llvm-svn: 203714
2014-03-12 21:09:03 +00:00
Justin Bogner d66a17d0a3 Revert "CodeGen: Use a binary format for instrumentation based profiling"
I've clearly done something wrong with how to get this to link
correctly. Reverting for now.

This reverts commit r203711.

llvm-svn: 203712
2014-03-12 21:06:31 +00:00
Justin Bogner ff9a058267 CodeGen: Use a binary format for instrumentation based profiling
This updates CodeGenPGO to use the ProfileDataReader introduced to
llvm in r203703 and the new API for writing out the profile introduced
to compiler-rt in r203710.

llvm-svn: 203711
2014-03-12 20:53:16 +00:00
Roman Divacky b048007243 Dont unconditionally add gcc4.2 include paths on FreeBSD.
Newer FreeBSD doesnt ship with gcc and defaults to using libc++.

llvm-svn: 203700
2014-03-12 19:32:42 +00:00
Fariborz Jahanian 44be154b04 Objective-C. Issue diagnostics on mismatched methods when their selector is used
in an @selector expression. // rdar://15794055

llvm-svn: 203693
2014-03-12 18:34:01 +00:00
Richard Smith 0fc7bdc821 PR19113: Emit 'vtable' TBAA metadata when loading a vptr in a pointer-to-member-function call.
llvm-svn: 203691
2014-03-12 18:26:14 +00:00
Justin Bogner 4c9c45c060 CodeGen: Move hot/cold logic out of PGOProfileData
llvm-svn: 203689
2014-03-12 18:14:32 +00:00
Richard Smith 66204ecff9 DR1346: a parenthesized braced-init-list cannot be used as the initializer when
performing auto type deduction.

llvm-svn: 203683
2014-03-12 17:42:45 +00:00
Eli Bendersky b5cfa8c2f3 Don't recompute inlining threshold - use new overload provided by LLVM
Follow-up on LLVM r203669

llvm-svn: 203673
2014-03-12 16:30:34 +00:00
Hans Wennborg 501eadb429 Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment.

llvm-svn: 203668
2014-03-12 16:07:46 +00:00
Dmitri Gribenko 340dd5193d Use vector<T>::data() to simplify code
llvm-svn: 203665
2014-03-12 15:35:53 +00:00
Oliver Stannard 7c3c09e23f ARM: Correct alignment of structs passed as byval pointer
When a struct has bitfields overlapping with other members
(as required by the AAPCS), clang uses a packed struct to
represent this. If such a struct is large enough for clang to
pass it as a byval pointer (>64 bytes), we need to set the
alignment of the argument to match the original type.

llvm-svn: 203660
2014-03-12 14:02:50 +00:00
Daniel Jasper da353cd5f1 clang-format: Fix crasher.
Caused by unknown tokens (e.g. "\n") not properly updating the state.

Example:
  const char* c = STRINGIFY(
  \na : b);

llvm-svn: 203645
2014-03-12 08:24:47 +00:00
Craig Topper 4f12f10de4 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203643
2014-03-12 06:41:41 +00:00
NAKAMURA Takumi b19018681a Disable cross-windows-on-linux.cpp for now. It may or may not fail. :/
llvm-svn: 203642
2014-03-12 06:16:26 +00:00
Craig Topper 2b07f0252e [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203641
2014-03-12 05:09:18 +00:00
Craig Topper e14c0f8e73 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203640
2014-03-12 04:55:44 +00:00
Saleem Abdulrasool bfaec9bf8b Lexer: split test into separate files
Unfortunately, XFAIL applies to the entire file.  Split the test into two
different units, enabling the proper application of XFAIL on the test which is
expected to fail on Windows.

llvm-svn: 203633
2014-03-12 02:53:12 +00:00
Saleem Abdulrasool 729b7d357d Lex: reduce buffer size, add a test
Reduce the stack usage as hopefully include paths are usually not too long.  Add
a test case for the path normalisation behaviour.

llvm-svn: 203632
2014-03-12 02:26:08 +00:00
Ben Langmuir dcf73861a5 Add an option -fmodules-validate-system-headers
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.

llvm-svn: 203630
2014-03-12 00:06:17 +00:00
Aaron Ballman e8d69b7fc9 Allow GNU-style attributes on lambda expressions.
llvm-svn: 203628
2014-03-12 00:01:07 +00:00
David Blaikie 124d8a4544 DebugInfo: Remove debug-info-pubtypes.ccp - pubnames/pubtypes are adequately tested in LLVM now.
llvm-svn: 203625
2014-03-11 23:42:49 +00:00
Hans Wennborg ae1c5a88f4 Be case sensitive when determining driver mode based on argv[0] except on Windows
This narrows the impact of r188833 after Dimitry pointed out that it's good to be
able to tell the difference between 'cc' and 'CC'.

llvm-svn: 203624
2014-03-11 23:42:29 +00:00
David Blaikie f9b8472044 DebugInfo: Fix test for LLVM change r203619
I'll fix this to not test assembly in a moment.

llvm-svn: 203623
2014-03-11 23:38:05 +00:00
Duncan P. N. Exon Smith 5c17f8a7e0 PGO: appease the bots after r203592
llvm-svn: 203618
2014-03-11 23:12:31 +00:00
Saleem Abdulrasool 198034105d lex: improve include handling on Linux for Windows
Normalise the path separator character on non-windows platforms.  Although this
would work on Windows as well (most newer versions of Windows support either '/'
or '\' as a path separator character), it could potentially cause problems with
full UNC paths.  This change enables the use of the Windows SDK on Linux which
will not accept '\' as a path separator.

llvm-svn: 203614
2014-03-11 22:41:45 +00:00
David Blaikie 29559b1efa Driver: Support -gmlt as an alias for -gline-tables-only
llvm-svn: 203603
2014-03-11 21:05:26 +00:00
Aaron Ballman 7e1fd018a8 Improving test coverage for lambda expressions with attribute specifiers.
llvm-svn: 203602
2014-03-11 20:32:35 +00:00
Fariborz Jahanian 0c325319cf Objective-C. Prevent an assertion crash due to buggy code
as it can commonly happen. // rdar://16261494

llvm-svn: 203598
2014-03-11 18:56:18 +00:00
Duncan P. N. Exon Smith 0bc22877a2 PGO: Clarify the testing README
<rdar://problem/16276448>

llvm-svn: 203593
2014-03-11 18:18:12 +00:00
Duncan P. N. Exon Smith 38402dc917 PGO: Scale large counters down to 32-bits
PGO counters are 64-bit and branch weights are 32-bit.  Scale them down
when necessary, instead of just taking the lower 32 bits.

<rdar://problem/16276448>

llvm-svn: 203592
2014-03-11 18:18:10 +00:00
Bob Wilson 3ca7904fea Remove trailing whitespace introduced in r203028.
llvm-svn: 203588
2014-03-11 17:17:16 +00:00
Fariborz Jahanian bf678e82e1 Objective-C. Diagose use of undefined protocols
when a class adopts a protocol that inherits from 
undefined protocols. // rdar://16111182

llvm-svn: 203586
2014-03-11 17:10:51 +00:00
Jordan Rose a6839aaa9b [analyzer] Check all conditions in a chained if against each other.
Like the binary operator check of r201702, this actually checks the
condition of every if in a chain against every other condition, an
O(N^2) operation. In most cases N should be small enough to make this
practical, and checking all cases like this makes it much more likely
to catch a copy-paste error within the same series of branches.

Part of IdenticalExprChecker; patch by Daniel Fahlgren!

llvm-svn: 203585
2014-03-11 16:52:29 +00:00
Aaron Ballman c6607cd2a1 Changing this test case to use an unknown attribute, since there are not currently any type attributes which would apply to a lambda, except in MSVC compatibility mode.
llvm-svn: 203566
2014-03-11 13:19:42 +00:00
Aaron Ballman b5c59f5862 Gracefully handle an attribute specifier following a lambda introducer when the parameter list wasn't present.
llvm-svn: 203565
2014-03-11 13:03:15 +00:00
Tim Northover c83472e0ff Sema: demote invalid atomic ordering message to warning.
Someone could write:
  if (0) {
    __c11_atomic_load(ptr, memory_order_release);
  }

or the equivalent, which is perfectly valid, so we shouldn't outright reject
invalid orderings on purely static grounds.

rdar://problem/16242991

llvm-svn: 203564
2014-03-11 11:35:10 +00:00
Daniel Jasper 8f59ae537c clang-format: Avoid unnecessary break before lambda return type.
Before:
  auto aaaaaaaa = [](int i,  // break
                     int j)
                      -> int {
    return fffffffffffffffffffffffffffffffffffffff(i * j);
  };

After:
  auto aaaaaaaa = [](int i,  // break
                     int j) -> int {
    return fffffffffffffffffffffffffffffffffffffff(i * j);
  };

llvm-svn: 203562
2014-03-11 11:03:26 +00:00
Tim Northover e94a34cae2 Sema: produce error when invalid ordering is passed to atomic builtin
This is a conservative check, because it's valid for the expression to be
non-constant, and in cases like that we just don't know whether it's valid.

rdar://problem/16242991

llvm-svn: 203561
2014-03-11 10:49:14 +00:00
Tim Northover 0622b3a67a Update for IR: add a second AtomicOrdering to cmpxchg insts.
rdar://problem/15996804

llvm-svn: 203560
2014-03-11 10:49:03 +00:00
Daniel Jasper a58dd5db29 clang-format: Fix another false positive in the lambda detection.
Before:
  int i = (*b)[a] -> f();

After:
  int i = (*b)[a]->f();

llvm-svn: 203557
2014-03-11 10:03:33 +00:00
Daniel Jasper d3c7ab975f clang-format: Fix incorrect lambda recognition exposed by r203452.
Before:
  int i = a[a][a] -> f();

After:
  int i = a[a][a]->f();

llvm-svn: 203556
2014-03-11 09:59:36 +00:00
NAKAMURA Takumi 6c336fa5a7 clang::HeaderSearch: Use default constructor even for POD.
Unfortunately, msvc 2012 didn't accept non-static member initializer.

llvm-svn: 203554
2014-03-11 09:37:27 +00:00
Daniel Jasper c580af96fa clang-format: Detect weird macro lambda usage.
Before:
  void f() {
    MACRO((const AA & a) { return 1; });
  }

After:
  void f() {
    MACRO((const AA &a) { return 1; });
  }

llvm-svn: 203551
2014-03-11 09:29:46 +00:00
NAKAMURA Takumi 020b32de0d clang/test/Modules/include-relative.c REQUIRES shell due to chdir.
llvm-svn: 203550
2014-03-11 09:00:49 +00:00