platform/upstream/llvm.git
9 years agoUpdate for clang r230512
David Majnemer [Wed, 25 Feb 2015 17:36:49 +0000 (17:36 +0000)]
Update for clang r230512

llvm-svn: 230513

9 years agoSema: Parenthesized bound destructor member expressions can be called
David Majnemer [Wed, 25 Feb 2015 17:36:15 +0000 (17:36 +0000)]
Sema: Parenthesized bound destructor member expressions can be called

We would wrongfully reject (a.~A)() in both the destructor and
pseudo-destructor cases.

This fixes PR22668.

llvm-svn: 230512

9 years agofix a typo
Chris Lattner [Wed, 25 Feb 2015 17:28:41 +0000 (17:28 +0000)]
fix a typo

llvm-svn: 230510

9 years agoMacOSX symbol table change to combine the N_GSYM debug map entry with the "_OBJC_CLAS...
Greg Clayton [Wed, 25 Feb 2015 17:25:02 +0000 (17:25 +0000)]
MacOSX symbol table change to combine the N_GSYM debug map entry with the "_OBJC_CLASS_$_", "_OBJC_METACLASS_$_", and "_OBJC_IVAR_$_" non debug symbols. This allows the symbol that represents the object file to contain the eSymbolTypeObjCClass and eSymbolTypeObjCMetaClass and will help us to be able to efficiently lookup the real definition of an objective C class without loading all .o files linearly to find the .o file that contains the true definition.

llvm-svn: 230509

9 years agoFix the dumping of symbol tables to be correctly alligned for all entries when using...
Greg Clayton [Wed, 25 Feb 2015 17:22:05 +0000 (17:22 +0000)]
Fix the dumping of symbol tables to be correctly alligned for all entries when using "image dump symtab".

llvm-svn: 230508

9 years agoAddress post-commit feedback on r230344: Don't use weak hooks on Sanitizer Go build...
Timur Iskhodzhanov [Wed, 25 Feb 2015 17:19:42 +0000 (17:19 +0000)]
Address post-commit feedback on r230344: Don't use weak hooks on Sanitizer Go build for Windows

llvm-svn: 230507

9 years agoReland r230019 - [ASan] Make the argument of '__sanitizer_annotate_contiguous_contain...
Timur Iskhodzhanov [Wed, 25 Feb 2015 17:03:34 +0000 (17:03 +0000)]
Reland r230019 - [ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand

This incorporates the fix for ARM architecture suggested by Renato Golin.

llvm-svn: 230506

9 years agoFix duplicate test code introduced by running "patch -p0" twice
Timur Iskhodzhanov [Wed, 25 Feb 2015 17:01:09 +0000 (17:01 +0000)]
Fix duplicate test code introduced by running "patch -p0" twice

Sorry, SVN had some weird problems so I had to revert and reapply the patch
locally a couple of times and didn't notice I've added file contents to the same
file....

llvm-svn: 230505

9 years agoFix formatting
Tobias Grosser [Wed, 25 Feb 2015 16:59:15 +0000 (16:59 +0000)]
Fix formatting

llvm-svn: 230504

9 years agoReland r230460 with a test fix for -Asserts builds.
Nico Weber [Wed, 25 Feb 2015 16:25:00 +0000 (16:25 +0000)]
Reland r230460 with a test fix for -Asserts builds.

Original CL description:
Produce less broken basic block sequences for __finally blocks.

The way cleanups (such as PerformSEHFinally) get emitted is that codegen
generates some initialization code, then calls the cleanup's Emit() with the
insertion point set to a good place, then the cleanup is supposed to emit its
stuff, and then codegen might tack in a jump or similar to where the insertion
point is after the cleanup.

The PerformSEHFinally cleanup tries to just stash away the block it's supposed
to codegen into, and then does codegen later, into that stashed block.  However,
after codegen'ing the __finally block, it used to set the insertion point to
the finally's continuation block (where the __finally cleanup goes when its body
is completed after regular, non-exceptional control flow).  That's not correct,
as that block can (and generally does) already ends in a jump.  Instead,
remember the insertion point that was current before the __finally got emitted,
and restore that.

Fixes two of the crashes in PR22553.

llvm-svn: 230503

9 years agoAdd missing "return" statements.
Hafiz Abid Qadeer [Wed, 25 Feb 2015 16:01:12 +0000 (16:01 +0000)]
Add missing "return" statements.

ExecutionContext::GetAddressByteSize() was calling GettAddressByteSize () on Target and Process class but was ignoring the return type. I have added the missing return.
No regression in the test suite. Committed as obvious.

llvm-svn: 230502

9 years agoReland r230419 - add __asan_default_suppressions() hook with a fix for Windows
Timur Iskhodzhanov [Wed, 25 Feb 2015 16:00:26 +0000 (16:00 +0000)]
Reland r230419 - add __asan_default_suppressions() hook with a fix for Windows

llvm-svn: 230501

9 years ago[MIPS]Multiple and add instructions for Mips are currently available in mips32r2...
Vladimir Medic [Wed, 25 Feb 2015 15:24:37 +0000 (15:24 +0000)]
[MIPS]Multiple and add instructions for Mips are currently available in mips32r2/mips64r2 and later but should also be available in mips4, mips5, and mips64. This patch fixes the requested features and updates the corresponding test files.

