platform/upstream/llvm.git
9 years agoAdd language command and LanguageRuntime plugin changes to allow vending of command...
Colin Riley [Mon, 4 May 2015 18:39:38 +0000 (18:39 +0000)]
Add language command and LanguageRuntime plugin changes to allow vending of command objects.

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

llvm-svn: 236443

9 years agoFix -Wmicrosoft warning by making enum unsigned
Reid Kleckner [Mon, 4 May 2015 18:21:35 +0000 (18:21 +0000)]
Fix -Wmicrosoft warning by making enum unsigned

llvm-svn: 236436

9 years ago[IR/Diagnostic] Assert that DebugLoc is valid before accessing.
Davide Italiano [Mon, 4 May 2015 18:08:35 +0000 (18:08 +0000)]
[IR/Diagnostic] Assert that DebugLoc is valid before accessing.

PR: 23380
Differential Revision: http://reviews.llvm.org/D9464
Reviewed by: dexonsmith

llvm-svn: 236435

9 years agoOption parsing: properly handle flag aliases for joined options (PR23394)
Hans Wennborg [Mon, 4 May 2015 18:00:13 +0000 (18:00 +0000)]
Option parsing: properly handle flag aliases for joined options (PR23394)

A joined option always needs to have an argument, even if it's an empty one.

Clang would previously assert when trying to use --extra-warnings, which is
a flag alias for -W, which is a joined option.

llvm-svn: 236434

9 years ago[SystemZ] Reclassify f32 subregs of f64 registers
Ulrich Weigand [Mon, 4 May 2015 17:41:22 +0000 (17:41 +0000)]
[SystemZ] Reclassify f32 subregs of f64 registers

At the moment, all subregs defined by the SystemZ target can be modified
independently of the wider register.  E.g. writing to a GR32 does not
change the upper 32 bits of the GR64.  Writing to an FP32 does not change
the lower 32 bits of the FP64.

Hoewver, the upcoming support for the vector extension redefines FP64 as
one half of a V128.  Floating-point operations leave the other half of
a V128 in an unpredictable state, so it's no longer the case that writing
to an FP32 leaves the bits of the underlying register (the V128) alone.
I'd prefer to have separate subreg_ names for this situation, so that
it's obvious at a glance whether we're talking about a subreg that leaves
the other parts of the register alone.

No behavioral change intended.

Patch originally by Richard Sandiford.

llvm-svn: 236433

9 years ago[SystemZ] Clean up AsmParser isMem() handling
Ulrich Weigand [Mon, 4 May 2015 17:40:53 +0000 (17:40 +0000)]
[SystemZ] Clean up AsmParser isMem() handling

We know what MemoryKind an operand has at the time we construct it,
so we might as well just record it in an unused part of the structure.
This makes it easier to add scatter/gather addresses later.

No behavioral change intended.

Patch originally by Richard Sandiford.

llvm-svn: 236432

9 years agoGet rid of compiler warning.
Serge Pavlov [Mon, 4 May 2015 17:39:55 +0000 (17:39 +0000)]
Get rid of compiler warning.

llvm-svn: 236431

9 years ago[SystemZ] Fix getTargetNodeName
Ulrich Weigand [Mon, 4 May 2015 17:39:40 +0000 (17:39 +0000)]
[SystemZ] Fix getTargetNodeName

It seems SystemZTargetLowering::getTargetNodeName got out of sync with
some recent changes to the SystemZISD opcode list.  Add back all the
missing opcodes (and re-sort to the same order as SystemISelLowering.h).

llvm-svn: 236430

9 years agoFix a typo in the warning.
Jim Ingham [Mon, 4 May 2015 17:33:33 +0000 (17:33 +0000)]
Fix a typo in the warning.

<rdar://problem/20799707>

llvm-svn: 236429

9 years agoScheduleDAGInstrs should toggle kill flags on bundled instrs.
Pete Cooper [Mon, 4 May 2015 16:52:06 +0000 (16:52 +0000)]
ScheduleDAGInstrs should toggle kill flags on bundled instrs.

ScheduleDAGInstrs wasn't setting or clearing the kill flags on instructions inside bundles.  This led to code such as this

%R3<def> = t2ANDrr %R0
BUNDLE %ITSTATE<imp-def,dead>, %R0<imp-use,kill>
  t2IT 1, 24, %ITSTATE<imp-def>
  R6<def,tied6> = t2ORRrr %R0<kill>, ...

being transformed to

BUNDLE %ITSTATE<imp-def,dead>, %R0<imp-use>
  t2IT 1, 24, %ITSTATE<imp-def>
  R6<def,tied6> = t2ORRrr %R0<kill>, ...
%R3<def> = t2ANDrr %R0<kill>

where the kill flag was removed from the BUNDLE instruction, but not the t2ORRrr inside it.  The verifier then thought that
R0 was undefined when read by the AND.

This change make the toggleKillFlags method also check for bundles and toggle flags on bundled instructions.
Setting the kill flag is special cased as we only want to set the kill flag on the last instruction in the bundle.

llvm-svn: 236428

9 years agoR600/SI: Code cleanup
Tom Stellard [Mon, 4 May 2015 16:45:08 +0000 (16:45 +0000)]
R600/SI: Code cleanup

