platform/upstream/llvm.git
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

10 years ago[x86] Add JMP_2 and other 16-bit PC-relative branch instructions
David Woodhouse [Wed, 8 Jan 2014 12:58:36 +0000 (12:58 +0000)]
[x86] Add JMP_2 and other 16-bit PC-relative branch instructions

Mark them as requiring 16-bit mode for now, since we don't yet have
relaxation support for FK_Data_2.

llvm-svn: 198762

10 years ago[x86] Do not relax PUSHi16 to PUSHi32 (PR18414)
David Woodhouse [Wed, 8 Jan 2014 12:58:32 +0000 (12:58 +0000)]
[x86] Do not relax PUSHi16 to PUSHi32 (PR18414)

They do *different* things to %esp, so they are not equivalent.

Rename PUSHi8 to PUSH32i8 and add the missing PUSH16i8.

llvm-svn: 198761

10 years ago[x86] Make AsmParser validate registers for memory operands a bit better
David Woodhouse [Wed, 8 Jan 2014 12:58:28 +0000 (12:58 +0000)]
[x86] Make AsmParser validate registers for memory operands a bit better

We can't do a perfect job here. We *have* to allow (%dx) even in 64-bit
mode, for example, because it might be used for an unofficial form of
the in/out instructions. We actually want to do a better job of validation
*later*. Perhaps *instead* of doing it where we are at the moment.

But for now, doing what validation we *can* do in the place that the code
already has its validation, is an improvement.

llvm-svn: 198760

10 years ago[x86] Fix MOV8ao8 et al for 16-bit mode, fix up disassembler to understand
David Woodhouse [Wed, 8 Jan 2014 12:58:24 +0000 (12:58 +0000)]
[x86] Fix MOV8ao8 et al for 16-bit mode, fix up disassembler to understand

It seems there is no separate instruction class for having AdSize *and*
OpSize bits set, which is required in order to disambiguate between all
these instructions. So add that to the disassembler.

Hm, perhaps we do need an AdSize16 bit after all?

llvm-svn: 198759

10 years ago[x86] Use 16-bit addressing where possible in 16-bit mode
David Woodhouse [Wed, 8 Jan 2014 12:58:18 +0000 (12:58 +0000)]
[x86] Use 16-bit addressing where possible in 16-bit mode

Where "where possible" means that it's an immediate value and it's below
0x10000. In fact GAS will either truncate or error with larger values,
and will insist on using the addr32 prefix to get 32-bit addressing. So
perhaps we should do that, in a later patch.

llvm-svn: 198758

10 years ago[x86] Fix JCXZ,JECXZ_32 for 16-bit mode
David Woodhouse [Wed, 8 Jan 2014 12:58:12 +0000 (12:58 +0000)]
[x86] Fix JCXZ,JECXZ_32 for 16-bit mode

JCXZ should have the 0x67 prefix only if we're in 32-bit mode, so make that
appropriately conditional. And JECXZ needs the prefix instead.

llvm-svn: 198757

10 years ago[x86] Disambiguate RET[QL] and fix aliases for 16-bit mode
David Woodhouse [Wed, 8 Jan 2014 12:58:07 +0000 (12:58 +0000)]
[x86] Disambiguate RET[QL] and fix aliases for 16-bit mode

I couldn't see how to do this sanely without splitting RETQ from RETL.

Eric says: "sad about the inability to roundtrip them now, but...".
I have no idea what that means, but perhaps it wants preserving in the
commit comment.

llvm-svn: 198756

10 years ago[x86] Disambiguate [LS][IG]DT{32,64}m and add 16-bit versions, fix aliases
David Woodhouse [Wed, 8 Jan 2014 12:57:55 +0000 (12:57 +0000)]
[x86] Disambiguate [LS][IG]DT{32,64}m and add 16-bit versions, fix aliases

llvm-svn: 198755