llvm-svn: 230500

9 years ago[X86][MMX] Reapply: Add MMX instructions to foldable tables
Bruno Cardoso Lopes [Wed, 25 Feb 2015 15:14:02 +0000 (15:14 +0000)]
[X86][MMX] Reapply: Add MMX instructions to foldable tables

Reapply r230248.

Teach the peephole optimizer to work with MMX instructions by adding
entries into the foldable tables. This covers folding opportunities not
handled during isel.

llvm-svn: 230499

9 years ago[X86][MMX] Prevent MMX_MOVD64rm folding
Bruno Cardoso Lopes [Wed, 25 Feb 2015 15:13:52 +0000 (15:13 +0000)]
[X86][MMX] Prevent MMX_MOVD64rm folding

MMX_MOVD64rm zero-extends i32 load results into i64 registers.

The peephole optimizer will try to fold it in other MMX foldable
instructions, the wrong thing to do, since there's no MMX memory
instruction that loads from i32 and does implict zero extension.

Remove 'canFoldAsLoad' from MOVD64rm in order to prevent such folding.
The current MMX tests already test this, but since there are no MMX
instructions in the foldable tables yet, this did not trigger. This
commit prepares the addition of those instructions.

llvm-svn: 230498

9 years ago[clang-tidy] Use the new ArrayRef<FixItHint> inserter.
Alexander Kornienko [Wed, 25 Feb 2015 14:42:02 +0000 (14:42 +0000)]
[clang-tidy] Use the new ArrayRef<FixItHint> inserter.

llvm-svn: 230497

9 years agoImprove handling of stack accesses in Thumb-1
Renato Golin [Wed, 25 Feb 2015 14:41:06 +0000 (14:41 +0000)]
Improve handling of stack accesses in Thumb-1

Thumb-1 only allows SP-based LDR and STR to be word-sized, and SP-base LDR,
STR, and ADD only allow offsets that are a multiple of 4. Make some changes
to better make use of these instructions:

* Use word loads for anyext byte and halfword loads from the stack.
* Enforce 4-byte alignment on objects accessed in this way, to ensure that
  the offset is valid.
* Do the same for objects whose frame index is used, in order to avoid having
  to use more than one ADD to generate the frame index.
* Correct how many bits of offset we think AddrModeT1_s has.

Patch by John Brawn.

llvm-svn: 230496

9 years agoAdd support for inserting ArrayRef<FixItHint> into DiagnosticBuilder.
Alexander Kornienko [Wed, 25 Feb 2015 14:40:56 +0000 (14:40 +0000)]
Add support for inserting ArrayRef<FixItHint> into DiagnosticBuilder.

This is going to be needed in clang-tidy as more checks add complex fixits.

llvm-svn: 230495

9 years agoInstrProf: Fix warnings for mixed declarations and code. NFC.
Vasileios Kalintiris [Wed, 25 Feb 2015 13:50:18 +0000 (13:50 +0000)]
InstrProf: Fix warnings for mixed declarations and code. NFC.

llvm-svn: 230494

9 years agoRemove use_pthread option from getBuildFlags in the test environment
Tamas Berghammer [Wed, 25 Feb 2015 13:26:28 +0000 (13:26 +0000)]
Remove use_pthread option from getBuildFlags in the test environment

Removing the option to require the usage of pthread based on an argument
of the getBuildFlags method in lldbtest.py because it can be specified
by a variable in the makefile for the given test case. Using the
variable in the makefile works in all supported platforms.

Differential revision: http://reviews.llvm.org/D7861

llvm-svn: 230493

9 years agoTruncate target file for stdout and stderr
Tamas Berghammer [Wed, 25 Feb 2015 13:21:45 +0000 (13:21 +0000)]
Truncate target file for stdout and stderr

Add O_TRUNC when opening file for redirecting stdout and stderr of the
process. It is neccessary because if the file exists then on some
platform the original content is kept while it isn't overwritten by the
new data causing pollution of the saved stdout and stderr.

llvm-svn: 230492

9 years ago[clang-tidy] Correct spelling error in test file name. NFC.
Alexander Kornienko [Wed, 25 Feb 2015 13:17:14 +0000 (13:17 +0000)]
[clang-tidy] Correct spelling error in test file name. NFC.

Patch by Richard Thomson!
http://reviews.llvm.org/D7603

llvm-svn: 230491

9 years ago[clang-tidy] Correct confusion between overwrite and override. NFC.
Alexander Kornienko [Wed, 25 Feb 2015 13:05:33 +0000 (13:05 +0000)]
[clang-tidy] Correct confusion between overwrite and override. NFC.

Patch by Richard Thomson!
http://reviews.llvm.org/D7604

llvm-svn: 230490

9 years agoSilencing a "result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift...
Aaron Ballman [Wed, 25 Feb 2015 13:05:24 +0000 (13:05 +0000)]
Silencing a "result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)" warning in MSVC; NFC.

llvm-svn: 230489

