platform/upstream/llvm.git
10 years agoUpdate example to be more idiomatic.
Rafael Espindola [Thu, 9 Jan 2014 14:40:43 +0000 (14:40 +0000)]
Update example to be more idiomatic.

llvm-svn: 198872

10 years agoclang-format: Add @s when breaking NSString literals.
Daniel Jasper [Thu, 9 Jan 2014 14:18:12 +0000 (14:18 +0000)]
clang-format: Add @s when breaking NSString literals.

While it is allowed to not have an @ on subsequent lines, it seems
general practice to add them. If undesired, the code author can easily
remove them again and clang-format won't re-add them.

llvm-svn: 198871

10 years agoclang-format: Understand #pragma mark
Daniel Jasper [Thu, 9 Jan 2014 13:56:49 +0000 (13:56 +0000)]
clang-format: Understand #pragma mark

Before:
  #pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
  #pragma mark Any non-hyphenated or hyphenated string (including parentheses).

llvm-svn: 198870

10 years agoclang-format: Some tweaks to braces list formatting:
Daniel Jasper [Thu, 9 Jan 2014 13:42:56 +0000 (13:42 +0000)]
clang-format: Some tweaks to braces list formatting:

- Format a braced list with one element per line if it has nested
  braced lists.
- Use a column layout only when the list has 6+ elements (instead of the
  current 4+ elements).

llvm-svn: 198869

10 years agoThe OpenCL specification states that images are allocated
Pekka Jaaskelainen [Thu, 9 Jan 2014 13:37:30 +0000 (13:37 +0000)]
The OpenCL specification states that images are allocated
from the global address space (6.5.1 of the OpenCL 1.2 specification).
This makes clang construct the image arguments in the global address
space and generate the argument metadata with the correct address space
descriptor.

Patch by Pedro Ferreira!

llvm-svn: 198868

10 years agocheck-clang: Add dependencies to PrintFunctionNames and SampleAnalyzerPlugin, for...
NAKAMURA Takumi [Thu, 9 Jan 2014 13:26:02 +0000 (13:26 +0000)]
check-clang: Add dependencies to PrintFunctionNames and SampleAnalyzerPlugin, for r198747 and r198820.

llvm-svn: 198867

10 years agoRevert r198851, "Prototype of skeleton type units for fission"
NAKAMURA Takumi [Thu, 9 Jan 2014 13:08:00 +0000 (13:08 +0000)]
Revert r198851, "Prototype of skeleton type units for fission"

It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess.

llvm-svn: 198865

10 years agoFixed old typo in ScalarEvolution, that caused wrong SCEVs zext operation.
Stepan Dyatkovskiy [Thu, 9 Jan 2014 12:26:12 +0000 (12:26 +0000)]
Fixed old typo in ScalarEvolution, that caused wrong SCEVs zext operation.
Detailed description is here:
http://llvm.org/bugs/show_bug.cgi?id=18000#c16

For participation in bugfix process special thanks to David Wiberg.

llvm-svn: 198863

10 years ago[SystemZ] Fix RNSBG bug introduced by r197802
Richard Sandiford [Thu, 9 Jan 2014 11:28:53 +0000 (11:28 +0000)]
[SystemZ] Fix RNSBG bug introduced by r197802

The zext handling added in r197802 wasn't right for RNSBG.  This patch
restricts it to ROSBG, RXSBG and RISBG.  (The tests for RISBG were added
in r197802 since RISBG was the motivating example.)

llvm-svn: 198862

10 years agoHandle masked rotate amounts
Richard Sandiford [Thu, 9 Jan 2014 10:56:42 +0000 (10:56 +0000)]
Handle masked rotate amounts

At the moment we expect rotates to have the form:

   (or (shl X, Y), (shr X, Z))

where Y == bitsize(X) - Z or Z == bitsize(X) - Y.  This form means that
the (or ...) is undefined for Y == 0 or Z == 0.  This undefinedness can
be avoided by using Y == (C * bitsize(X) - Z) & (bitsize(X) - 1) or
Z == (C * bitsize(X) - Y) & (bitsize(X) - 1) for any integer C
(including 0, the most natural choice).

llvm-svn: 198861

10 years agoMatch the InstCombine form of rotates by X+C
Richard Sandiford [Thu, 9 Jan 2014 10:49:40 +0000 (10:49 +0000)]
Match the InstCombine form of rotates by X+C

