platform/upstream/llvm.git
10 years agoPreprocessor: make C++ operator names as macro identifiers a compatible extension
Alp Toker [Sat, 31 May 2014 16:32:22 +0000 (16:32 +0000)]
Preprocessor: make C++ operator names as macro identifiers a compatible extension

With recent changes, this is now a compatible language extension and can be
safely enabled with -ms-extensions instead of requiring the full
-ms-compatibility MSVC drop-in mode. As such we can now also emit an extension
warning under -Wmicrosoft to help users port their code.

llvm-svn: 209978

10 years ago[SelectionDAG] Force cycle detection in AssignTopologicalOrder before aborting
Adam Nemet [Sat, 31 May 2014 16:23:20 +0000 (16:23 +0000)]
[SelectionDAG] Force cycle detection in AssignTopologicalOrder before aborting

DAG cycle detection is only enabled with ENABLE_EXPENSIVE_CHECKS.  However we
can run it just before we would crash in order to provide more informative
diagnostics.

Now in addition to the "Overran sorted position" message we also get the Node
printed if a cycle was detected.

Tested by building several configs: Debug+Assert, Debug+Assert+Check (this is
ENABLE_EXPENSIVE_CHECKS), Release+Assert and Release.  Also tried that the
AssignTopologicalOrder assert produces the expected results.

llvm-svn: 209977

10 years ago[SelectionDAG] Pass DAG to checkForCycles
Adam Nemet [Sat, 31 May 2014 16:23:17 +0000 (16:23 +0000)]
[SelectionDAG] Pass DAG to checkForCycles

Pass the DAG down to checkForCycles from all callers where we have it.  This
allows target-specific nodes to be printed properly.

Also print some missing newlines.

llvm-svn: 209976

10 years ago[SelectionDAG] Remove duplicate declaration
Adam Nemet [Sat, 31 May 2014 16:23:13 +0000 (16:23 +0000)]
[SelectionDAG] Remove duplicate declaration

Prefer the decl in SelectionDAGNodes.h because it's used there and
SelectionDAG.h includes SelectionDAGNodes.h.

llvm-svn: 209975

10 years agoFix test on platforms where size_t is not 'unsigned long'.
Benjamin Kramer [Sat, 31 May 2014 15:06:33 +0000 (15:06 +0000)]
Fix test on platforms where size_t is not 'unsigned long'.

llvm-svn: 209974

10 years ago[Reassociate] Similar to "X + -X" -> "0", added code to handle "X + ~X" -> "-1".
Benjamin Kramer [Sat, 31 May 2014 15:01:54 +0000 (15:01 +0000)]
[Reassociate] Similar to "X + -X" -> "0", added code to handle "X + ~X" -> "-1".

Handle "X + ~X" -> "-1" in the function Value *Reassociate::OptimizeAdd(Instruction *I, SmallVectorImpl<ValueEntry> &Ops);
This patch implements:
TODO: We could handle "X + ~X" -> "-1" if we wanted, since "-X = ~X+1".

Patch by Rahul Jain!

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

llvm-svn: 209973

10 years agoFix XFAIL condition from r208840
Justin Bogner [Sat, 31 May 2014 07:59:03 +0000 (07:59 +0000)]
Fix XFAIL condition from r208840

The XFAILs in r208840 were too general. They were meant to only apply
to testing when use_system_lib was set.

llvm-svn: 209972

10 years agoR600/SI: Fix [s|u]int_to_fp for i1
Matt Arsenault [Sat, 31 May 2014 06:47:42 +0000 (06:47 +0000)]
R600/SI: Fix [s|u]int_to_fp for i1

llvm-svn: 209971

10 years agoSupport C++11 scoped enums in NamedDecl::isCXXClassMember()
Alp Toker [Sat, 31 May 2014 06:11:09 +0000 (06:11 +0000)]
Support C++11 scoped enums in NamedDecl::isCXXClassMember()

Resolves an old FIXME.

No callers depend on this giving the right answer so I haven't been able to
cook up a useful test case.

llvm-svn: 209970

10 years agoRename utility function templates
Alp Toker [Sat, 31 May 2014 06:11:02 +0000 (06:11 +0000)]
Rename utility function templates

isExternCTemplate() and getLanguageLinkageTemplate() have nothing to do with
templates despite the dubious naming scheme.

llvm-svn: 209969

10 years agoFix typos in tablegen error messages
Matt Arsenault [Sat, 31 May 2014 05:18:52 +0000 (05:18 +0000)]
Fix typos in tablegen error messages