9 years agoSilencing a -Wsign-compare warning triggered in MSVC; NFC.
Aaron Ballman [Wed, 25 Feb 2015 13:02:23 +0000 (13:02 +0000)]
Silencing a -Wsign-compare warning triggered in MSVC; NFC.

llvm-svn: 230488

9 years agoFix global makefiles for the tests to support android
Tamas Berghammer [Wed, 25 Feb 2015 13:02:08 +0000 (13:02 +0000)]
Fix global makefiles for the tests to support android

Two changes are required to compile the tests for android
* Disable the usage of -lpthread as it is included by default on
  android
* Add -pie to the linker flags because android only support position
  independent executables

Differential revision: http://reviews.llvm.org/D7856

llvm-svn: 230487

9 years agoAdd option to set environment variables from dotest.py
Tamas Berghammer [Wed, 25 Feb 2015 12:22:40 +0000 (12:22 +0000)]
Add option to set environment variables from dotest.py

Setting environment variables are required when testing on a remote
target requiring different flags then the ones specified on the host OS.

Differential revision: http://reviews.llvm.org/D7854

llvm-svn: 230485

9 years agoAdd trailing return types (and noexcept specifications) to the 'diamond operators...
Marshall Clow [Wed, 25 Feb 2015 12:20:52 +0000 (12:20 +0000)]
Add trailing return types (and noexcept specifications) to the 'diamond operators'. Fixes PR#22600.

llvm-svn: 230484

9 years ago[clang-tidy] Fixed a false positive case in misc-inaccurate-erase checker.
Gabor Horvath [Wed, 25 Feb 2015 12:17:03 +0000 (12:17 +0000)]
[clang-tidy] Fixed a false positive case in misc-inaccurate-erase checker.

llvm-svn: 230483

9 years agoReplace obsolete -mattr=n64 command line option with -target-abi=n64. No functional...
Vladimir Medic [Wed, 25 Feb 2015 11:43:01 +0000 (11:43 +0000)]
Replace obsolete -mattr=n64 command line option with -target-abi=n64. No functional changes.

llvm-svn: 230482

9 years agoFix comment in test/tools/lldb-mi/main.cpp
Ilia K [Wed, 25 Feb 2015 11:04:40 +0000 (11:04 +0000)]
Fix comment in test/tools/lldb-mi/main.cpp

llvm-svn: 230481

9 years agoGlobalLayoutBuilder::addFragment(): Prune incorrect usage of \param(s). [-Wdocumentation]
NAKAMURA Takumi [Wed, 25 Feb 2015 11:04:36 +0000 (11:04 +0000)]
GlobalLayoutBuilder::addFragment(): Prune incorrect usage of \param(s). [-Wdocumentation]

llvm-svn: 230480

9 years agoFix UTF8 chars to ASCII.
NAKAMURA Takumi [Wed, 25 Feb 2015 11:02:00 +0000 (11:02 +0000)]
Fix UTF8 chars to ASCII.

llvm-svn: 230479

9 years agoWhitespace.
NAKAMURA Takumi [Wed, 25 Feb 2015 10:50:06 +0000 (10:50 +0000)]
Whitespace.

llvm-svn: 230478

9 years agoRevert r230448, "Reland r230314 "Fix codegen for virtual methods that are (re-) expor...
NAKAMURA Takumi [Wed, 25 Feb 2015 10:49:59 +0000 (10:49 +0000)]
Revert r230448, "Reland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple modules."", since I have reverted r230446.

llvm-svn: 230477

9 years agoSkip symlinks to the original file when searching for debug info
Pavel Labath [Wed, 25 Feb 2015 10:44:35 +0000 (10:44 +0000)]
Skip symlinks to the original file when searching for debug info

Summary:
Symbols::LocateExecutableSymbolFile tries to locate the file in containing the debug info in a
splitdebug configuration. It tries to skip over the original file in its search path, but it was
easily fooled by symlinks. This changes the function to use llvm::sys::fs::equivalent, which can
correctly compare symlinks.

As a side effect, I had to fix one test because the address for the "abort" function resolves on
my system to "__GI_abort" now. With the debug info, the libc on my system contains two symbols
associated with the address of the abort function, and lldb prefers __GI_abort, possibly because
the debug info is associated with it. It would be nice at some point to have it prefer the public
symbol name.

Reviewers: emaste, zturner

Subscribers: lldb-commits

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

llvm-svn: 230476

9 years agoWhitespace.
NAKAMURA Takumi [Wed, 25 Feb 2015 10:32:20 +0000 (10:32 +0000)]
Whitespace.

llvm-svn: 230475

9 years agoRevert r230446, "MS ABI: Try to respect external AST source record layouts"
NAKAMURA Takumi [Wed, 25 Feb 2015 10:32:13 +0000 (10:32 +0000)]
Revert r230446, "MS ABI: Try to respect external AST source record layouts"

It fails on Clang::PCH/headersearch.cpp for targeting msvc.

llvm-svn: 230474

9 years agoclang-format: Fix spacing for function with ref-qualification ..
Daniel Jasper [Wed, 25 Feb 2015 10:30:06 +0000 (10:30 +0000)]
clang-format: Fix spacing for function with ref-qualification ..