InstCombine converts (sub 32, (add X, C)) into (sub 32-C, X),
so a rotate left of a 32-bit Y by X+C could appear as either:

   (or (shl Y, (add X, C)), (shr Y, (sub 32, (add X, C))))

without InstCombine or:

   (or (shl Y, (add X, C)), (shr Y, (sub 32-C, X)))

with it.

We already matched the first form.  This patch handles the second too.

llvm-svn: 198860

10 years agoRemove IR/Writer.h
Tobias Grosser [Thu, 9 Jan 2014 10:42:15 +0000 (10:42 +0000)]
Remove IR/Writer.h

This should fix the buildbots.

llvm-svn: 198859

10 years agoDisable LeakSanitizer in TableGen binaries, see PR18325
Kostya Serebryany [Thu, 9 Jan 2014 09:26:26 +0000 (09:26 +0000)]
Disable LeakSanitizer in TableGen binaries, see PR18325

llvm-svn: 198858

10 years agoFix leak in lib/CodeGen/CGException.cpp, PR18318
Kostya Serebryany [Thu, 9 Jan 2014 09:22:32 +0000 (09:22 +0000)]
Fix leak in lib/CodeGen/CGException.cpp, PR18318

Summary: This fixes the leak described in http://llvm.org/bugs/show_bug.cgi?id=18318

Reviewers: chandlerc, dblaikie

Reviewed By: chandlerc

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2474

llvm-svn: 198857

10 years agoIn areVectorOperandsLaxBitCastable() allow bitcast between a vector and scalar.
Argyrios Kyrtzidis [Thu, 9 Jan 2014 07:58:22 +0000 (07:58 +0000)]
In areVectorOperandsLaxBitCastable() allow bitcast between a vector and scalar.

rdar://15779837.

llvm-svn: 198856

10 years ago[Mips] Reduce the number of type-casting calls.
Simon Atanasyan [Thu, 9 Jan 2014 07:52:31 +0000 (07:52 +0000)]
[Mips] Reduce the number of type-casting calls.

llvm-svn: 198855

10 years agoRevert r198819 - "Remove dead code."
Nadav Rotem [Thu, 9 Jan 2014 07:50:34 +0000 (07:50 +0000)]
Revert r198819 - "Remove dead code."

llvm-svn: 198854

10 years agoFix accidental use of the exotic "std::string::back()" method. Turns out it's
Lang Hames [Thu, 9 Jan 2014 05:29:59 +0000 (05:29 +0000)]
Fix accidental use of the exotic "std::string::back()" method. Turns out it's
new in C++11.

llvm-svn: 198853

10 years agoAdd an "-object-cache-dir=<string>" option to LLI. This option specifies the
Lang Hames [Thu, 9 Jan 2014 05:24:05 +0000 (05:24 +0000)]
Add an "-object-cache-dir=<string>" option to LLI. This option specifies the
root path to which object files managed by the LLIObjectCache instance should be
written. This option defaults to "", in which case objects are cached in the
same directory as the bitcode they are derived from.

The load-object-a.ll test has been rewritten to use this option to support
testing in environments where the test directory is not writable.

llvm-svn: 198852

10 years agoPrototype of skeleton type units for fission
David Blaikie [Thu, 9 Jan 2014 05:08:28 +0000 (05:08 +0000)]
Prototype of skeleton type units for fission

llvm-svn: 198851

10 years agollvm-dwarfdump: type unit dwo support
David Blaikie [Thu, 9 Jan 2014 05:08:24 +0000 (05:08 +0000)]
llvm-dwarfdump: type unit dwo support

llvm-svn: 198850

10 years agoRevert "PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on"
Argyrios Kyrtzidis [Thu, 9 Jan 2014 05:01:04 +0000 (05:01 +0000)]
Revert "PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on"

It broke building.
This reverts commit r198845.

llvm-svn: 198849

10 years agollvm-readobj: address review comments for ARM EHABI printing
Saleem Abdulrasool [Thu, 9 Jan 2014 04:31:18 +0000 (04:31 +0000)]
llvm-readobj: address review comments for ARM EHABI printing

Rename bytecode to opcodes to make it more clear.  Change an impossible case to
llvm_unreachable instead.  Avoid allocation of a buffer by modifying the
PrintOpcodes iteration.

llvm-svn: 198848