10 years ago[x86] Add JMP16[rm],CALL16[rm] instructions, and fix up aliases
David Woodhouse [Wed, 8 Jan 2014 12:57:49 +0000 (12:57 +0000)]
[x86] Add JMP16[rm],CALL16[rm] instructions, and fix up aliases

llvm-svn: 198754

10 years ago[x86] Add PUSHA16,POPA16 instructions, and fix aliases for 16-bit mode
David Woodhouse [Wed, 8 Jan 2014 12:57:45 +0000 (12:57 +0000)]
[x86] Add PUSHA16,POPA16 instructions, and fix aliases for 16-bit mode

llvm-svn: 198753

10 years ago[x86] Add OpSize16 to instructions that need it
David Woodhouse [Wed, 8 Jan 2014 12:57:40 +0000 (12:57 +0000)]
[x86] Add OpSize16 to instructions that need it

This fixes the bulk of 16-bit output, and the corresponding test case
x86-16.s now looks mostly like the x86-32.s test case that it was
originally based on. A few irrelevant instructions have been dropped,
and there are still some corner cases to be fixed in subsequent patches.

llvm-svn: 198752

10 years agoProspective build fix for the Makefile system
Alp Toker [Wed, 8 Jan 2014 12:03:17 +0000 (12:03 +0000)]
Prospective build fix for the Makefile system

llvm-svn: 198751

10 years agoBuild fix following r198747
Alp Toker [Wed, 8 Jan 2014 11:55:49 +0000 (11:55 +0000)]
Build fix following r198747

Convert CMake CLANG_BUILD_EXAMPLES to a boolean value for consumption by
Python, otherwise the raw config string gets passed through which may not be
0/1.

The if/else matches the technique used to solve the problem in LLVM's own
CMakeLists.txt.

llvm-svn: 198750

10 years agoUse -std=gnu99 in tools/llvm-c-test/CMakeLists.txt
Rafael Espindola [Wed, 8 Jan 2014 11:48:19 +0000 (11:48 +0000)]
Use -std=gnu99 in tools/llvm-c-test/CMakeLists.txt

With a current mingw (gcc 4.8.1) it looks like we hit some variation of

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40278

The end result is that off_t is not defined and the build fails without this
patch.

llvm-svn: 198749

10 years agoUse -std=gnu89 in tools/c-index-test/CMakeLists.txt
Rafael Espindola [Wed, 8 Jan 2014 11:44:42 +0000 (11:44 +0000)]
Use -std=gnu89 in tools/c-index-test/CMakeLists.txt

With the old use of -std=c89 off_t is not defined and the build fails.

This seems to be another variation of
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40278.

llvm-svn: 198748

10 years agoAdd tests for clang plugins
Alp Toker [Wed, 8 Jan 2014 11:38:47 +0000 (11:38 +0000)]
Add tests for clang plugins

Somehow the entire plugin infrastructure went wholly untested until now.

The only plugins available for use in testing are the examples, so plugin tests
will only be run if CLANG_BUILD_EXAMPLES is enabled in the build.

(The examples should really be enabled by default, not just to aid testing but
also to prevent bitrot in some key user-facing code. I'll propose that
shortly.)

Requires supporting changes in LLVM r198746.

llvm-svn: 198747

10 years agoCMake: Provide LLVM_PLUGIN_EXT definition
Alp Toker [Wed, 8 Jan 2014 11:10:24 +0000 (11:10 +0000)]
CMake: Provide LLVM_PLUGIN_EXT definition

This is needed to support the addition of tests for clang loadable plugins.

In clang, plugins are built as modules (bundles on OS X) rather than dynamic
libraries (dylib) so the build system needs to inform lit of the actual
file extension in use, typically '.so' on Unix and '.dll' on Windows.

(LLVM itself should probably switch to this scheme to fix PR14903 once and for
all.)

No change in build output or functionality intended.

llvm-svn: 198746