.. when using SpacesInCStyleCastParentheses != SpacesInParentheses.

Before:
  FormatStyle Spaces = getLLVMStyle();
  Deleted &operator=(const Deleted &)& = default;

  Spaces.SpacesInParentheses = true;
  Deleted(const Deleted &)& = default;

  Spaces.SpacesInCStyleCastParentheses = true;
  Spaces.SpacesInParentheses= false;
  Deleted( const Deleted & )& = default;

After:
  FormatStyle Spaces = getLLVMStyle();
  Deleted &operator=(const Deleted &)& = default;;

  Spaces.SpacesInParentheses= true;
  Deleted( const Deleted & )& = default;

  Spaces.SpacesInCStyleCastParentheses = true;
  Spaces.SpacesInParentheses= false;
  Deleted(const Deleted &)& = default;

Patch by Jean-Philippe Dufraigne. Thank you!

llvm-svn: 230473

9 years agoRevert "Produce less broken basic block sequences for __finally blocks."
Daniel Jasper [Wed, 25 Feb 2015 10:07:14 +0000 (10:07 +0000)]
Revert "Produce less broken basic block sequences for __finally blocks."

The test is broken on buildbots:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/2279/

This reverts commit adda738b6dc533c42db5f5f5b31344098a3aba7d.

llvm-svn: 230472

9 years agoAVX-512: Gather and Scatter patterns
Elena Demikhovsky [Wed, 25 Feb 2015 09:46:31 +0000 (09:46 +0000)]
AVX-512: Gather and Scatter patterns
Gather and scatter instructions additionally write to one of the source operands - mask register.
In this case Gather has 2 destination values - the loaded value and the mask.
Till now we did not support code gen pattern for gather - the instruction was generated from
intrinsic only and machine node was hardcoded.
When we introduce the masked_gather node, we need to select instruction automatically,
in the standard way.
I added a flag "hasTwoExplicitDefs" that allows to handle 2 destination operands.

(Some code in the X86InstrFragmentsSIMD.td is commented out, just to split one big
patch in many small patches)

llvm-svn: 230471

9 years ago[OPENMP] Rename methods of OpenMPRuntime class. NFC.
Alexey Bataev [Wed, 25 Feb 2015 08:32:46 +0000 (08:32 +0000)]
[OPENMP] Rename methods of OpenMPRuntime class. NFC.

llvm-svn: 230470

9 years ago[Mips] Support mips-r6 path suffix for Adnroid MIPS toolchain
Simon Atanasyan [Wed, 25 Feb 2015 07:31:12 +0000 (07:31 +0000)]
[Mips] Support mips-r6 path suffix for Adnroid MIPS toolchain

This path suffix is used if user provides the -mips32r6 command line
options.

llvm-svn: 230469

9 years agoAdd extra acceptable characters to CMICmdArgValFile (MI)
Ilia K [Wed, 25 Feb 2015 06:34:05 +0000 (06:34 +0000)]
Add extra acceptable characters to CMICmdArgValFile (MI)

Summary:
Improve CMICmdArgValFile::IsValidChars to accept extra characters that can be in file name:
```
.'\"`@#$%^&*()_+-={}[]|
```

Enable MiSyntaxTestCase.test_lldbmi_specialchars test.

All test pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, emaste, clayborg, abidh

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

llvm-svn: 230468

9 years agoFix MiSignalTestCase.xxx_remote tests after r230466
Ilia K [Wed, 25 Feb 2015 06:29:48 +0000 (06:29 +0000)]
Fix MiSignalTestCase.xxx_remote tests after r230466

llvm-svn: 230467

9 years agoFix ImportError in lldb-mi tests on Linux
Ilia K [Wed, 25 Feb 2015 06:21:35 +0000 (06:21 +0000)]
Fix ImportError in lldb-mi tests on Linux

Summary:
This patch fixes the following error:
```
 File "/home/llvmbb/llvm-build-dir/lldb-x86_64-clang-ubuntu-14.04/llvm/tools/lldb/test/tools/lldb-mi/signal/TestMiSignal.py", line 5, in <module>
    import lldbmi_testcase