10 years agollvm-readobj: fix endianness
Saleem Abdulrasool [Thu, 9 Jan 2014 04:31:14 +0000 (04:31 +0000)]
llvm-readobj: fix endianness

Explicitly handle endianness to ensure that bytes are read properly on
big-endian systems.

llvm-svn: 198847

10 years agoDwarfDebug: Refactor out common skeleton construction code to be reused for type...
David Blaikie [Thu, 9 Jan 2014 04:28:46 +0000 (04:28 +0000)]
DwarfDebug: Refactor out common skeleton construction code to be reused for type unit skeletons.

llvm-svn: 198846

10 years agoPR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
Richard Smith [Thu, 9 Jan 2014 03:29:54 +0000 (03:29 +0000)]
PR18427: Use an appropriately-aligned buffer in APValue, to avoid a crash on
SPARC, where uint64_t apparently requires higher alignment than void*.

llvm-svn: 198845

10 years agoExtend llvm::AlignedCharArrayUnion to support up to 10 arguments, as required by...
Richard Smith [Thu, 9 Jan 2014 03:28:55 +0000 (03:28 +0000)]
Extend llvm::AlignedCharArrayUnion to support up to 10 arguments, as required by Clang's APValue.

llvm-svn: 198844

10 years agoReformatting for r198842
David Blaikie [Thu, 9 Jan 2014 03:24:13 +0000 (03:24 +0000)]
Reformatting for r198842

llvm-svn: 198843

10 years agoDwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit as well.
David Blaikie [Thu, 9 Jan 2014 03:23:41 +0000 (03:23 +0000)]
DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit as well.

Since we'll now also need the split dwarf file name along with the
language in DwarfTypeUnits, just use the whole DICompileUnit rather than
explicitly handling each field needed.

llvm-svn: 198842

10 years agoRevert "DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only"
David Blaikie [Thu, 9 Jan 2014 03:03:27 +0000 (03:03 +0000)]
Revert "DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only"

This reverts commit r198830.

Decided to go a different way with this...

llvm-svn: 198841

10 years agoUpdate Clang's CFGBlock interface to conform to the strange part of
Chandler Carruth [Thu, 9 Jan 2014 02:56:16 +0000 (02:56 +0000)]
Update Clang's CFGBlock interface to conform to the strange part of
LLVM's Value interface which is used in LLVM's DominatorTree analysis
and which changed in LLVM r198836.

The DominatorTree analysis is actually a generic graph analysis and
should be moved to LLVM's support library to clarify that Clang and
others are using it with arbitrary graphs. Further, it seems likely that
it should be using something other than printAsOperand, but this is
a simpler build fix. I'll clean this up later.

llvm-svn: 198840

10 years agoAdd a blank line to FileCheck input.
Rui Ueyama [Thu, 9 Jan 2014 02:47:52 +0000 (02:47 +0000)]
Add a blank line to FileCheck input.

FileCheck does not like the empty input file, so adding a blank line to workaround.

llvm-svn: 198839

10 years ago[PM] Rename this source file to something a bit more generic before
Chandler Carruth [Thu, 9 Jan 2014 02:39:45 +0000 (02:39 +0000)]
[PM] Rename this source file to something a bit more generic before
I add support for the new pass manager to it.

llvm-svn: 198838

10 years agoFix the clang -Werror build after r198818
David Blaikie [Thu, 9 Jan 2014 02:34:06 +0000 (02:34 +0000)]
Fix the clang -Werror build after r198818

llvm-svn: 198837

10 years agoPut the functionality for printing a value to a raw_ostream as an
Chandler Carruth [Thu, 9 Jan 2014 02:29:41 +0000 (02:29 +0000)]
Put the functionality for printing a value to a raw_ostream as an
operand into the Value interface just like the core print method is.
That gives a more conistent organization to the IR printing interfaces
-- they are all attached to the IR objects themselves. Also, update all
the users.

This removes the 'Writer.h' header which contained only a single function
declaration.

llvm-svn: 198836

10 years agoPatch by Ari Grant
Enrico Granata [Thu, 9 Jan 2014 02:28:25 +0000 (02:28 +0000)]
Patch by Ari Grant

"Open LLDB and run:
(lldb) script print lldb.debugger.GetInputFileHandle()

This puts the debugger into a catatonic state and all interactions seem
to enter a black hole. The reason is that executing this commnand
actually *CLOSES* the input file handle and so all input is dropped on
the floor. Oof!