10 years agoAVX-512: Added more intrinsics for pmin/pmax, pabs, blend, pmuldq.
Elena Demikhovsky [Wed, 8 Jan 2014 10:54:22 +0000 (10:54 +0000)]
AVX-512: Added more intrinsics for pmin/pmax, pabs, blend, pmuldq.

llvm-svn: 198745

10 years ago[patch] Adjust behavior of FDE cross-section relocs for targets that don't support...
Iain Sandoe [Wed, 8 Jan 2014 10:22:54 +0000 (10:22 +0000)]
[patch] Adjust behavior of FDE cross-section relocs for targets that don't support abs-differences.

Modern versions of OSX/Darwin's ld (ld64 > 97.17) have an optimisation present that allows the back end to omit relocations (and replace them with an absolute difference) for FDE some text section refs.

This patch allows a backend to opt-in to this behaviour by setting "DwarfFDESymbolsUseAbsDiff".  At present, this is only enabled for modern x86 OSX ports.

test changes by David Fang.

llvm-svn: 198744

10 years ago[AArch64 NEON] Fix generating incorrect value type of NEON_VDUPLANE
Kevin Qin [Wed, 8 Jan 2014 08:06:14 +0000 (08:06 +0000)]
[AArch64 NEON] Fix generating incorrect value type of NEON_VDUPLANE
when lower build_vector if result value type mismatch with operand
value type.

llvm-svn: 198743

10 years agoFixes a bug preventing reading of the python register file.
Todd Fiala [Wed, 8 Jan 2014 07:52:40 +0000 (07:52 +0000)]
Fixes a bug preventing reading of the python register file.

This change fixes a bug recently introduced in ProcessGDBRemote that
prevented the Python register definition file from getting loaded when
the qRegisterInfo0 response returned $00#.

Patch by Steve Pucci.

llvm-svn: 198742

10 years agoFor AArch64, support builtin neon vector type with 'long' as base element type.
Jiangning Liu [Wed, 8 Jan 2014 07:51:48 +0000 (07:51 +0000)]
For AArch64, support builtin neon vector type with 'long' as base element type.

llvm-svn: 198741

10 years ago[SparcV9] Rename operands in some sparc64 instructions so that TableGen can encode...
Venkatraman Govindaraju [Wed, 8 Jan 2014 07:47:57 +0000 (07:47 +0000)]
[SparcV9] Rename operands in some sparc64 instructions so that TableGen can encode them correctly.

llvm-svn: 198740

10 years ago[Sparc] Correct the mask for fixup_sparc_br19.
Venkatraman Govindaraju [Wed, 8 Jan 2014 06:46:51 +0000 (06:46 +0000)]
[Sparc] Correct the mask for fixup_sparc_br19.

llvm-svn: 198739

10 years ago[Sparc] Add support for parsing branch instructions and conditional moves.
Venkatraman Govindaraju [Wed, 8 Jan 2014 06:14:52 +0000 (06:14 +0000)]
[Sparc] Add support for parsing branch instructions and conditional moves.

llvm-svn: 198738

10 years agoRe-apply r196639: Add support for archives and object file caching under MCJIT.
Lang Hames [Wed, 8 Jan 2014 04:09:09 +0000 (04:09 +0000)]
Re-apply r196639: Add support for archives and object file caching under MCJIT.

I believe the bot failures on linux systems were due to overestimating the
alignment of object-files within archives, which are only guaranteed to be
two-byte aligned. I have reduced the alignment in
RuntimeDyldELF::createObjectImageFromFile accordingly.

llvm-svn: 198737

10 years agotests: disable ARM unwinding tests if ARM is unavailable
Saleem Abdulrasool [Wed, 8 Jan 2014 03:44:01 +0000 (03:44 +0000)]
tests: disable ARM unwinding tests if ARM is unavailable

Appease the buildbots for targets which do not build the ARM support by moving
the ARM specific test into a subdirectory and use the lit configuration to
disable them appropriately.

Thanks to chapuni and thakis for explaining how to do this!

llvm-svn: 198736