llvm-svn: 209968

10 years ago[yaml2obj] Add new command line option `-docnum`.
Simon Atanasyan [Sat, 31 May 2014 04:51:07 +0000 (04:51 +0000)]
[yaml2obj] Add new command line option `-docnum`.

Input YAML file might contain multiple object file definitions.
New option `-docnum` allows to specify an ordinal number (starting from 1)
of definition used for an object file generation.

Patch reviewed by Sean Silva.

llvm-svn: 209967

10 years agoFormat strings: check against an enum's underlying type.
Jordan Rose [Sat, 31 May 2014 04:12:14 +0000 (04:12 +0000)]
Format strings: check against an enum's underlying type.

This allows us to be more careful when dealing with enums whose fixed
underlying type requires special handling in a format string, like
NSInteger.

A refinement of r163266 from a year and a half ago, which added the
special handling for NSInteger and friends in the first place.

<rdar://problem/16616623>

llvm-svn: 209966

10 years agoAST Dump: print the Inherited flag on attributes
Hans Wennborg [Sat, 31 May 2014 04:05:57 +0000 (04:05 +0000)]
AST Dump: print the Inherited flag on attributes

Also move the attribute-specific dumping to after dumping this and
the Implicit flag.

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

llvm-svn: 209965

10 years agoreally fix the windows build.
Rafael Espindola [Sat, 31 May 2014 03:40:00 +0000 (03:40 +0000)]
really fix the windows build.

llvm-svn: 209964

10 years agoPreprocessor: recover gracefully when C++ operator names are used as macro identifiers
Alp Toker [Sat, 31 May 2014 03:38:17 +0000 (03:38 +0000)]
Preprocessor: recover gracefully when C++ operator names are used as macro identifiers

This failure mode shows up occasionally when users try to include C headers in
C++ projects or when porting from Windows. We might as well recover in the way
the user expected, thus avoiding confusing diagnostic messages at point of use.

llvm-svn: 209963

10 years agoPreprocessor: don't exit early in CheckMacroName()
Alp Toker [Sat, 31 May 2014 03:38:08 +0000 (03:38 +0000)]
Preprocessor: don't exit early in CheckMacroName()

The checks below can hypothetically apply to converted operator name
identifiers.

In practice there are no builtin macros etc. with those names so there's no
behavioural change to test.

llvm-svn: 209962

10 years agoFix windows build.
Rafael Espindola [Sat, 31 May 2014 03:26:57 +0000 (03:26 +0000)]
Fix windows build.

llvm-svn: 209961

10 years agoThere is no std::errc::success, remove the llvm one.
Rafael Espindola [Sat, 31 May 2014 03:21:04 +0000 (03:21 +0000)]
There is no std::errc::success, remove the llvm one.

llvm-svn: 209960

10 years agoThere is no std::errc:success, remove the llvm one.
Rafael Espindola [Sat, 31 May 2014 03:20:52 +0000 (03:20 +0000)]
There is no std::errc:success, remove the llvm one.

llvm-svn: 209959

10 years agoThere is no std::errc:success, remove the llvm one.
Rafael Espindola [Sat, 31 May 2014 03:20:37 +0000 (03:20 +0000)]
There is no std::errc:success, remove the llvm one.

llvm-svn: 209958

10 years agoTurn errc and windows_error into enum classes.
Rafael Espindola [Sat, 31 May 2014 02:29:28 +0000 (02:29 +0000)]
Turn errc and windows_error into enum classes.

llvm-svn: 209957

10 years agoUse make_error_code in preparation for making errc an enum class.
Rafael Espindola [Sat, 31 May 2014 02:23:01 +0000 (02:23 +0000)]
Use make_error_code in preparation for making errc an enum class.

llvm-svn: 209956

10 years agoPR12961 - Extend DR532 to cover C++98/03.
Nikola Smiljanic [Sat, 31 May 2014 02:10:59 +0000 (02:10 +0000)]
PR12961 - Extend DR532 to cover C++98/03.

llvm-svn: 209955

10 years agoDiagnose dll attribute on member of class that already has a dll attribute
Hans Wennborg [Sat, 31 May 2014 02:08:49 +0000 (02:08 +0000)]
Diagnose dll attribute on member of class that already has a dll attribute

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