The fix is simple: flush a descriptor, instead of closing it, when
transferring ownership."

llvm-svn: 198835

10 years agoPR18401: Fix assert by implementing the current proposed direction of core
Richard Smith [Thu, 9 Jan 2014 02:22:22 +0000 (02:22 +0000)]
PR18401: Fix assert by implementing the current proposed direction of core
issue 1430. Don't allow a pack expansion to be used as an argument to an alias
template unless the corresponding parameter is a parameter pack.

llvm-svn: 198833

10 years agoReverted r198807, r198808, as they cause link errors in configure builds. Will look...
Alexander Kornienko [Thu, 9 Jan 2014 02:21:52 +0000 (02:21 +0000)]
Reverted r198807, r198808, as they cause link errors in configure builds. Will look at this later.

llvm-svn: 198832

10 years agoFix typo
Alp Toker [Thu, 9 Jan 2014 01:39:49 +0000 (01:39 +0000)]
Fix typo

llvm-svn: 198831

10 years agoDwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only
David Blaikie [Thu, 9 Jan 2014 01:20:14 +0000 (01:20 +0000)]
DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only

It's unused in DwarfTypeUnit, as is expected.

llvm-svn: 198830

10 years agoWrite temporary files to Output directory.
Rui Ueyama [Thu, 9 Jan 2014 01:11:51 +0000 (01:11 +0000)]
Write temporary files to Output directory.

llvm-svn: 198829

10 years ago[PECOFF] Add a test for r197803.
Rui Ueyama [Thu, 9 Jan 2014 01:11:48 +0000 (01:11 +0000)]
[PECOFF] Add a test for r197803.

llvm-svn: 198828

10 years agoRemove the test for endianness in configure.ac and regenerate.
Eric Christopher [Thu, 9 Jan 2014 01:09:57 +0000 (01:09 +0000)]
Remove the test for endianness in configure.ac and regenerate.

llvm-svn: 198825

10 years ago[ms-abi] Fixed failing lit test.
Warren Hunt [Thu, 9 Jan 2014 00:48:32 +0000 (00:48 +0000)]
[ms-abi] Fixed failing lit test.

This test adjustment was missing from the previous patch.

llvm-svn: 198822

10 years agoReplace fstream use with raw_fd_ostream.
Lang Hames [Thu, 9 Jan 2014 00:47:54 +0000 (00:47 +0000)]
Replace fstream use with raw_fd_ostream.

llvm-svn: 198821

10 years agoAdd a test for Static Analyzer checker plugins
Alp Toker [Thu, 9 Jan 2014 00:47:40 +0000 (00:47 +0000)]
Add a test for Static Analyzer checker plugins

llvm-svn: 198820

10 years agoRemove dead code.
Rafael Espindola [Thu, 9 Jan 2014 00:32:54 +0000 (00:32 +0000)]
Remove dead code.

llvm-svn: 198819

10 years ago[ms-abi] Refactor Microsoft Record Layout
Warren Hunt [Thu, 9 Jan 2014 00:30:56 +0000 (00:30 +0000)]
[ms-abi] Refactor Microsoft Record Layout

This patch refactors microsoft record layout to be more "natural".  The
most dominant change is that vbptrs and vfptrs are injected after the
fact.  This simplifies the implementation and the math for the offest
for the first base/field after the vbptr.

llvm-svn: 198818

10 years agoUse the existing typedef to avoid forming a reference to a reference.
Rafael Espindola [Thu, 9 Jan 2014 00:25:25 +0000 (00:25 +0000)]
Use the existing typedef to avoid forming a reference to a reference.

llvm-svn: 198817

10 years agollvm.experimental.stackmap: fix encoding of large constants.
Andrew Trick [Thu, 9 Jan 2014 00:22:31 +0000 (00:22 +0000)]
llvm.experimental.stackmap: fix encoding of large constants.

In the stackmap format we advertise the constant field as signed.
However, we were determining whether to promote to a 64-bit constant
pool based on an unsigned comparison.

This fix allows -1 to be encoded as a small constant.

llvm-svn: 198816

10 years agoUsed the DataLayout methods instead of the Module methods.
Rafael Espindola [Thu, 9 Jan 2014 00:17:51 +0000 (00:17 +0000)]
Used the DataLayout methods instead of the Module methods.

llvm-svn: 198815