This is a follow-up to r236004

llvm-svn: 236427

9 years agoInstantiate incomplete class used in template method.
Serge Pavlov [Mon, 4 May 2015 16:44:39 +0000 (16:44 +0000)]
Instantiate incomplete class used in template method.

If a class is absent from instantiation and is incomplete, instantiate it as
an incomplete class thus avoiding compiler crash.

This change fixes PR18653.

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

llvm-svn: 236426

9 years agoMark TestTypedefArray as XFAIL with Gcc.
Oleksiy Vyalov [Mon, 4 May 2015 15:20:25 +0000 (15:20 +0000)]
Mark TestTypedefArray as XFAIL with Gcc.

llvm-svn: 236425

9 years agoReapply "Frontend: Stop leaking when not -disable-free"
Duncan P. N. Exon Smith [Mon, 4 May 2015 14:59:20 +0000 (14:59 +0000)]
Reapply "Frontend: Stop leaking when not -disable-free"

This reverts commit r236422, effectively reapplying r236419.  ASan
helped me diagnose the problem: the non-leaking logic would free the
ASTConsumer before freeing Sema whenever `isCurrentASTFile()`, causing a
use-after-free in `Sema::~Sema()`.

This version unconditionally frees Sema and the ASTContext before
freeing the ASTConsumer.  Without the fix, these were either being freed
before the ASTConsumer was freed or leaked after, but they were always
spiritually released so this isn't really a functionality change.

I ran all of check-clang with ASan locally this time, so I'm hoping
there aren't any more problems lurking.

Original commit message:

    Try again to plug a leak that's been around since at least r128011
    after coming across the FIXME.  Nico Weber tried something similar
    in r207065 but had to revert in r207070 due to a bot failure.

    The build failure isn't visible anymore so I'm not sure what went
    wrong.  I'm doing this slightly differently -- when not
    -disable-free I'm still resetting the members (just not leaking
    them) -- so maybe it will work out this time?  Tests pass locally,
    anyway.

llvm-svn: 236424

9 years ago[analyzer] scan-build: support spaces in compiler path and arguments.
Anton Yartsev [Mon, 4 May 2015 13:37:36 +0000 (13:37 +0000)]
[analyzer] scan-build: support spaces in compiler path and arguments.