llvm-svn: 209954

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 02:00:59 +0000 (02:00 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

llvm-svn: 209953

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 01:37:45 +0000 (01:37 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

llvm-svn: 209952

10 years agoFix the behavior of ExecuteAndWait with a non-zero timeout.
Peter Collingbourne [Sat, 31 May 2014 01:36:02 +0000 (01:36 +0000)]
Fix the behavior of ExecuteAndWait with a non-zero timeout.

llvm-svn: 209951

10 years agoMake Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags
Hans Wennborg [Sat, 31 May 2014 01:30:30 +0000 (01:30 +0000)]
Make Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags

I was bitten by this when working with the dll attributes: when a dll
attribute was cloned from a class template declaration to its
specialization, the Inherited flag didn't get cloned.

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

llvm-svn: 209950

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 01:26:30 +0000 (01:26 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

llvm-svn: 209949

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 01:22:21 +0000 (01:22 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

llvm-svn: 209948

10 years agoMake blend tests more specific
Filipe Cabecinhas [Sat, 31 May 2014 00:52:23 +0000 (00:52 +0000)]
Make blend tests more specific

Following the lead set by r209324, I'm making these tests match the whole
instruction, so we can be sure we're lowering them correctly.

llvm-svn: 209947

10 years ago[ASan] Behave the same for functions w/o sanitize_address attribute and blacklisted...
Alexey Samsonov [Sat, 31 May 2014 00:33:05 +0000 (00:33 +0000)]
[ASan] Behave the same for functions w/o sanitize_address attribute and blacklisted functions

llvm-svn: 209946

10 years ago[TSan] Fixup a test case after r209939
Alexey Samsonov [Sat, 31 May 2014 00:26:03 +0000 (00:26 +0000)]
[TSan] Fixup a test case after r209939

llvm-svn: 209945

10 years agoAdd EH test case checking that handlers in noexcept functions can still unwind
Jonathan Roelofs [Sat, 31 May 2014 00:25:59 +0000 (00:25 +0000)]
Add EH test case checking that handlers in noexcept functions can still unwind

llvm-svn: 209944

10 years agoAdd EH test cases corresponding to C++ ABI # 15.3.3
Jonathan Roelofs [Sat, 31 May 2014 00:24:58 +0000 (00:24 +0000)]
Add EH test cases corresponding to C++ ABI # 15.3.3

llvm-svn: 209943

10 years ago[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract...
Michael J. Spencer [Sat, 31 May 2014 00:22:12 +0000 (00:22 +0000)]
[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract,insert} vector element instructions.

llvm-svn: 209942

10 years agoRefactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
Richard Smith [Sat, 31 May 2014 00:18:32 +0000 (00:18 +0000)]
Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
consistently, rather than sometimes performing lookup and calling the
LookupResult form. No functionality change intended.

llvm-svn: 209941

10 years ago[TSan] Add a test case for r209939
Alexey Samsonov [Sat, 31 May 2014 00:12:20 +0000 (00:12 +0000)]
[TSan] Add a test case for r209939

llvm-svn: 209940

10 years ago[TSan] Behave the same for functions w/o sanitize_thread attribute and blacklisted...
Alexey Samsonov [Sat, 31 May 2014 00:11:37 +0000 (00:11 +0000)]
[TSan] Behave the same for functions w/o sanitize_thread attribute and blacklisted functions

llvm-svn: 209939

10 years agodelete dead code.
Rafael Espindola [Sat, 31 May 2014 00:10:47 +0000 (00:10 +0000)]
delete dead code.

llvm-svn: 209938

10 years agoHave the TLOF creation take a Triple rather than needing a subtarget.
Eric Christopher [Sat, 31 May 2014 00:07:32 +0000 (00:07 +0000)]
Have the TLOF creation take a Triple rather than needing a subtarget.

llvm-svn: 209937

10 years agocc1as: invert return bool to indicate failure
Alp Toker [Sat, 31 May 2014 00:02:27 +0000 (00:02 +0000)]
cc1as: invert return bool to indicate failure

This simplifies code flow and matches the convention used in surrounding code.

No functional change.

llvm-svn: 209936

10 years agocc1as: fix a potential leak and unremoved output file in error conditions
Alp Toker [Sat, 31 May 2014 00:02:21 +0000 (00:02 +0000)]
cc1as: fix a potential leak and unremoved output file in error conditions

llvm-svn: 209935

10 years ago[X86] Add two combine rules to simplify dag nodes introduced during type legalization...
Andrea Di Biagio [Fri, 30 May 2014 23:17:53 +0000 (23:17 +0000)]
[X86] Add two combine rules to simplify dag nodes introduced during type legalization when promoting nodes with illegal vector type.

This patch teaches the backend how to simplify/canonicalize dag node
sequences normally introduced by the backend when promoting certain dag nodes
with illegal vector type.

This patch adds two new combine rules:
1) fold (shuffle (bitcast (BINOP A, B)), Undef, <Mask>) ->
        (shuffle (BINOP (bitcast A), (bitcast B)), Undef, <Mask>)

2) fold (BINOP (shuffle (A, Undef, <Mask>)), (shuffle (B, Undef, <Mask>))) ->
        (shuffle (BINOP A, B), Undef, <Mask>).

Both rules are only triggered on the type-legalized DAG.
In particular, rule 1. is a target specific combine rule that attempts
to sink a bitconvert into the operands of a binary operation.
Rule 2. is a target independet rule that attempts to move a shuffle
immediately after a binary operation.

llvm-svn: 209930

10 years agoConvert a vselect into a concat_vector if possible
Filipe Cabecinhas [Fri, 30 May 2014 23:03:11 +0000 (23:03 +0000)]
Convert a vselect into a concat_vector if possible

Summary:
If both vector args to vselect are concat_vectors and the condition is
constant and picks half a vector from each argument, convert the vselect
into a concat_vectors.

Added a test.

The ConvertSelectToConcatVector is assuming it doesn't get vselects with
arguments of, for example, <undef, undef, true, true>. Those get taken
care of in the checks above its call.

Reviewers: nadav, delena, grosbach, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 209929

10 years ago[mach-o] Add support for custom sections
Nick Kledzik [Fri, 30 May 2014 22:51:04 +0000 (22:51 +0000)]
[mach-o] Add support for custom sections

llvm-svn: 209928

10 years agoisSVR4ABI() returned !isDarwin() so just move that to the else
Eric Christopher [Fri, 30 May 2014 22:47:53 +0000 (22:47 +0000)]
isSVR4ABI() returned !isDarwin() so just move that to the else
block and remove the unreachable code.

llvm-svn: 209927

10 years agoRename CreateTLOF->createTLOF to match the rest of the file and the
Eric Christopher [Fri, 30 May 2014 22:47:48 +0000 (22:47 +0000)]
Rename CreateTLOF->createTLOF to match the rest of the file and the
rest of the targets with a similar function name.

llvm-svn: 209926

10 years agoDisable stack-overflow test on ARM
Greg Fitzgerald [Fri, 30 May 2014 22:44:35 +0000 (22:44 +0000)]
Disable stack-overflow test on ARM

llvm-svn: 209925

10 years agoTake PrintingPolicy::SuppressUnwrittenScope into account when printing the
Richard Smith [Fri, 30 May 2014 22:16:51 +0000 (22:16 +0000)]
Take PrintingPolicy::SuppressUnwrittenScope into account when printing the
qualified name of a NamedDecl. Patch by Volodymyr Sapsai!

llvm-svn: 209924

10 years agoSeparate the check for blend shuffle_vector masks
Filipe Cabecinhas [Fri, 30 May 2014 21:31:21 +0000 (21:31 +0000)]
Separate the check for blend shuffle_vector masks

Summary:
Separate the check for blend shuffle_vector masks into isBlendMask.
This function will also be used to check if a vector shuffle is legal. No
change in functionality was intended, but we ended up improving codegen on
two tests, which were being (more) optimized only if the resulting shuffle
was legal.

Reviewers: nadav, delena, andreadb

Subscribers: llvm-commits

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

llvm-svn: 209923

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 21:20:54 +0000 (21:20 +0000)]
Invalidate the file system cache entries for files that may rebuild

This reapplies r209910 with a fix for the assertion failures hit on the
buildbots.

original commit message:
I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

llvm-svn: 209922

10 years agofixed more typos
Sanjay Patel [Fri, 30 May 2014 21:18:13 +0000 (21:18 +0000)]
fixed more typos

llvm-svn: 209921

10 years agoRoll DbgVariable::setMInsn into the constructor. No functional changes.
Adrian Prantl [Fri, 30 May 2014 21:10:13 +0000 (21:10 +0000)]
Roll DbgVariable::setMInsn into the constructor. No functional changes.

llvm-svn: 209920

10 years agoRemove unused struct from test
Alp Toker [Fri, 30 May 2014 21:07:40 +0000 (21:07 +0000)]
Remove unused struct from test

This presumably got inadvertently copied from dllimport-members.cpp.

llvm-svn: 209919

10 years agoadded link to CMake page
Sanjay Patel [Fri, 30 May 2014 21:07:25 +0000 (21:07 +0000)]
added link to CMake page

llvm-svn: 209918

10 years agoDon't use libc's "char *basename(char *)" or "char *dirname(char *)" as they are...
Greg Clayton [Fri, 30 May 2014 21:06:57 +0000 (21:06 +0000)]
Don't use libc's "char *basename(char *)" or "char *dirname(char *)" as they are not thread safe.

I switched the lldb_private::FileSpec code over to use "llvm::StringRef llvm::sys::path::filename(llvm::StringRef)" for basename() and "llvm::StringRef llvm::sys::path::parent_path(llvm::StringRef)" for dirname().

<rdar://problem/16870083>

llvm-svn: 209917

10 years agofixed typo
Sanjay Patel [Fri, 30 May 2014 20:55:55 +0000 (20:55 +0000)]
fixed typo

llvm-svn: 209916

10 years agoAdd a FIXME for a bug Doug pointed out in code review.
Richard Smith [Fri, 30 May 2014 19:44:17 +0000 (19:44 +0000)]
Add a FIXME for a bug Doug pointed out in code review.

llvm-svn: 209915

10 years agoMake bitcast, extractelement, and insertelement considered cheap for speculation.
Matt Arsenault [Fri, 30 May 2014 18:34:43 +0000 (18:34 +0000)]
Make bitcast, extractelement, and insertelement considered cheap for speculation.

This helps more branches into selects. On R600,
vectors are cheap and anything that helps
remove branches is very good.

llvm-svn: 209914

10 years agoThread Safety Analysis: fix handling of string and char literals.
DeLesley Hutchins [Fri, 30 May 2014 18:20:04 +0000 (18:20 +0000)]
Thread Safety Analysis: fix handling of string and char literals.

llvm-svn: 209913

10 years agogdb-remote signal delivery test cleanup.
Todd Fiala [Fri, 30 May 2014 17:59:47 +0000 (17:59 +0000)]
gdb-remote signal delivery test cleanup.

Learned that MacOSX only accepts signal delivery on a thread that is
already signal handling.  Reworked the test exe to cause a SIGSEGV
and recover if either nothing intercepts the SIGSEGV handler, or
if a SIGUSR1 is inserted.  The test uses the latter part to test
signal delivery on continue using the SIGUSR1.

I still don't have this working on MacOSX.  I'm seeing the
signal get delivered to a different thread than the one I'm
specifying with $Hc{thread-id} + $C{signo}, or with
$vCont;C{signo}:{thread-id};c.  I'll come back to this
after getting it working on the llgs branch on Linux x86_64.

llvm-svn: 209912

10 years agoRevert "Invalidate the file system cache entries for files that may rebuild"
Ben Langmuir [Fri, 30 May 2014 17:54:59 +0000 (17:54 +0000)]
Revert "Invalidate the file system cache entries for files that may rebuild"

This reverts commit r209910, which is breaking some of the bots.

llvm-svn: 209911

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 17:42:15 +0000 (17:42 +0000)]
Invalidate the file system cache entries for files that may rebuild

I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

llvm-svn: 209910

10 years agoLet libc++abi compile with gcc.
Nico Weber [Fri, 30 May 2014 17:27:21 +0000 (17:27 +0000)]
Let libc++abi compile with gcc.

There was a single problem in cxa_demangle.cpp, where gcc would complain
`error: changes meaning of 'String'` about the line `typedef String String;`.
According to 3.3.7p2, this diagnostic is allowed (but not required, so clang
does not have to report this).

As a fix, make string_pair a template and pass String as template parameter.
This fixes the error with gcc and also removes some repetition from the code.

No behavior change.

llvm-svn: 209909

10 years agoStart adding support for dllimport/dllexport on classes (PR11170)
Hans Wennborg [Fri, 30 May 2014 16:59:42 +0000 (16:59 +0000)]
Start adding support for dllimport/dllexport on classes (PR11170)

This implements the central part of support for dllimport/dllexport on
classes: allowing the attribute on class declarations, inheriting it
to class members, and forcing emission of exported members. It's based
on Nico Rieck's patch from http://reviews.llvm.org/D1099.

This patch doesn't propagate dllexport to bases that are template
specializations, which is an interesting problem. It also doesn't
look at the rules when redeclaring classes with different attributes,
I'd like to do that separately.

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

llvm-svn: 209908

10 years agoFix MIPS exception personality encoding.
Logan Chien [Fri, 30 May 2014 16:48:56 +0000 (16:48 +0000)]
Fix MIPS exception personality encoding.

For MIPS, we have to encode the personality routine with
an indirect pointer to absptr; otherwise, some link warning
warning will be raised, and the program might crash in some
early MIPS Android device.

llvm-svn: 209907

10 years agoObjective-C. Diagnose assigning a block pointer type to
Fariborz Jahanian [Fri, 30 May 2014 16:35:53 +0000 (16:35 +0000)]
Objective-C. Diagnose assigning a block pointer type to
an Objective-C object type other than 'id'.
// rdar://16739120

llvm-svn: 209906

10 years agoMachO: move test to ARM directory.
Tim Northover [Fri, 30 May 2014 16:01:29 +0000 (16:01 +0000)]
MachO: move test to ARM directory.

This test specifies an ARM triple, so it needs ARM as a registered
target.

llvm-svn: 209905

10 years agoThread Safety Analysis: fix uninitialized member in TIL Literal.
DeLesley Hutchins [Fri, 30 May 2014 15:55:25 +0000 (15:55 +0000)]
Thread Safety Analysis: fix uninitialized member in TIL Literal.

llvm-svn: 209904

10 years agoPR19753: Optimize comparisons with "ashr exact" of a constanst.
Rafael Espindola [Fri, 30 May 2014 15:54:32 +0000 (15:54 +0000)]
PR19753: Optimize comparisons with "ashr exact" of a constanst.

Patch by suyog sarda.

llvm-svn: 209903

10 years ago[pr19636] Fix known bit computation in urem instruction with power of two.
Rafael Espindola [Fri, 30 May 2014 15:00:45 +0000 (15:00 +0000)]
[pr19636]  Fix known bit computation in urem instruction with power of two.
Patch by Andrey Kuharev.

llvm-svn: 209902

10 years agoSelectionDAG: skip barriers for unordered atomic operations
Tim Northover [Fri, 30 May 2014 14:41:51 +0000 (14:41 +0000)]
SelectionDAG: skip barriers for unordered atomic operations

Unordered is strictly weaker than monotonic, so if the latter doesn't have any
barriers then the former certainly shouldn't.

rdar://problem/16548260

llvm-svn: 209901

10 years agotsan: add a test from data-race-test suite:
Dmitry Vyukov [Fri, 30 May 2014 14:27:31 +0000 (14:27 +0000)]
tsan: add a test from data-race-test suite:
https://code.google.com/p/data-race-test/source/browse/trunk/unittest/racecheck_unittest.cc

llvm-svn: 209900

10 years agoAArch64: combine arm64 & aarch64 cases in switch
Tim Northover [Fri, 30 May 2014 14:14:07 +0000 (14:14 +0000)]
AArch64: combine arm64 & aarch64 cases in switch

There shouldn't be any difference in behaviour here, at least not in
any configurations people care about and possibly not in any reachable
configurations.

llvm-svn: 209899

10 years agotsan: make positive tests more robust
Dmitry Vyukov [Fri, 30 May 2014 14:08:51 +0000 (14:08 +0000)]
tsan: make positive tests more robust
Add a script that is used to deflake inherently flaky tsan tests.
It is invoked from lit tests as:
%deflake %run %t
The script runs the target program up to 10 times,
until it produces a tsan warning.

llvm-svn: 209898

10 years agotsan: optimize memory access functions
Dmitry Vyukov [Fri, 30 May 2014 13:36:29 +0000 (13:36 +0000)]
tsan: optimize memory access functions
The optimization is two-fold:
First, the algorithm now uses SSE instructions to
handle all 4 shadow slots at once. This makes processing
faster.
Second, if shadow contains the same access, we do not
store the event into trace. This increases effective
trace size, that is, tsan can remember up to 10x more
previous memory accesses.

Perofrmance impact:
Before:
[       OK ] DISABLED_BENCH.Mop8Read (2461 ms)
[       OK ] DISABLED_BENCH.Mop8Write (1836 ms)
After:
[       OK ] DISABLED_BENCH.Mop8Read (1204 ms)
[       OK ] DISABLED_BENCH.Mop8Write (976 ms)
But this measures only fast-path.
On large real applications the speedup is ~20%.

Trace size impact:
On app1:
Memory accesses                   :       1163265870
  Including same                  :        791312905 (68%)
on app2:
Memory accesses                   :        166875345
  Including same                  :        150449689 (90%)
90% of filtered events means that trace size is effectively 10x larger.

llvm-svn: 209897

10 years agoRevert "Remove redundant check discovered in post-commit review of r209505."
Daniel Jasper [Fri, 30 May 2014 13:31:14 +0000 (13:31 +0000)]
Revert "Remove redundant check discovered in post-commit review of r209505."

This breaks with MSVC.
With IsLateTemplateParsed, FunctionDecl::doesThisDeclarationHaveABody() returns true regardless of Body.

This reinstates what was fixed in r208985.

llvm-svn: 209896

10 years agoARM: use AAPCS-style prologues for embedded MachO.
Tim Northover [Fri, 30 May 2014 13:23:06 +0000 (13:23 +0000)]
ARM: use AAPCS-style prologues for embedded MachO.

Darwin prologues save their GPRs in two stages: a narrow push of r0-r7 & lr,
followed by a wide push of the remaining registers if there are any. AAPCS uses
a single push.w instruction.

It turns out that, on average, enough registers get pushed that code is smaller
in the AAPCS prologue, which is a nice property for M-class programmers. They
also have other options available for back-traces, so can hopefully deal with
the fact that FP & LR aren't adjacent in memory.

rdar://problem/15909583

llvm-svn: 209895

10 years agoMachO: support N_INDR aliases in assembly files.
Tim Northover [Fri, 30 May 2014 13:22:59 +0000 (13:22 +0000)]
MachO: support N_INDR aliases in assembly files.

This makes LLVM create N_INDR aliases (to be resolved by the linker) when
appropriate.

rdar://problem/15125513

llvm-svn: 209894

10 years agoRemove unnecessary test.
Diego Novillo [Fri, 30 May 2014 13:19:28 +0000 (13:19 +0000)]
Remove unnecessary test.

llvm-svn: 209893

10 years agoThis test is no longer relevant. It is covered already by [basic.scope.pdecl]p10...
Aaron Ballman [Fri, 30 May 2014 13:17:17 +0000 (13:17 +0000)]
This test is no longer relevant. It is covered already by [basic.scope.pdecl]p10, and our current test for that is more thorough (though our test is named p9.cpp).

llvm-svn: 209892

10 years agoThis test should no longer be XFAILed; the standard has stabilized, and the test...
Aaron Ballman [Fri, 30 May 2014 13:09:38 +0000 (13:09 +0000)]
This test should no longer be XFAILed; the standard has stabilized, and the test contents are acceptable. No diagnostics expected from this test.

llvm-svn: 209891

10 years agoSetting a heading for the section/allocate attribute so that the attribute documentat...
Aaron Ballman [Fri, 30 May 2014 12:57:13 +0000 (12:57 +0000)]
Setting a heading for the section/allocate attribute so that the attribute documentation can be properly generated.

llvm-svn: 209890

10 years ago[Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake...
Timur Iskhodzhanov [Fri, 30 May 2014 12:42:57 +0000 (12:42 +0000)]
[Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake variable

Reviewed at http://reviews.llvm.org/D3952

llvm-svn: 209889

10 years agoAdd a _LIBCPP_CONSTEXPR that was missed in r170026.
Nico Weber [Fri, 30 May 2014 12:09:47 +0000 (12:09 +0000)]
Add a _LIBCPP_CONSTEXPR that was missed in r170026.

(clang doesn't complain about this, but gcc does.  This is necessary for a
follow-up patch that will enable _LIBCPP_CONSTEXPR for gcc.)

llvm-svn: 209888

10 years ago[ASan Win] Fix a couple of warnings in tests and enable -WX
Timur Iskhodzhanov [Fri, 30 May 2014 11:58:32 +0000 (11:58 +0000)]
[ASan Win] Fix a couple of warnings in tests and enable -WX

llvm-svn: 209887

10 years agoImplement __divtf3 for IEEE quad precision.
Joerg Sonnenberger [Fri, 30 May 2014 11:08:18 +0000 (11:08 +0000)]
Implement __divtf3 for IEEE quad precision.

Patch by: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D2800

llvm-svn: 209886

10 years agoAArch64 & ARM: disable generic test that relies on no CFG changes.
Tim Northover [Fri, 30 May 2014 10:56:12 +0000 (10:56 +0000)]
AArch64 & ARM: disable generic test that relies on no CFG changes.

llvm-svn: 209885

10 years ago[sanitizer] Fix build on ARM.
Evgeniy Stepanov [Fri, 30 May 2014 10:50:17 +0000 (10:50 +0000)]
[sanitizer] Fix build on ARM.

llvm-svn: 209884

10 years agoARM & AArch64: make use of common cmpxchg idioms after expansion
Tim Northover [Fri, 30 May 2014 10:09:59 +0000 (10:09 +0000)]
ARM & AArch64: make use of common cmpxchg idioms after expansion

The C and C++ semantics for compare_exchange require it to return a bool
indicating success. This gets mapped to LLVM IR which follows each cmpxchg with
an icmp of the value loaded against the desired value.

When lowered to ldxr/stxr loops, this extra comparison is redundant: its
results are implicit in the control-flow of the function.

This commit makes two changes: it replaces that icmp with appropriate PHI
nodes, and then makes sure earlyCSE is called after expansion to actually make
use of the opportunities revealed.

I've also added -{arm,aarch64}-enable-atomic-tidy options, so that
existing fragile tests aren't perturbed too much by the change. Many
of them either rely on undef/unreachable too pervasively to be
restored to something well-defined (particularly while making sure
they test the same obscure assert from many years ago), or depend on a
particular CFG shape, which is disrupted by SimplifyCFG.

rdar://problem/16227836

llvm-svn: 209883

10 years agoRemove redundant check discovered in post-commit review of r209505.
Daniel Jasper [Fri, 30 May 2014 09:21:17 +0000 (09:21 +0000)]
Remove redundant check discovered in post-commit review of r209505.

llvm-svn: 209882

10 years ago[ASan Win] DLL thunk: make each INTERFACE_FUNCTION unique to prevent ICF linker optim...
Timur Iskhodzhanov [Fri, 30 May 2014 09:01:17 +0000 (09:01 +0000)]
[ASan Win] DLL thunk: make each INTERFACE_FUNCTION unique to prevent ICF linker optimizations

llvm-svn: 209881

10 years agoAArch64 & ARM: remove undefined behaviour from some tests.
Tim Northover [Fri, 30 May 2014 08:59:55 +0000 (08:59 +0000)]
AArch64 & ARM: remove undefined behaviour from some tests.

llvm-svn: 209880

10 years ago[asan] Enable ASan on PowerPC.
Evgeniy Stepanov [Fri, 30 May 2014 08:52:03 +0000 (08:52 +0000)]
[asan] Enable ASan on PowerPC.

Patch by Peter Bergner.

llvm-svn: 209879

10 years agoclang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.
NAKAMURA Takumi [Fri, 30 May 2014 07:03:16 +0000 (07:03 +0000)]
clang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.

You could see unexpected result (*.tmp.err) with "-target x86_64-win32".

  Weverything-and-remarks.cpp:11:9: warning: 'char32_t' type specifier is incompatible with C++98 [-Wc++98-compat]
  typedef __char32_t char32_t;
          ^
  Weverything-and-remarks.cpp:12:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long')
  typedef long unsigned int size_t;
                            ^
  Weverything-and-remarks.cpp:19:62: warning: dynamic exception specifications are deprecated [-Wdeprecated]
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
  Weverything-and-remarks.cpp:19:62: note: use 'noexcept' instead
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
                                                               noexcept
  Weverything-and-remarks.cpp:25:46: warning: unused parameter '__n' [-Wunused-parameter]
                                        size_t __n) {
                                               ^
  3 warnings and 1 error generated.

llvm-svn: 209878

10 years agoTest cases named with dates is a legacy rule not used now. Rename several test cases.
Hao Liu [Fri, 30 May 2014 05:58:19 +0000 (05:58 +0000)]
Test cases named with dates is a legacy rule not used now. Rename several test cases.

llvm-svn: 209877

10 years ago[OPENMP] Improve debug location codegen for OpenMP runtime library.
Alexey Bataev [Fri, 30 May 2014 05:48:40 +0000 (05:48 +0000)]
[OPENMP] Improve debug location codegen for OpenMP runtime library.

llvm-svn: 209876

10 years ago[ELF] Fix incorrect sorting of .init_array / .fini_array sections.
Simon Atanasyan [Fri, 30 May 2014 05:29:46 +0000 (05:29 +0000)]
[ELF] Fix incorrect sorting of .init_array / .fini_array sections.

The main problem is in the predicate passed to the `std::stable_sort()`.
This predicate always returns false if **both** section's names do not
start with `.init_array` or `.fini_array` prefixes. In short, it does not
define a strict weak orderng. Suppose we have the following sections:

  .A .init_array.1 .init_array.2

The predicate states that:

  not .init_array.1 < .A
  not .A < .init_array.2
  but .init_array.1 < .init_array.2 !!!

The second problem is that `.init_array` section without number should
go last in the list. Not it has the lowest priority '0' and goes first.

The patch fixes both of the problems.

llvm-svn: 209875