10 years agoImplement isCXX11FinalKeyword() in terms of isCXX11VirtSpecifier()
Alp Toker [Thu, 9 Jan 2014 00:13:52 +0000 (00:13 +0000)]
Implement isCXX11FinalKeyword() in terms of isCXX11VirtSpecifier()

It's not worth keeping two copies of the identifier init and comparison code
just to save a pointer coparison.

This should reduce further once we get proper contextual keywords in the token
stream, so having the identifier checks in one place is a step towards that.

Cleanup only.

llvm-svn: 198814

10 years agoSimplify/collapse/denest a conditions/blocks.
David Blaikie [Thu, 9 Jan 2014 00:13:35 +0000 (00:13 +0000)]
Simplify/collapse/denest a conditions/blocks.

llvm-svn: 198813

10 years agoAdd missing triples so that these tests pass on 32 bit arch.
Rui Ueyama [Thu, 9 Jan 2014 00:07:20 +0000 (00:07 +0000)]
Add missing triples so that these tests pass on 32 bit arch.

llvm-svn: 198812

10 years agoRoll back r198729; it seems to be causing two testsuite failures if llvm is built...
Jason Molenda [Thu, 9 Jan 2014 00:02:17 +0000 (00:02 +0000)]
Roll back r198729; it seems to be causing two testsuite failures if llvm is built with asserts -