This fixes errors that occur if a path to the default compiler has spaces or if an argument with spaces is given to compiler (e.g. via -I). (http://reviews.llvm.org/D9357)

llvm-svn: 236423

9 years agoRevert "Frontend: Stop leaking when not -disable-free"
Duncan P. N. Exon Smith [Mon, 4 May 2015 13:01:42 +0000 (13:01 +0000)]
Revert "Frontend: Stop leaking when not -disable-free"

This reverts commit r236419, since it caused some bots to fail.  On:

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/26124
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/35086

these tests:

FAIL: Clang::import-decl.cpp
FAIL: Clang::floating-literal.c
FAIL: Clang::x86_64-linux-android.c

fail with this output:

Command Output (stderr):
--
Stack dump:
0.  Program arguments: /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast -
/var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.script: line 3:  9665 Segmentation fault      (core dumped) /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast - < /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.tmp.ast
      9666 Done                    | /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/FileCheck /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.src/tools/clang/test/Modules/import-decl.cpp

--

llvm-svn: 236422

9 years agoAVX-512: added a test for encoding
Elena Demikhovsky [Mon, 4 May 2015 12:59:15 +0000 (12:59 +0000)]
AVX-512: added a test for encoding
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 236421

9 years agoAVX-512: added calling convention for i1 vectors in 32-bit mode.
Elena Demikhovsky [Mon, 4 May 2015 12:40:50 +0000 (12:40 +0000)]
AVX-512: added calling convention for i1 vectors in 32-bit mode.
Fixed some bugs in extend/truncate for AVX-512 target.
Removed VBROADCASTM (masked broadcast) node, since it is not used any more.

llvm-svn: 236420

9 years agoFrontend: Stop leaking when not -disable-free
Duncan P. N. Exon Smith [Mon, 4 May 2015 12:36:56 +0000 (12:36 +0000)]
Frontend: Stop leaking when not -disable-free

Try again to plug a leak that's been around since at least r128011 after
coming across the FIXME.  Nico Weber tried something similar in r207065
but had to revert in r207070 due to a bot failure.

The build failure isn't visible anymore so I'm not sure what went wrong.
I'm doing this slightly differently -- when not -disable-free I'm still
resetting the members (just not leaking them) -- so maybe it will work
out this time?  Tests pass locally, anyway.

llvm-svn: 236419

9 years agoAVX-512: added integer "add" and "sub" instructions with saturation for SKX
Elena Demikhovsky [Mon, 4 May 2015 12:35:55 +0000 (12:35 +0000)]
AVX-512: added integer "add" and "sub" instructions with saturation for SKX
with intrinsics and tests

by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 236418

9 years agoAVX-512: enabled tests for AVX512F set
Elena Demikhovsky [Mon, 4 May 2015 11:09:41 +0000 (11:09 +0000)]
AVX-512: enabled tests for AVX512F set

llvm-svn: 236416

9 years agoclang-format: NFC: Delete FormatToken::IsForEachMacro. Use a TokenType instead.
Daniel Jasper [Mon, 4 May 2015 09:22:29 +0000 (09:22 +0000)]
clang-format: NFC: Delete FormatToken::IsForEachMacro. Use a TokenType instead.

llvm-svn: 236415

9 years agoAVX-512: Added VPACK* instructions forms for KNL and SKX
Elena Demikhovsky [Mon, 4 May 2015 09:14:02 +0000 (09:14 +0000)]
AVX-512: Added VPACK* instructions forms for KNL and SKX
and their intrinsics
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 236414

9 years agoclang-format: NFC: Use default member initializers and other cleanups.
Daniel Jasper [Mon, 4 May 2015 08:51:40 +0000 (08:51 +0000)]
clang-format: NFC: Use default member initializers and other cleanups.

llvm-svn: 236413

9 years agoclang-format: Force aligning different brackets relative to each other.
Daniel Jasper [Mon, 4 May 2015 07:39:00 +0000 (07:39 +0000)]
clang-format: Force aligning different brackets relative to each other.

Before:
  void SomeFunction(vector< // break
      int> v);

After:
  void SomeFunction(vector< // break
                        int> v);

llvm-svn: 236412

9 years ago[LLDB][MIPS] Emulate instruction using MCDisassembler
Mohit K. Bhakkad [Mon, 4 May 2015 06:28:04 +0000 (06:28 +0000)]
[LLDB][MIPS] Emulate instruction using MCDisassembler
Patch by Jaydeep Patil

EmulateInstructionMIPS64 has been modified to use llvm::MCDisassembler instead of duplicating the decoding logic.
Added emulation of few branch instructions for software single stepping

Reviewers: clayborg, jasonmolenda
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9319

llvm-svn: 236411

9 years agoTestCModules - fixed for gcc
Vince Harron [Mon, 4 May 2015 06:26:13 +0000 (06:26 +0000)]
TestCModules - fixed for gcc

Changed restrict keyword to something understood by gcc

llvm-svn: 236410

9 years agoReplace windows_error calls with mapWindowsError.
Yaron Keren [Mon, 4 May 2015 04:48:10 +0000 (04:48 +0000)]
Replace windows_error calls with mapWindowsError.

After r210687, windows_error does nothing but call mapWindowsError.
Other Windows/*.inc files directly call mapWindowsError. This patch
updates Path.inc and Process.inc to do the same.

llvm-svn: 236409

9 years agollvm-cov: Warn if object file is newer than profile
Justin Bogner [Mon, 4 May 2015 04:09:38 +0000 (04:09 +0000)]
llvm-cov: Warn if object file is newer than profile

Looking at coverage with an out of date profile can be confusing.
Provide a little hint that something might be wrong.

llvm-svn: 236408

9 years agoXFAILing a test that fails with gcc 4.9 x86_64
Vince Harron [Mon, 4 May 2015 03:53:22 +0000 (03:53 +0000)]
XFAILing a test that fails with gcc 4.9 x86_64

llvm-svn: 236407

9 years agoMention PPCallbacks interface change in release notes.
Richard Smith [Mon, 4 May 2015 03:18:47 +0000 (03:18 +0000)]
Mention PPCallbacks interface change in release notes.

llvm-svn: 236406

9 years agoUpdate to match clang r236404.
Richard Smith [Mon, 4 May 2015 03:15:55 +0000 (03:15 +0000)]
Update to match clang r236404.

llvm-svn: 236405

9 years agoSwitch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in...
Richard Smith [Mon, 4 May 2015 03:15:40 +0000 (03:15 +0000)]
Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion.

llvm-svn: 236404

9 years agoun-skipped a bunch of tests on Linux
Vince Harron [Mon, 4 May 2015 03:06:04 +0000 (03:06 +0000)]
un-skipped a bunch of tests on Linux

Some have been marked as skipIfLinux for years.
The seem to be passing so I've enabled them.

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

llvm-svn: 236403

9 years agoFixed skipIfLinuxClang to check the target architecture
Vince Harron [Mon, 4 May 2015 02:59:19 +0000 (02:59 +0000)]
Fixed skipIfLinuxClang to check the target architecture

Instead of the host architecture

This decorator isn't in use anywhere currently.
Add it to a test and run

llvm-svn: 236402

9 years agoEnabled libc++ formatter tests on Linux
Vince Harron [Mon, 4 May 2015 02:56:32 +0000 (02:56 +0000)]
Enabled libc++ formatter tests on Linux

Refactored TestInitializerList to not be an inline test.
Refactored Makefiles to use USE_LIBCPP instead of adding FLAGS directly
Fixed copy/paste error in TestDataFormatterUnordered class name

Differenttial Revision: http://reviews.llvm.org/D9426

llvm-svn: 236401

9 years agoRename MacroDefinition -> MacroDefinitionRecord, Preprocessor::MacroDefinition -...
Richard Smith [Mon, 4 May 2015 02:25:31 +0000 (02:25 +0000)]
Rename MacroDefinition -> MacroDefinitionRecord, Preprocessor::MacroDefinition -> MacroDefinition.

clang::MacroDefinition now models the currently-defined value of a macro. The
previous MacroDefinition type, which represented a record of a macro definition
directive for a detailed preprocessing record, is now called MacroDefinitionRecord.

llvm-svn: 236400

9 years agoDeprecate in-source autotools builds
Jonathan Roelofs [Mon, 4 May 2015 02:04:54 +0000 (02:04 +0000)]
Deprecate in-source autotools builds

This is a followup from:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150323/268067.html

Upgrade instructions:
  $ mv llvm/include/llvm/Config/config.h ./config.h.BACKUP
  # copy the configure line from line 7 of llvm/config.log
  # (for example: `$ ./configure --no-create --no-recursion`)
  $ mkdir build
  $ cd build
  # run the configure line, but this time with '../llvm' at the beginning:
  $ ../llvm/configure --no-create --no-recursion

These warnings will soon be turned into hard errors after a week.  Speak up now
if this is going to be a problem for you.

llvm-svn: 236399

9 years ago[TableGen] Replace 'static_cast' with 'cast'.
Craig Topper [Mon, 4 May 2015 01:35:42 +0000 (01:35 +0000)]
[TableGen] Replace 'static_cast' with 'cast'.

llvm-svn: 236398

9 years ago[TableGen] Formatting cleanup. Mostly removing trailing whitespace and unnecessary...
Craig Topper [Mon, 4 May 2015 01:35:39 +0000 (01:35 +0000)]
[TableGen] Formatting cleanup. Mostly removing trailing whitespace and unnecessary curly braces. NFC

llvm-svn: 236397

9 years agoTestMultithreaded improvements
Vince Harron [Mon, 4 May 2015 00:17:53 +0000 (00:17 +0000)]
TestMultithreaded improvements

These tests link against host lldb API. Compiler's target triple
must match liblldb triple. Instead of naively skipping i386, I added
a check of the liblldb arch against the compiler target arch.

This is useful for 32 bit API builds (planned for Windows)

Since remote is disabled, we can assume the os is the same.

Also, removed skipIfLinuxClang because it's passing

llvm-svn: 236396

9 years ago[FIX] Invalid recognition of multidimensional access
Johannes Doerfert [Sun, 3 May 2015 16:03:01 +0000 (16:03 +0000)]
[FIX] Invalid recognition of multidimensional access

  In the lnt benchmark MultiSource/Benchmarks/MallocBench/gs/gs with
  scalar and PHI modeling we detected the multidimensional accesses
  with sizes variant in the SCoP. This will check the sizes for validity.

llvm-svn: 236395

9 years agoMasked gather and scatter intrinsics - enabled codegen for KNL.
Elena Demikhovsky [Sun, 3 May 2015 07:12:25 +0000 (07:12 +0000)]
Masked gather and scatter intrinsics - enabled codegen for KNL.

llvm-svn: 236394

9 years agoAdding debug location information to Polly's JSCOP and dot exports
Tobias Grosser [Sun, 3 May 2015 05:21:36 +0000 (05:21 +0000)]
Adding debug location information to Polly's JSCOP and dot exports

This change adds location information for the detected regions in Polly when the
required debug information is available.

The JSCOP output format is extended with a "location" field which contains the
information in the format "source.c:start-end"

The dot output is extended to contain the location information for each nested
region in the analyzed function.

As part of this change, the existing getDebugLocation function has been moved
into lib/Support/ScopLocation.cpp to avoid having to include
polly/ScopDetectionDiagnostics.h.

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

Contributed-by: Roal Jordans <r.jordans@tue.nl>
llvm-svn: 236393

9 years agoFix typo in comment.
Nico Weber [Sat, 2 May 2015 21:34:39 +0000 (21:34 +0000)]
Fix typo in comment.

llvm-svn: 236392

9 years ago[Mips] Add more checkings to the test
Simon Atanasyan [Sat, 2 May 2015 21:03:00 +0000 (21:03 +0000)]
[Mips] Add more checkings to the test

No functional changes.

llvm-svn: 236391

9 years agoclang-format function definition header. NFC.
Yaron Keren [Sat, 2 May 2015 19:29:29 +0000 (19:29 +0000)]
clang-format function definition header. NFC.

llvm-svn: 236390

9 years agoReplace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().
Yaron Keren [Sat, 2 May 2015 15:31:08 +0000 (15:31 +0000)]
Replace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().

Using GetNumBytesInBuffer() assumes that the stream was not flushed between
the GetNumBytesInBuffer() calls, which may happen to be true or not,
depending on stream policy. tell() always reports the correct stream location.

Do note there are only two more uses of GetNumBytesInBuffer() in LLVM+clang, in
lib/MC/MCAsmStreamer.cpp and lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp.
The former may be replacable by tell (needs testing) but while the later can
not be immediatly replaced by tell() as it uses the absolute value of
GetNumBytesInBuffer() rather than the real stream position. Both uses seems
to depend upon flush policy and thus may not work correctly depending upon the
stream behaviour.

Going forward, GetNumBytesInBuffer() should probably be protected, non-accessible
to raw_ostream clients.

llvm-svn: 236389

9 years ago[SSE2] Minor tidyup of v16i8 SHL lowering. NFC.
Simon Pilgrim [Sat, 2 May 2015 14:42:43 +0000 (14:42 +0000)]
[SSE2] Minor tidyup of v16i8 SHL lowering. NFC.

Removed code that was replicating v8i16 'shift + mask' implementation that is done more nicely by making use of LowerScalarImmediateShift

llvm-svn: 236388

9 years ago[DAGCombiner] Enabled vector float/double -> int constant folding
Simon Pilgrim [Sat, 2 May 2015 13:04:07 +0000 (13:04 +0000)]
[DAGCombiner] Enabled vector float/double -> int constant folding

llvm-svn: 236387

9 years agoLine ending fix
Simon Pilgrim [Sat, 2 May 2015 11:50:47 +0000 (11:50 +0000)]
Line ending fix

llvm-svn: 236386

9 years ago[SSE] Added vector int (i32 and i64) -> float/double conversion tests
Simon Pilgrim [Sat, 2 May 2015 11:42:47 +0000 (11:42 +0000)]
[SSE] Added vector int (i32 and i64) -> float/double conversion tests

llvm-svn: 236385

9 years ago[SSE] Added vector float/double -> i32 and i64 conversion tests
Simon Pilgrim [Sat, 2 May 2015 11:18:47 +0000 (11:18 +0000)]
[SSE] Added vector float/double -> i32 and i64 conversion tests

llvm-svn: 236384

9 years agoclang-format: [JS] Fix calculation of template string width.
Daniel Jasper [Sat, 2 May 2015 08:05:38 +0000 (08:05 +0000)]
clang-format: [JS] Fix calculation of template string width.

OriginalColumn might not be set, so fall back to Location and SourceMgr
in case it is missing. Also initialize end column in case the token is
multi line, but it's the ` token itself that starts the multi line.

Patch by Martin Probst, thank you!

llvm-svn: 236383

9 years agoclang-format: [JS] Fix templated parameter default values.
Daniel Jasper [Sat, 2 May 2015 07:54:58 +0000 (07:54 +0000)]
clang-format: [JS] Fix templated parameter default values.

Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.

Patch by Martin Probst, thank you.

llvm-svn: 236382

9 years ago[MS ABI] Add testcase which was missing from r236354
David Majnemer [Sat, 2 May 2015 05:12:53 +0000 (05:12 +0000)]
[MS ABI] Add testcase which was missing from r236354

This test verifies that we can detect when the inheritance paths are
ambiguous due to covariant thunks, ensuring we don't regress PR16759.

llvm-svn: 236381

9 years agoInstrProf: Cede ownership of createProfileWeights to CGF
Justin Bogner [Sat, 2 May 2015 05:00:55 +0000 (05:00 +0000)]
InstrProf: Cede ownership of createProfileWeights to CGF

The fact that PGO has a say in how these branch weights are determined
isn't interesting to most of CodeGen, so it makes more sense for this
API to be accessible via CodeGenFunction rather than CodeGenPGO.

llvm-svn: 236380

9 years agoDebugInfo: Use low_pc relative debug_ranges under fission when the CU has a low_pc
David Blaikie [Sat, 2 May 2015 02:31:49 +0000 (02:31 +0000)]
DebugInfo: Use low_pc relative debug_ranges under fission when the CU has a low_pc

Seems we were setting the base address on the wrong DwarfCompileUnit
object so it wasn't being used when generating the ranges.

llvm-svn: 236377

9 years ago[modules] Remove dead code from Module for tracking macro import locations.
Richard Smith [Sat, 2 May 2015 02:08:26 +0000 (02:08 +0000)]
[modules] Remove dead code from Module for tracking macro import locations.

llvm-svn: 236376

9 years ago[modules] Don't bother creating a ModuleMacro representing a #undef that overrides...
Richard Smith [Sat, 2 May 2015 01:14:40 +0000 (01:14 +0000)]
[modules] Don't bother creating a ModuleMacro representing a #undef that overrides nothing.

llvm-svn: 236374

9 years agoRework test to use FileCheck by making sure we have no xmm registers
Eric Christopher [Sat, 2 May 2015 01:06:17 +0000 (01:06 +0000)]
Rework test to use FileCheck by making sure we have no xmm registers
with numbers.

llvm-svn: 236373

9 years agoFix -fobjc-arc doesn't work with -save-temps
Steven Wu [Sat, 2 May 2015 00:56:15 +0000 (00:56 +0000)]
Fix -fobjc-arc doesn't work with -save-temps

The underlying problem is that there is currently no way to run
ObjCARCContract from llvm bitcode which is required by ObjC ARC.
This fix the problem by always enable ObjCARCContract pass if
optimization is enabled. The ObjCARC Contract pass has almost no
overhead on code that is not using ARC.

llvm-svn: 236372

9 years agoDiagnose delayed typos when parsing a postfix expression with an
Kaelyn Takata [Sat, 2 May 2015 00:49:18 +0000 (00:49 +0000)]
Diagnose delayed typos when parsing a postfix expression with an
unmatched l_paren before setting the LHS to ExprError().

Fixes PR23285.

llvm-svn: 236371

9 years agoInstrProf: Use a locally tracked current count in ComputeRegionCounts
Justin Bogner [Sat, 2 May 2015 00:48:27 +0000 (00:48 +0000)]
InstrProf: Use a locally tracked current count in ComputeRegionCounts

No functional change. This just makes it more obvious that the logic
in ComputeRegionCounts only depends on the counter map and local
state.

llvm-svn: 236370

9 years ago[modules] If a module #includes a modular header that #undef's its macro, it
Richard Smith [Sat, 2 May 2015 00:45:56 +0000 (00:45 +0000)]
[modules] If a module #includes a modular header that #undef's its macro, it
should not export the macro.

... at least, not unless we have local submodule visibility enabled.

llvm-svn: 236369

9 years agoMC: Tidy up comments and clean up formatting a bit. NFC.
Jim Grosbach [Sat, 2 May 2015 00:44:14 +0000 (00:44 +0000)]
MC: Tidy up comments and clean up formatting a bit. NFC.

llvm-svn: 236368

9 years agoFix spelling.
Jim Grosbach [Sat, 2 May 2015 00:44:07 +0000 (00:44 +0000)]
Fix spelling.

llvm-svn: 236367

9 years agoMark the other test of TestFdLeak also as xfail to keep the bot green.
Siva Chandra [Sat, 2 May 2015 00:37:12 +0000 (00:37 +0000)]
Mark the other test of TestFdLeak also as xfail to keep the bot green.

Summary:
r235916 marked only one of the tests as xfail, but the other also has
been failing intermitantly on the buildbot.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236366

9 years agoInstrProf: Replace the RegionCounter class with a simpler direct approach
Justin Bogner [Fri, 1 May 2015 23:41:09 +0000 (23:41 +0000)]
InstrProf: Replace the RegionCounter class with a simpler direct approach

This removes the RegionCounter class, which is only used as a helper
in teh ComputeRegionCounts stmt visitor. This class is just an extra
layer of abstraction that makes the code harder to follow at this
point, and removing it makes the logic quite a bit more direct.

llvm-svn: 236364

9 years agoChange process kill to call Process::Destroy (force_kill = true);
Jason Molenda [Fri, 1 May 2015 23:39:48 +0000 (23:39 +0000)]
Change process kill to call Process::Destroy (force_kill = true);
follow-up to the change in r235158.  Right now if you attach to
a process and type "kill", lldb doesn't kill it, it detaches.
<rdar://problem/20691198>

llvm-svn: 236363

9 years agoFix an issue where the UTF dumper was ignoring the direction to generate uncapped...
Enrico Granata [Fri, 1 May 2015 22:57:38 +0000 (22:57 +0000)]
Fix an issue where the UTF dumper was ignoring the direction to generate uncapped dumps

llvm-svn: 236362

9 years agoInstrProf: Add a couple of checks to this test
Justin Bogner [Fri, 1 May 2015 22:52:48 +0000 (22:52 +0000)]
InstrProf: Add a couple of checks to this test

"Don't crash" tests are silly, we might as well check that the
counters are consistent here.

llvm-svn: 236361

9 years agoRevert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"
Reid Kleckner [Fri, 1 May 2015 22:50:14 +0000 (22:50 +0000)]
Revert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"

This reverts commit r236359. Things are still broken despite testing. :(

llvm-svn: 236360

9 years agoRe-land "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"
Reid Kleckner [Fri, 1 May 2015 22:40:25 +0000 (22:40 +0000)]
Re-land "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"

This reverts commit r236340.

llvm-svn: 236359

9 years ago[Hexagon] r236351 fix does not work on builder configurations yet.
Colin LeMahieu [Fri, 1 May 2015 22:39:20 +0000 (22:39 +0000)]
[Hexagon] r236351 fix does not work on builder configurations yet.

llvm-svn: 236358

9 years agoDisable exceptions for clang-compiled unittest code on Windows
Reid Kleckner [Fri, 1 May 2015 22:23:56 +0000 (22:23 +0000)]
Disable exceptions for clang-compiled unittest code on Windows

llvm-svn: 236357

9 years agoFound a Urbana paper that has library bits
Marshall Clow [Fri, 1 May 2015 22:14:35 +0000 (22:14 +0000)]
Found a Urbana paper that has library bits

llvm-svn: 236356

9 years agoRemove some code left around for debugging purposes
David Majnemer [Fri, 1 May 2015 21:42:19 +0000 (21:42 +0000)]
Remove some code left around for debugging purposes

llvm-svn: 236355

9 years ago[MS ABI] Detect and diagnose vftables which cannot be created
David Majnemer [Fri, 1 May 2015 21:35:45 +0000 (21:35 +0000)]
[MS ABI] Detect and diagnose vftables which cannot be created

The MSVC ABI has a bug introduced by appending to the end of vftables
which come from virtual bases: covariant thunks introduces via
non-overlapping regions of the inheritance lattice both append to the
same slot in the vftable.

It is possible to generate correct vftables in cases where one node in
the lattice completely dominates the other on the way to the base with
the vfptr; in all other cases, we must raise a diagnostic in order to
prevent the illusion that we succeeded in laying out the vftable.

This fixes PR16759.

llvm-svn: 236354

9 years ago[MS ABI] NV bases may indirectly contain covariant thunks from V Bases
David Majnemer [Fri, 1 May 2015 21:35:41 +0000 (21:35 +0000)]
[MS ABI] NV bases may indirectly contain covariant thunks from V Bases

A class might contain multiple ways of getting to a vbase, some of which
are virtual and other non-virtual.  It may be the case that a
non-virtual base contains an override of a method in a vbase.  This
means that we must carefully pick between a set of nvbases to determine
which is the best.

As a consequence, the findPathForVPtr algorithm is considerably simpler.

llvm-svn: 236353

9 years ago[AArch64][FastISel] Variant of the logical instructions that use two input
Quentin Colombet [Fri, 1 May 2015 21:34:57 +0000 (21:34 +0000)]
[AArch64][FastISel] Variant of the logical instructions that use two input
registers cannot write on SP.

rdar://problem/20748715

llvm-svn: 236352

9 years ago[Hexagon] Removing variable unused in release.
Colin LeMahieu [Fri, 1 May 2015 21:30:22 +0000 (21:30 +0000)]
[Hexagon] Removing variable unused in release.

llvm-svn: 236351

9 years ago[modules] Add -fmodules-local-submodule-visibility flag.
Richard Smith [Fri, 1 May 2015 21:22:17 +0000 (21:22 +0000)]
[modules] Add -fmodules-local-submodule-visibility flag.

This flag specifies that the normal visibility rules should be used even for
local submodules (submodules of the currently-being-built module). Thus names
will only be visible if a header / module that declares them has actually been
included / imported, and not merely because a submodule that happened to be
built earlier declared those names. This also removes the need to modularize
bottom-up: textually-included headers will be included into every submodule
that includes them, since their include guards will not leak between modules.

So far, this only governs visibility of macros, not of declarations, so is not
ready for real use yet.

llvm-svn: 236350

9 years agoARM: merge Cyclone into other ARMv8 CPUs and add tests for features.
Tim Northover [Fri, 1 May 2015 21:17:25 +0000 (21:17 +0000)]
ARM: merge Cyclone into other ARMv8 CPUs and add tests for features.

Cyclone actually supports all the goodies you'd expect to come with an AArch64
CPU, so it doesn't need its own clause. Also we should probably be testing
these clauses.

llvm-svn: 236349

9 years ago[Hexagon] Adding expression MC emission and removing XFAIL from test that hits this...
Colin LeMahieu [Fri, 1 May 2015 21:14:21 +0000 (21:14 +0000)]
[Hexagon] Adding expression MC emission and removing XFAIL from test that hits this code path.

llvm-svn: 236348

9 years agoAlso correct typos in the middle of a ternary expression when the RHS is invalid.
Kaelyn Takata [Fri, 1 May 2015 20:59:18 +0000 (20:59 +0000)]
Also correct typos in the middle of a ternary expression when the RHS is invalid.

The LHS was already being corrected before being set to ExprError when
the RHS is invalid, but when it was present the middle of a ternary
expression would be dropped in the error paths.

Fixes PR23350.

llvm-svn: 236347

9 years ago[AArch64][FastISel] Fix the setting of kill flags for MUL -> UMULH sequences.
Quentin Colombet [Fri, 1 May 2015 20:57:11 +0000 (20:57 +0000)]
[AArch64][FastISel] Fix the setting of kill flags for MUL -> UMULH sequences.

rdar://problem/20748715

llvm-svn: 236346

9 years agoFix compilation of PDBApiTest.
Zachary Turner [Fri, 1 May 2015 20:51:49 +0000 (20:51 +0000)]
Fix compilation of PDBApiTest.

llvm-svn: 236345

9 years agoAdjust the wording of the "brackets go after the unqualified-id" error message. It...
Nick Lewycky [Fri, 1 May 2015 20:47:19 +0000 (20:47 +0000)]
Adjust the wording of the "brackets go after the unqualified-id" error message. It applies in cases that aren't unqualified-ids.

llvm-svn: 236344

9 years agoFix build.
Zachary Turner [Fri, 1 May 2015 20:33:10 +0000 (20:33 +0000)]
Fix build.

llvm-svn: 236343

9 years ago[llvm-pdbdump] Support dynamic load address and external symbols.
Zachary Turner [Fri, 1 May 2015 20:24:26 +0000 (20:24 +0000)]
[llvm-pdbdump] Support dynamic load address and external symbols.

This patch adds the --load-address command line option to
llvm-pdbdump, which dumps all addresses assuming the module has
loaded at the specified address.

Additionally, this patch adds an option to llvm-pdbdump to support
dumping of public symbols (i.e. symbols with external linkage).

llvm-svn: 236342

9 years agoReapply [RuntimeDyldELF] Fold Placeholder into Addend
Keno Fischer [Fri, 1 May 2015 20:21:45 +0000 (20:21 +0000)]
Reapply [RuntimeDyldELF] Fold Placeholder into Addend

This reapplies r235060 and 235070, which were reverted because of test failures
in LLDB. The failure was caused because at  moment RuntimeDyld is processing
relocations for all sections, irrespective of whether we actually load them
into memory or not, but RuntimeDyld was not actually remembering where in memory
the unrelocated section is. This commit includes a fix for that issue by
remembering that pointer, though the longer term fix should be to stop processing
unneeded sections.

Original Summary:

This allows us to get rid of the original unrelocated object file after
we're done processing relocations (but before applying them).
MachO and COFF already do not require this (currently we have temporary hacks
to prevent ownership from being released, but those are brittle and should be
removed soon).

The placeholder mechanism allowed the relocation resolver to look at original
object file to obtain more information that are required to apply the
relocations. This is usually necessary in two cases:

- For relocations targetting sub-word memory locations, there may be pieces
  of the instruction at the target address which we should not override.
- Some relocations on some platforms allow an extra addend to be encoded in
  their immediate fields.

The problem is that in the second case the information cannot be recovered
after the relocations have been applied once because they will have been
overridden. In the first case we also need to be careful to not use any bits
that aren't fixed and may have been overriden by applying a first relocation.

In the past both have been fixed by just looking at original object file. This
patch attempts to recover the information from the first by looking at the
relocated object file, while the extra addend in the second case is read
upon relocation processing and addend to the regular addend.

I have tested this on X86. Other platforms represent my best understanding
of how those relocations should work, but I may have missed something because
I do not have access to those platforms.
We will keep the ugly workarounds in place for a couple of days, so this commit
can be reverted if it breaks the bots.

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

llvm-svn: 236341

9 years agoRevert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"
Reid Kleckner [Fri, 1 May 2015 20:14:04 +0000 (20:14 +0000)]
Revert "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"

This reverts commit r236339, it breaks the win32 clang-cl self-host.

llvm-svn: 236340

9 years ago[WinEH] Add an EH registration and state insertion pass for 32-bit x86
Reid Kleckner [Fri, 1 May 2015 20:04:54 +0000 (20:04 +0000)]
[WinEH] Add an EH registration and state insertion pass for 32-bit x86

This pass is responsible for constructing the EH registration object
that gets linked into fs:00, which is all it does in this change. In the
future, it will also insert stores to update the EH state number.

I considered keeping this functionality in WinEHPrepare, but it's pretty
separable and X86 specific. It has conceptually very little to do with
the task of WinEHPrepare, which is currently outlining.  WinEHPrepare is
also in theory useful on ARM, but this logic is pretty x86 specific.

Reviewers: andrew.w.kaylor, majnemer

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

llvm-svn: 236339

9 years agoSuppress clang/test/OpenMP/task_private_codegen.cpp on win32 for now. Investigating.
NAKAMURA Takumi [Fri, 1 May 2015 19:44:13 +0000 (19:44 +0000)]
Suppress clang/test/OpenMP/task_private_codegen.cpp on win32 for now. Investigating.

I'm dubious in weird behavior with CHECK-DAG.

Also, it won't "REQUIRE non-ms-sdk". All of RUNs have "-triple darwin".

llvm-svn: 236338

9 years agoEagerly correct typos in ParenExprs that may be type casts for non-C++ code.
Kaelyn Takata [Fri, 1 May 2015 19:36:25 +0000 (19:36 +0000)]
Eagerly correct typos in ParenExprs that may be type casts for non-C++ code.

This is needed to ensure the type casts are parsed properly. Fixes
PR23101.

llvm-svn: 236337

9 years agoRevert unrelated chunk committed by accident in r236334.
Davide Italiano [Fri, 1 May 2015 19:24:29 +0000 (19:24 +0000)]
Revert unrelated chunk committed by accident in r236334.

The change is likely to be correct, but unrelated to the aforementioned
commit and needs a test to gets shipped. Sorry.

llvm-svn: 236336

9 years agoInstrProf: Fix a coverage crash where a macro begins in an unreachable block
Justin Bogner [Fri, 1 May 2015 19:23:34 +0000 (19:23 +0000)]
InstrProf: Fix a coverage crash where a macro begins in an unreachable block

llvm-svn: 236335

9 years ago[ELF] Fix test for .init_array.
Davide Italiano [Fri, 1 May 2015 19:20:48 +0000 (19:20 +0000)]
[ELF] Fix test for .init_array.

Change the test so that it tests the right functionality.
Also put a description with the code from which the test was generated.
Reported by Simon Atanasysan.

llvm-svn: 236334

9 years ago[ARM] Transfer the internal flag in thumb2 size reduction.
Pete Cooper [Fri, 1 May 2015 18:57:32 +0000 (18:57 +0000)]
[ARM] Transfer the internal flag in thumb2 size reduction.

Converting from t2LDRs to tLDRr caused the shift argument to drop the internal flag.  This would then throw machine verifier errors.

Unfortunately i'm having trouble reducing a test case.  I'm going to keep trying, but so far its a scary combination of machine sinking, an 'and i1', loads feeding loads, and a bunch of code which shouldn't change IT block formation, but does.  Its not useful to commit a test in that state as we have no way of knowing if it even hits this code reliably in future.

rdar://problem/20752113

llvm-svn: 236333