ImportError: No module named lldbmi_testcase
```

Reviewers: vharron, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, vharron, clayborg, abidh

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

llvm-svn: 230466

9 years ago[ELF][X86_64] Handle R_X86_64_PC64 relocation
Davide Italiano [Wed, 25 Feb 2015 05:56:05 +0000 (05:56 +0000)]
[ELF][X86_64] Handle R_X86_64_PC64 relocation

Differential Revision: D7820
Reviewed by: shankarke, ruiu

llvm-svn: 230465

9 years agoRestores r228382, which was reverted in r228406.
Sameer Sahasrabuddhe [Wed, 25 Feb 2015 05:48:23 +0000 (05:48 +0000)]
Restores r228382, which was reverted in r228406.

The original commit failed to handle "shift assign" (<<=), which
broke the test mentioned in r228406. This is now fixed and the
test added to the lit tests under SemaOpenCL.

*** Original commit message from r228382 ***

OpenCL: handle shift operator with vector operands

Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.

Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".

  char2 foo(char2 v) { return v << 1; }

Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.

llvm-svn: 230464

9 years agoFix CommandLineCompletionTestCase.test_watchpoint_xxx tests after r230408
Ilia K [Wed, 25 Feb 2015 05:47:10 +0000 (05:47 +0000)]
Fix CommandLineCompletionTestCase.test_watchpoint_xxx tests after r230408

llvm-svn: 230463

9 years ago[IC] Turn non-null MD on pointer loads to range MD on integer loads.
Charles Davis [Wed, 25 Feb 2015 05:10:25 +0000 (05:10 +0000)]
[IC] Turn non-null MD on pointer loads to range MD on integer loads.

Summary:
This change fixes the FIXME that you recently added when you committed
(a modified version of) my patch.  When `InstCombine` combines a load and
store of an pointer to those of an equivalently-sized integer, it currently
drops any `!nonnull` metadata that might be present.  This change replaces
`!nonnull` metadata with `!range !{ 1, -1 }` metadata instead.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 230462

9 years agoRevert 230419, 230425, 230432.
Nico Weber [Wed, 25 Feb 2015 04:39:21 +0000 (04:39 +0000)]
Revert 230419, 230425, 230432.

They don't build on Windows.
http://lab.llvm.org:8011/builders/sanitizer-windows/ went red for example.

llvm-svn: 230461

9 years agoProduce less broken basic block sequences for __finally blocks.
Nico Weber [Wed, 25 Feb 2015 04:05:18 +0000 (04:05 +0000)]
Produce less broken basic block sequences for __finally blocks.

The way cleanups (such as PerformSEHFinally) get emitted is that codegen
generates some initialization code, then calls the cleanup's Emit() with the
insertion point set to a good place, then the cleanup is supposed to emit its
stuff, and then codegen might tack in a jump or similar to where the insertion
point is after the cleanup.

The PerformSEHFinally cleanup tries to just stash away the block it's supposed
to codegen into, and then does codegen later, into that stashed block.  However,
after codegen'ing the __finally block, it used to set the insertion point to
the finally's continuation block (where the __finally cleanup goes when its body
is completed after regular, non-exceptional control flow).  That's not correct,
as that block can (and generally does) already ends in a jump.  Instead,
remember the insertion point that was current before the __finally got emitted,
and restore that.

Fixes two of the crashes in PR22553.

llvm-svn: 230460

9 years agoAdd comments for two CleanupKinds.
Nico Weber [Wed, 25 Feb 2015 03:58:36 +0000 (03:58 +0000)]
Add comments for two CleanupKinds.

llvm-svn: 230459

9 years agodocs: Document optimizations in control flow integrity design doc.
Peter Collingbourne [Wed, 25 Feb 2015 03:35:03 +0000 (03:35 +0000)]
docs: Document optimizations in control flow integrity design doc.

llvm-svn: 230458

9 years agoAdd some missing #includes and forward declarations found by modules build.
Richard Smith [Wed, 25 Feb 2015 03:12:03 +0000 (03:12 +0000)]
Add some missing #includes and forward declarations found by modules build.

llvm-svn: 230457

9 years agoRevert "Adapt clang-tools-extra to clang module format changes."
Adrian Prantl [Wed, 25 Feb 2015 02:46:37 +0000 (02:46 +0000)]
Revert "Adapt clang-tools-extra to clang module format changes."

This reverts commit 230424.

llvm-svn: 230456

9 years agoRevert "Add a missing target requirement."
Adrian Prantl [Wed, 25 Feb 2015 02:46:29 +0000 (02:46 +0000)]
Revert "Add a missing target requirement."

This reverts commit 230430.

llvm-svn: 230455

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Wed, 25 Feb 2015 02:44:04 +0000 (02:44 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

llvm-svn: 230454

9 years agoRevert "Add a missing target requirement."
Adrian Prantl [Wed, 25 Feb 2015 02:43:38 +0000 (02:43 +0000)]
Revert "Add a missing target requirement."

llvm-svn: 230453

9 years agobuild: check if atomic routines are implicitly provided
Saleem Abdulrasool [Wed, 25 Feb 2015 02:38:03 +0000 (02:38 +0000)]
build: check if atomic routines are implicitly provided

It is possible for the atomic routines to be provided by the compiler without
requiring any additional libraries.  Check if that is the case before checking
for a library.

Patch by Matt Glazar!

llvm-svn: 230452

9 years agoWhen FileSpec::Resolve is given a bare file like "ls",
Jason Molenda [Wed, 25 Feb 2015 02:35:25 +0000 (02:35 +0000)]
When FileSpec::Resolve is given a bare file like "ls",
and llvm::sys::fs::make_absolute prepends the current
working directory to that path, leave the original
bare file name unchanged if $cwd/ls doesn't exist.

http://reviews.llvm.org/D7477
<rdar://problem/18775190>

llvm-svn: 230451

9 years agoFix bots failing on an explicit triple
Reid Kleckner [Wed, 25 Feb 2015 02:32:00 +0000 (02:32 +0000)]
Fix bots failing on an explicit triple

Why do we need a registered target for this?

llvm-svn: 230450

9 years agoDon't crash on missing '{' after __except or __finally, PR22687.
Nico Weber [Wed, 25 Feb 2015 02:22:06 +0000 (02:22 +0000)]
Don't crash on missing '{' after __except or __finally, PR22687.

Also add some general test/Parser coverage for SEH blocks.

llvm-svn: 230449

9 years agoReland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple...
Reid Kleckner [Wed, 25 Feb 2015 02:19:56 +0000 (02:19 +0000)]
Reland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple modules."

This reverts the revert from commit r230406.

The changes in r230445 and r230446 make the test pass on Windows now.

llvm-svn: 230448

9 years agoMS ABI: Add triple to test relying on key functions
Reid Kleckner [Wed, 25 Feb 2015 02:16:15 +0000 (02:16 +0000)]
MS ABI: Add triple to test relying on key functions

llvm-svn: 230447

9 years agoMS ABI: Try to respect external AST source record layouts
Reid Kleckner [Wed, 25 Feb 2015 02:16:09 +0000 (02:16 +0000)]
MS ABI: Try to respect external AST source record layouts

Covered by existing tests in test/CodeGen/override-layout.c and
test/CodeGenCXX/override-layout.cpp. Seriously, they found real bugs in
my code. :)

llvm-svn: 230446

9 years agoAdd missing MD canonicalization to MS vtable builder
Reid Kleckner [Wed, 25 Feb 2015 02:16:02 +0000 (02:16 +0000)]
Add missing MD canonicalization to MS vtable builder

llvm-svn: 230445

9 years ago[asan] one more attempt to fix windows build
Kostya Serebryany [Wed, 25 Feb 2015 02:00:26 +0000 (02:00 +0000)]
[asan] one more attempt to fix windows build

llvm-svn: 230432

9 years agoAdd a missing target requirement.
Adrian Prantl [Wed, 25 Feb 2015 01:52:10 +0000 (01:52 +0000)]
Add a missing target requirement.

llvm-svn: 230430

9 years agoAdd a missing target requirement.
Adrian Prantl [Wed, 25 Feb 2015 01:52:05 +0000 (01:52 +0000)]
Add a missing target requirement.

llvm-svn: 230429

9 years agoRemove slow and apparently pointless updating of all identifiers at the start
Richard Smith [Wed, 25 Feb 2015 01:45:32 +0000 (01:45 +0000)]
Remove slow and apparently pointless updating of all identifiers at the start
of writing out an AST file.

llvm-svn: 230428

9 years ago[modules] Add include/llvm/IR/DebugInfoFlags.def to the textual headers list.
Richard Smith [Wed, 25 Feb 2015 01:44:09 +0000 (01:44 +0000)]
[modules] Add include/llvm/IR/DebugInfoFlags.def to the textual headers list.

llvm-svn: 230427

9 years agoFold ParseSEHTryBlockCommon() into its only caller. No behavior change.
Nico Weber [Wed, 25 Feb 2015 01:43:27 +0000 (01:43 +0000)]
Fold ParseSEHTryBlockCommon() into its only caller. No behavior change.

ParseCXXTryBlockCommon() makes sense because it has two callers due to
function try blocks.  There are no SEH function try blocks.

llvm-svn: 230426

9 years ago[asan] attempting to fix the windows build
Kostya Serebryany [Wed, 25 Feb 2015 01:41:42 +0000 (01:41 +0000)]
[asan] attempting to fix the windows build

llvm-svn: 230425

9 years agoAdapt clang-tools-extra to clang module format changes.
Adrian Prantl [Wed, 25 Feb 2015 01:32:04 +0000 (01:32 +0000)]
Adapt clang-tools-extra to clang module format changes.
- add clangCodeGen.a to the tools that need it
- tweak pp-trace command line handling to not conflict with clang's.

llvm-svn: 230424

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Wed, 25 Feb 2015 01:31:45 +0000 (01:31 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

This reapplies r230044 with a fixed configure+make build and updated
dependencies and testcase requirements. Over the last iteration this
version adds
- missing target requirements for testcases that specify an x86 triple,
- a missing clangCodeGen.a dependency to libClang.a in the make build.

rdar://problem/19104245

llvm-svn: 230423

9 years agoSuppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system...
Michael J. Spencer [Wed, 25 Feb 2015 01:30:13 +0000 (01:30 +0000)]
Suppress 'warning C4062: enumerator X in switch of enum Y is not handled' from system header.

llvm-svn: 230422

9 years ago[PowerPC] Add triples to QPX tests
Hal Finkel [Wed, 25 Feb 2015 01:26:59 +0000 (01:26 +0000)]
[PowerPC] Add triples to QPX tests

Some of these tests fail on Darwin systems because of a lack of a triple;
fix that.

llvm-svn: 230421

9 years ago[GC] Document the recently added PlaceSafepoints and RewriteGCForStatepoints passes
Philip Reames [Wed, 25 Feb 2015 01:23:59 +0000 (01:23 +0000)]
[GC] Document the recently added PlaceSafepoints and RewriteGCForStatepoints passes

llvm-svn: 230420

9 years ago[asan] add __asan_default_suppressions() hook
Kostya Serebryany [Wed, 25 Feb 2015 01:15:37 +0000 (01:15 +0000)]
[asan] add __asan_default_suppressions() hook

llvm-svn: 230419

9 years agoFix logging in GDBRemoteCommunicationServerPlatform.
Oleksiy Vyalov [Wed, 25 Feb 2015 01:11:38 +0000 (01:11 +0000)]
Fix logging in GDBRemoteCommunicationServerPlatform.

llvm-svn: 230418

9 years agoMake RedeclarableResult's ownership-transferring constructor be a move
Richard Smith [Wed, 25 Feb 2015 01:11:29 +0000 (01:11 +0000)]
Make RedeclarableResult's ownership-transferring constructor be a move
constructor.

llvm-svn: 230417

9 years agollvm-dis: Stop crashing when dropping debug info
Duncan P. N. Exon Smith [Wed, 25 Feb 2015 01:10:03 +0000 (01:10 +0000)]
llvm-dis: Stop crashing when dropping debug info

Since r199356, we've printed a warning when dropping debug info.
r225562 started crashing on that, since it registered a diagnostic
handler that only expected errors.  This fixes the handler to expect
other severities.  As a side effect, it now prints "error: " at the
start of error messages, similar to `llvm-as`.

There was a testcase for r199356, but it only really checked the
assembler.  Move `test/Bitcode/drop-debug-info.ll` to `test/Assembler`,
and introduce `test/Bitcode/drop-debug-info.3.5.ll` (and companion
`.bc`) to test the bitcode reader.

Note: tools/gold/gold-plugin.cpp has an equivalent bug, but I'm not sure
what the best fix is there.  I'll file a PR.

llvm-svn: 230416

9 years ago[opaque pointer type] Bitcode support for explicit type parameter on GEP.
David Blaikie [Wed, 25 Feb 2015 01:08:52 +0000 (01:08 +0000)]
[opaque pointer type] Bitcode support for explicit type parameter on GEP.

Like r230414, add bitcode support including backwards compatibility, for
an explicit type parameter to GEP.

At the suggestion of Duncan I tried coalescing the two older bitcodes into a
single new bitcode, though I did hit a wrinkle: I couldn't figure out how to
create an explicit abbreviation for a record with a variable number of
arguments (the indicies to the gep). This means the discriminator between
inbounds and non-inbounds gep is a full variable-length field I believe? Is my
understanding correct? Is there a way to create such an abbreviation? Should I
just use two bitcodes as before?

Reviewers: dexonsmith

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

llvm-svn: 230415

9 years ago[opaque pointer type] bitcode support for explicit type parameter to the load instruction
David Blaikie [Wed, 25 Feb 2015 01:07:20 +0000 (01:07 +0000)]
[opaque pointer type] bitcode support for explicit type parameter to the load instruction

Summary:
I've taken my best guess at this, but I've cargo culted in places & so
explanations/corrections would be great.

This seems to pass all the tests (check-all, covering clang and llvm) so I
believe that pretty well exercises both the backwards compatibility and common
(same version) compatibility given the number of checked in bitcode files we
already have. Is that a reasonable approach to testing here? Would some more
explicit tests be desired?

1) is this the right way to do back-compat in this case (looking at the number
  of entries in the bitcode record to disambiguate between the old schema and
  the new?)

2) I don't quite understand the logarithm logic to choose the encoding type of
  the type parameter in the abbreviation description, but I found another
  instruction doing the same thing & it seems to work. Is that the right
  approach?

Reviewers: dexonsmith

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

llvm-svn: 230414

9 years ago[PowerPC] Add support for the QPX vector instruction set
Hal Finkel [Wed, 25 Feb 2015 01:06:45 +0000 (01:06 +0000)]
[PowerPC] Add support for the QPX vector instruction set

This adds support for the QPX vector instruction set, which is used by the
enhanced A2 cores on the IBM BG/Q supercomputers. QPX vectors are 256 bytes
wide, holding 4 double-precision floating-point values. Boolean values, modeled
here as <4 x i1> are actually also represented as floating-point values
(essentially  { -1, 1 } for { false, true }). QPX shares many features with
Altivec and VSX, but is distinct from both of them. One major difference is
that, instead of adding completely-separate vector registers, QPX vector
registers are extensions of the scalar floating-point registers (lane 0 is the
corresponding scalar floating-point value). The operations supported on QPX
vectors mirrors that supported on the scalar floating-point values (with some
additional ones for permutations and logical/comparison operations).

I've been maintaining this support out-of-tree, as part of the bgclang project,
for several years. This is not the entire bgclang patch set, but is most of the
subset that can be cleanly integrated into LLVM proper at this time. Adding
this to the LLVM backend is part of my efforts to rebase bgclang to the current
LLVM trunk, but is independently useful (especially for codes that use LLVM as
a JIT in library form).

The assembler/disassembler test coverage is complete. The CodeGen test coverage
is not, but I've included some tests, and more will be added as follow-up work.

llvm-svn: 230413

9 years ago[modules] Fix a bug that would result in a build with P paths through a module
Richard Smith [Wed, 25 Feb 2015 00:56:02 +0000 (00:56 +0000)]
[modules] Fix a bug that would result in a build with P paths through a module
graph with M modules to take O(P) time, not just O(M) time, when using explicit
module builds.

llvm-svn: 230412

9 years agoSupport SHF_MERGE sections in COMDATs.
Rafael Espindola [Wed, 25 Feb 2015 00:52:15 +0000 (00:52 +0000)]
Support SHF_MERGE sections in COMDATs.

This patch unifies the comdat and non-comdat code paths. By doing this
it add missing features to the comdat side and removes the fixed
section assumptions from the non-comdat side.

In ELF there is no one true section for "4 byte mergeable" constants.
We are better off computing the required properties of the section
and asking the context for it.

llvm-svn: 230411

9 years agoBitcodeWriter: Refactor common computation of bits required for a type index.
David Blaikie [Wed, 25 Feb 2015 00:51:52 +0000 (00:51 +0000)]
BitcodeWriter: Refactor common computation of bits required for a type index.

Suggested by Duncan. Happy to bikeshed the name, cache the result, etc.

llvm-svn: 230410

9 years ago[asan] add suppressions for odr violations
Kostya Serebryany [Wed, 25 Feb 2015 00:49:12 +0000 (00:49 +0000)]
[asan] add suppressions for odr violations

llvm-svn: 230409

9 years agoIf you try to auto-complete "target symbols<TAB>" you get "target symbolsadd" instead...
Greg Clayton [Wed, 25 Feb 2015 00:32:43 +0000 (00:32 +0000)]
If you try to auto-complete "target symbols<TAB>" you get "target symbolsadd" instead of "target symbols ".

Fix this by returning the fact that the "symbols" word is complete if there is nothing else to complete after the "symbols" word.

<rdar://problem/19164599>

llvm-svn: 230408

9 years agoFix consistently wrong sphinx markup
Philip Reames [Wed, 25 Feb 2015 00:22:07 +0000 (00:22 +0000)]
Fix consistently wrong sphinx markup

I'd been using '' where I should have been using ``.

llvm-svn: 230407

9 years agoRevert r230314, "Fix codegen for virtual methods that are (re-) exported from multipl...
NAKAMURA Takumi [Wed, 25 Feb 2015 00:18:22 +0000 (00:18 +0000)]
Revert r230314, "Fix codegen for virtual methods that are (re-) exported from multiple modules."

It crashes for targeting (i686|x86_64)-win32.

  clang: clang/lib/AST/VTableBuilder.cpp:142: {anonymous}::FinalOverriders::OverriderInfo {anonymous}::FinalOverriders::getOverrider(const clang::CXXMethodDecl*, clang::CharUnits) const: Assertion `OverridersMap.count(std::make_pair(MD, BaseOffset)) && "Did not find overrider!"' failed.