210: test_with_dsym_and_run_command (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
     Test data formatter commands. ... Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm/include/llvm/Support/Casting.h, line 239.

     226: test_with_dsym_and_run_command (Test-rdar-13338477.Radar13338477DataFormatterTestCase)
         Test that LLDB handles the clang typeclass Paren correctly. ... Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm/include/llvm/Support/Casting.h, line 239.

llvm-svn: 198811

10 years agoRoll back my change to r198729; I'm going to revert it entirely.
Jason Molenda [Thu, 9 Jan 2014 00:00:53 +0000 (00:00 +0000)]
Roll back my change to r198729; I'm going to revert it entirely.

llvm-svn: 198810

10 years agoRevert the vector part of Enrico's change in r198729;
Jason Molenda [Wed, 8 Jan 2014 23:35:54 +0000 (23:35 +0000)]
Revert the vector part of Enrico's change in r198729;
it is causing an llvm assert when run against
test/functionalities/data-formatter/rdar-10642615,

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm/include/llvm/Support/Casting.h, line 239.

llvm-svn: 198809

10 years agoUpdated file comment.
Alexander Kornienko [Wed, 8 Jan 2014 23:35:01 +0000 (23:35 +0000)]
Updated file comment.

llvm-svn: 198808

10 years agoRestructured code, no functional changes.
Alexander Kornienko [Wed, 8 Jan 2014 23:30:40 +0000 (23:30 +0000)]
Restructured code, no functional changes.

Summary:
Moved implementation of classes declared in
ClangTidyDiagnosticConsumer.h to ClangTidyDiagnosticConsumer.cpp.
Added a FIXME note in ClangTidyDiagnosticConsumer::HandleDiagnostic.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2520

llvm-svn: 198807

10 years agollvm-dwarfdump: reorder dwo sections to immediately proceed their non-dwo equivalents
David Blaikie [Wed, 8 Jan 2014 23:29:59 +0000 (23:29 +0000)]
llvm-dwarfdump: reorder dwo sections to immediately proceed their non-dwo equivalents

This makes it easier to write a test that's mostly shared between
fission and non-fission (using FileCheck's multiple prefix support).

llvm-svn: 198806

10 years agoAttempting a fix the build bots should be happier with. Amends 198804.
Aaron Ballman [Wed, 8 Jan 2014 23:26:53 +0000 (23:26 +0000)]
Attempting a fix the build bots should be happier with. Amends 198804.

llvm-svn: 198805

10 years agoSilencing an MSVC warning about control reaching the end of a non-void function.
Aaron Ballman [Wed, 8 Jan 2014 23:08:41 +0000 (23:08 +0000)]
Silencing an MSVC warning about control reaching the end of a non-void function.

llvm-svn: 198804

10 years agoFix the C++03 build.
Rafael Espindola [Wed, 8 Jan 2014 22:27:04 +0000 (22:27 +0000)]
Fix the C++03 build.

With c++11 we never instantiate the copy constructor.

llvm-svn: 198803

10 years agoOnly check os version for POSIX_SPAWN_CLOEXEC_DEFAULT on desktop builds of LLDB.
Greg Clayton [Wed, 8 Jan 2014 22:12:52 +0000 (22:12 +0000)]
Only check os version for POSIX_SPAWN_CLOEXEC_DEFAULT on desktop builds of LLDB.

llvm-svn: 198800

10 years agoUse getError and remove the error_code operator.
Rafael Espindola [Wed, 8 Jan 2014 22:03:39 +0000 (22:03 +0000)]
Use getError and remove the error_code operator.

llvm-svn: 198799

10 years ago[Mips] Remove unnecessary #include pragma.
Simon Atanasyan [Wed, 8 Jan 2014 22:00:35 +0000 (22:00 +0000)]
[Mips] Remove unnecessary #include pragma.

llvm-svn: 198798

10 years agoUse getError instead of the error_code operator.
Rafael Espindola [Wed, 8 Jan 2014 22:00:09 +0000 (22:00 +0000)]
Use getError instead of the error_code operator.

llvm-svn: 198797

10 years agoRemove vestigal bits of MC from the mangler. It no longer uses this, and
Chandler Carruth [Wed, 8 Jan 2014 21:59:22 +0000 (21:59 +0000)]
Remove vestigal bits of MC from the mangler. It no longer uses this, and
having the include could cause weird layering problems between the IR
and MC libraries.

llvm-svn: 198796

10 years agoConservatively handle multiple MMOs in MIsNeedChainEdge
Hal Finkel [Wed, 8 Jan 2014 21:52:02 +0000 (21:52 +0000)]
Conservatively handle multiple MMOs in MIsNeedChainEdge

MIsNeedChainEdge, which is used by -enable-aa-sched-mi (AA in misched), had an
llvm_unreachable when -enable-aa-sched-mi is enabled and we reach an
instruction with multiple MMOs. Instead, return a conservative answer. This
allows testing -enable-aa-sched-mi on x86.

Also, this moves the check above the isUnsafeMemoryObject checks.
isUnsafeMemoryObject is currently correct only for instructions with one MMO
(as noted in the comment in isUnsafeMemoryObject):

  // We purposefully do no check for hasOneMemOperand() here
  // in hope to trigger an assert downstream in order to
  // finish implementation.

The problem with this is that, had the candidate edge passed the
"!MIa->mayStore() && !MIb->mayStore()" check, the hoped-for assert would never
happen (which could, in theory, lead to incorrect behavior if one of these
secondary MMOs was volatile, for example).

llvm-svn: 198795

10 years agoMove declaration of variables down to first use.
Matt Arsenault [Wed, 8 Jan 2014 21:47:14 +0000 (21:47 +0000)]
Move declaration of variables down to first use.

llvm-svn: 198794

10 years agoAdd missing definitions of key_type and value_type to DenseSet.
Matt Arsenault [Wed, 8 Jan 2014 21:38:04 +0000 (21:38 +0000)]
Add missing definitions of key_type and value_type to DenseSet.

This matches std::set and allows using DenseSet with the functions
in SetOperations.h

llvm-svn: 198793

10 years agoAdd get and getError methods to ErrorOr.
Rafael Espindola [Wed, 8 Jan 2014 21:17:09 +0000 (21:17 +0000)]
Add get and getError methods to ErrorOr.

ErrorOr is modeled after boost::optional which has a get method.

llvm-svn: 198792

10 years ago[AArch64][NEON] Added UXTL and UXTL2 instruction aliases
Ana Pazos [Wed, 8 Jan 2014 21:02:13 +0000 (21:02 +0000)]
[AArch64][NEON] Added UXTL and UXTL2 instruction aliases

llvm-svn: 198791

10 years ago[Mips] GOT16 relocation against non-local symbol does not require a
Simon Atanasyan [Wed, 8 Jan 2014 20:43:03 +0000 (20:43 +0000)]
[Mips] GOT16 relocation against non-local symbol does not require a
paired LO16 relocation.

llvm-svn: 198790

10 years ago[Mips] Add assert to check that we handle all paired relocations.
Simon Atanasyan [Wed, 8 Jan 2014 20:42:52 +0000 (20:42 +0000)]
[Mips] Add assert to check that we handle all paired relocations.

llvm-svn: 198789

10 years ago[Mips] Factor out the code determines type of GOT entry (local/global)
Simon Atanasyan [Wed, 8 Jan 2014 20:42:45 +0000 (20:42 +0000)]
[Mips] Factor out the code determines type of GOT entry (local/global)
into the separate function.

llvm-svn: 198788

10 years ago[Mips] Do not use standard relocation identifier R_MIPS_NONE for
Simon Atanasyan [Wed, 8 Jan 2014 20:42:38 +0000 (20:42 +0000)]
[Mips] Do not use standard relocation identifier R_MIPS_NONE for
internal purpose. Use special LLD_R_MIPS_GLOBAL_GOT constant for that.

llvm-svn: 198787

10 years ago[Mips] Rename function to better reflect its purpose.
Simon Atanasyan [Wed, 8 Jan 2014 20:42:30 +0000 (20:42 +0000)]
[Mips] Rename function to better reflect its purpose.

llvm-svn: 198786

10 years ago[Mips] Do not save GOT headers atoms into the RelocationPass class
Simon Atanasyan [Wed, 8 Jan 2014 20:42:23 +0000 (20:42 +0000)]
[Mips] Do not save GOT headers atoms into the RelocationPass class
fields.

llvm-svn: 198785

10 years ago[Mips] Rename some classes to skip redundant mentioning of 'mips'.
Simon Atanasyan [Wed, 8 Jan 2014 20:42:17 +0000 (20:42 +0000)]
[Mips] Rename some classes to skip redundant mentioning of 'mips'.

llvm-svn: 198784

10 years ago[Mips] Move MipsGOTPass implementation to the separate file.
Simon Atanasyan [Wed, 8 Jan 2014 20:42:11 +0000 (20:42 +0000)]
[Mips] Move MipsGOTPass implementation to the separate file.

llvm-svn: 198783

10 years agoEnsure that ENABLE_SHARED is substituted for use in Windows builds
Alp Toker [Wed, 8 Jan 2014 20:06:24 +0000 (20:06 +0000)]
Ensure that ENABLE_SHARED is substituted for use in Windows builds

We (perhaps over-cautiously) disable the new plugin tests on static Windows
builds right now, matching what LLVM core does. This change was needed for the
lit check to work.

Thanks to Warren Hunt for spotting this.

llvm-svn: 198782

10 years ago[Serialization] In ASTReader::getInputFile record it when we didn't find the file...
Argyrios Kyrtzidis [Wed, 8 Jan 2014 19:13:34 +0000 (19:13 +0000)]
[Serialization] In ASTReader::getInputFile record it when we didn't find the file to avoid looking it up again.

Hopefully addresses rdar://14514222.

llvm-svn: 198781

10 years agoForce emit a relocation for @gnu_indirect_function symbols so that the indirect
Roman Divacky [Wed, 8 Jan 2014 18:50:32 +0000 (18:50 +0000)]
Force emit a relocation for @gnu_indirect_function symbols so that the indirect
resolution works.

llvm-svn: 198780

10 years ago[analyzer] Warn about double-delete in C++ at the second delete...
Jordan Rose [Wed, 8 Jan 2014 18:46:55 +0000 (18:46 +0000)]
[analyzer] Warn about double-delete in C++ at the second delete...

...rather somewhere in the destructor when we try to access something and
realize the object has already been deleted. This is necessary because
the destructor is processed before the 'delete' itself.

Patch by Karthik Bhat!

llvm-svn: 198779

10 years ago[x86] Remove OpSize16 flag from MOV32r0
David Woodhouse [Wed, 8 Jan 2014 18:38:26 +0000 (18:38 +0000)]
[x86] Remove OpSize16 flag from MOV32r0

It's not a real instruction any more and doesn't need encoding information.

llvm-svn: 198778

10 years agoTeach the DAGCombiner how to fold 'vselect' dag nodes according
Andrea Di Biagio [Wed, 8 Jan 2014 18:33:04 +0000 (18:33 +0000)]
Teach the DAGCombiner how to fold 'vselect' dag nodes according
to the following two rules:
  1) fold (vselect (build_vector AllOnes), A, B) -> A
  2) fold (vselect (build_vector AllZeros), A, B) -> B

llvm-svn: 198777

10 years agoFixed a kernel panic that would occur if you debug anything on MacOSX 10.7 or earlier...
Greg Clayton [Wed, 8 Jan 2014 18:02:51 +0000 (18:02 +0000)]
Fixed a kernel panic that would occur if you debug anything on MacOSX 10.7 or earlier due to the use of the POSIX_SPAWN_CLOEXEC_DEFAULT attribute flag that closes all file descriptors on exec. We now dyamically detect the OS version and do the right thing.

llvm-svn: 198776

10 years agoAdd missing rename from the previous commit.
Rafael Espindola [Wed, 8 Jan 2014 17:56:46 +0000 (17:56 +0000)]
Add missing rename from the previous commit.

No idea how this was compiling locally. Found by the bots.

llvm-svn: 198775

10 years agoRename get to getStorage and getError to getErrorStorage.
Rafael Espindola [Wed, 8 Jan 2014 17:43:26 +0000 (17:43 +0000)]
Rename get to getStorage and getError to getErrorStorage.

These private functions return pointers to the internal storage.

llvm-svn: 198774

10 years agoAdd missing test case for r198737.
Lang Hames [Wed, 8 Jan 2014 16:31:16 +0000 (16:31 +0000)]
Add missing test case for r198737.

llvm-svn: 198772