llvm-svn: 230406

9 years agoUpdate the GC docs to explicitly mention both gcroot and gc.statepoint
Philip Reames [Wed, 25 Feb 2015 00:18:04 +0000 (00:18 +0000)]
Update the GC docs to explicitly mention both gcroot and gc.statepoint

Also, fix confusing bit of the gcroot documentation that bit me personally.

llvm-svn: 230405

9 years agoMake this test even more OS and register allocation neutral.
Eric Christopher [Wed, 25 Feb 2015 00:12:11 +0000 (00:12 +0000)]
Make this test even more OS and register allocation neutral.

llvm-svn: 230404

9 years ago[GC] Sync documentation with code naming
Philip Reames [Tue, 24 Feb 2015 23:57:26 +0000 (23:57 +0000)]
[GC] Sync documentation with code naming

Fixing an issue pointed out by Sean Silva.  Thanks!

llvm-svn: 230403

9 years agoMore GC documentation cleanup
Philip Reames [Tue, 24 Feb 2015 23:51:37 +0000 (23:51 +0000)]
More GC documentation cleanup

llvm-svn: 230402

9 years agoFixed Xcode project after recent changes:
Greg Clayton [Tue, 24 Feb 2015 23:50:21 +0000 (23:50 +0000)]
Fixed Xcode project after recent changes:

"After recent changes, some code has become redundant. This revision tries to remove
the un-used code and tidy up the rest.

Following 4 files have been removed. I have updated CMake files and checked that it builds
fine on Linux and Windows. Can somebody update the xcode related file accordingly?

tools/lldb-mi/MICmnStreamStdinLinux.cpp
tools/lldb-mi/MICmnStreamStdinLinux.h
tools/lldb-mi/MICmnStreamStdinWindows.cpp
tools/lldb-mi/MICmnStreamStdinWindows.h"

llvm-svn: 230401

9 years agoMake this test not dependent upon the triple. All that was needed
Eric Christopher [Tue, 24 Feb 2015 23:43:26 +0000 (23:43 +0000)]
Make this test not dependent upon the triple. All that was needed
was some flexibility in the check line for the comment basic block.

llvm-svn: 230400

9 years ago[CMake] Clean up lldb-mi CMakeLists.txt.
Zachary Turner [Tue, 24 Feb 2015 23:36:12 +0000 (23:36 +0000)]
[CMake] Clean up lldb-mi CMakeLists.txt.

It was maintaining two huge file lists that are identical except
for 1 file.  Make this work the proper way.

llvm-svn: 230398