10 years agoRemove mention of old deleted test scripts from testing guide
Nico Rieck [Wed, 8 Jan 2014 16:30:03 +0000 (16:30 +0000)]
Remove mention of old deleted test scripts from testing guide

llvm-svn: 198771

10 years agoclang-format: Don't hang forever when encountering a stray "}" in an @implementation...
Benjamin Kramer [Wed, 8 Jan 2014 15:59:42 +0000 (15:59 +0000)]
clang-format: Don't hang forever when encountering a stray "}" in an @implementation block.

PR18406.

llvm-svn: 198770

10 years agoclang-format: Fix spacing in Cpp11 braced lists:
Daniel Jasper [Wed, 8 Jan 2014 15:41:13 +0000 (15:41 +0000)]
clang-format: Fix spacing in Cpp11 braced lists:

Before:
  vector<int> foo{ ::SomeFunction()};

After:
  vector<int> foo{::SomeFunction()};

llvm-svn: 198769

10 years ago[DAGCombiner] Factor duplicated rotate code into a separate function
Richard Sandiford [Wed, 8 Jan 2014 15:40:47 +0000 (15:40 +0000)]
[DAGCombiner] Factor duplicated rotate code into a separate function

No functional change intended.

llvm-svn: 198768

10 years agoDon't emit diagnostics for system headers.
Alexander Kornienko [Wed, 8 Jan 2014 15:21:08 +0000 (15:21 +0000)]
Don't emit diagnostics for system headers.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2519

llvm-svn: 198767

10 years agolit: Provide file location in cfg error messages
Alp Toker [Wed, 8 Jan 2014 14:20:59 +0000 (14:20 +0000)]
lit: Provide file location in cfg error messages

Python doesn't do a good job at diagnosing string exec() so use execfile()
where available.

This should be a timesaver when trying to get to the bottom of build bot
failures.

Before:

    File "llvm/utils/lit/lit/TestingConfig.py", line 93, in load_from_path
      exec("exec data in cfg_globals")
    File "<string>", line 1, in <module>
    File "<string>", line 194, in <module>
  NameError: name 'typo' is not defined

After:

    File "llvm/utils/lit/lit/TestingConfig.py", line 95, in load_from_path
    execfile(path, cfg_globals)
    File "clang/test/lit.cfg", line 194, in <module>
      typo
      ^~~~
  NameError: name 'typo' is not defined

llvm-svn: 198766

10 years agoTreating the RegParmAttr as a TypeAttr because that is what it is.
Aaron Ballman [Wed, 8 Jan 2014 13:23:01 +0000 (13:23 +0000)]
Treating the RegParmAttr as a TypeAttr because that is what it is.

Patch reviewed by Rafael Espindola.

llvm-svn: 198765

10 years agoDefine ENABLE_CLANG_EXAMPLES instead of relying on BUILD_EXAMPLES
Alp Toker [Wed, 8 Jan 2014 13:00:32 +0000 (13:00 +0000)]
Define ENABLE_CLANG_EXAMPLES instead of relying on BUILD_EXAMPLES

This is a further build fix attempt for r198747 on some Makefile builders where
the value wasn't set at all.

llvm-svn: 198764

10 years ago[x86] Support R_386_PC8, R_386_PC16 and R_X86_64_PC8
David Woodhouse [Wed, 8 Jan 2014 12:58:40 +0000 (12:58 +0000)]
[x86] Support R_386_PC8, R_386_PC16 and R_X86_64_PC8

llvm-svn: 198763