platform/upstream/llvm.git
10 years agoFix mistake in r190442.
Eli Friedman [Tue, 10 Sep 2013 23:09:24 +0000 (23:09 +0000)]
Fix mistake in r190442.

llvm-svn: 190446

10 years agoRemove unused variable.
Eli Friedman [Tue, 10 Sep 2013 23:00:03 +0000 (23:00 +0000)]
Remove unused variable.

llvm-svn: 190445

10 years agogetMostSpecialized for function template sets is never used in the context of a
Richard Smith [Tue, 10 Sep 2013 22:59:25 +0000 (22:59 +0000)]
getMostSpecialized for function template sets is never used in the context of a
call; remove its 'number of explicit arguments' and 'what kind of call'
parameters.

llvm-svn: 190444

10 years agoAdd unused markings to suppress warnings.
Eli Friedman [Tue, 10 Sep 2013 22:57:15 +0000 (22:57 +0000)]
Add unused markings to suppress warnings.

trunk clang is a bit more aggressive about emitting unused-declaration
warnings, so adjust some AST code to match.  Specifically, use
LLVM_ATTRIBUTE_UNUSED for declarations which are never supposed to be
referenced, and turn references to declarations which are supposed to be
referenced into odr-uses.

llvm-svn: 190443

10 years agoRemove unused functions.
Eli Friedman [Tue, 10 Sep 2013 22:42:31 +0000 (22:42 +0000)]
Remove unused functions.

llvm-svn: 190442

10 years agoIgnore noreturn when checking function template specializations
Reid Kleckner [Tue, 10 Sep 2013 22:21:37 +0000 (22:21 +0000)]
Ignore noreturn when checking function template specializations

As requested when applying the same logic to calling conventions.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1634

llvm-svn: 190441

10 years agoHoist section call out of loop.
Eric Christopher [Tue, 10 Sep 2013 21:49:37 +0000 (21:49 +0000)]
Hoist section call out of loop.

llvm-svn: 190440

10 years agoPR5683: Issue a warning when subtracting pointers to types of zero size, and
Richard Smith [Tue, 10 Sep 2013 21:34:14 +0000 (21:34 +0000)]
PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.

llvm-svn: 190439

10 years agoTry to unbreak mingw32 buildbot.
Rui Ueyama [Tue, 10 Sep 2013 21:32:42 +0000 (21:32 +0000)]
Try to unbreak mingw32 buildbot.

llvm-svn: 190438

10 years agoFix regression from r190382.
Eli Friedman [Tue, 10 Sep 2013 21:10:25 +0000 (21:10 +0000)]
Fix regression from r190382.

Make sure we perform the correct "referenced-but-not-used" check for
static member constants.

Fixes bug reported on cfe-commits by Alexey Samsonov.

llvm-svn: 190437

10 years ago<rdar://problem/14071463>
Enrico Granata [Tue, 10 Sep 2013 21:04:54 +0000 (21:04 +0000)]
<rdar://problem/14071463>

The wrong method was being called in some instances here, causing class lookups to fail

llvm-svn: 190436

10 years agoFix cl-link.c test failure on Mac platforms
Hans Wennborg [Tue, 10 Sep 2013 20:53:34 +0000 (20:53 +0000)]
Fix cl-link.c test failure on Mac platforms

The test filename (%s) is easily confused with an option when
it starts with /Users...

llvm-svn: 190435

10 years ago[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does
Reid Kleckner [Tue, 10 Sep 2013 20:43:12 +0000 (20:43 +0000)]
[ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does

Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ.

Reviewers: timurrrr

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

llvm-svn: 190434

10 years agoRemove Windows line-endings in two clang-cl test files.
Hans Wennborg [Tue, 10 Sep 2013 20:35:58 +0000 (20:35 +0000)]
Remove Windows line-endings in two clang-cl test files.

llvm-svn: 190432

10 years agoUse llvm::sys::Process::GetEnv() instead of ::getenv().
Rui Ueyama [Tue, 10 Sep 2013 20:33:21 +0000 (20:33 +0000)]
Use llvm::sys::Process::GetEnv() instead of ::getenv().

Process::GetEnv() uses GetEnvironmentVariableW, which is a Windows API
to get an environment variable and is preferable over getenv().

llvm-svn: 190431

10 years agoFix build after SCEV change
Matt Arsenault [Tue, 10 Sep 2013 20:22:17 +0000 (20:22 +0000)]
Fix build after SCEV change

llvm-svn: 190429

10 years agoclang-cl: Support building DLLs (PR17083)
Hans Wennborg [Tue, 10 Sep 2013 20:18:04 +0000 (20:18 +0000)]
clang-cl: Support building DLLs (PR17083)

This adds driver support for building DLLs (the /LD and /LDd flags).
It basically does two things: runtime selection and passing -dll and
-implib to the linker.

llvm-svn: 190428

10 years ago[ms-cxxabi] Implement guard variables for static initialization
Reid Kleckner [Tue, 10 Sep 2013 20:14:30 +0000 (20:14 +0000)]
[ms-cxxabi] Implement guard variables for static initialization

Static locals requiring initialization are not thread safe on Windows.
Unfortunately, it's possible to create static locals that are actually
externally visible with inline functions and templates.  As a result, we
have to implement an initialization guard scheme that is compatible with
TUs built by MSVC, which makes thread safety prohibitively difficult.

MSVC's scheme is that every function that requires a guard gets an i32
bitfield.  Each static local is assigned a bit that indicates if it has
been initialized, up to 32 bits, at which point a new bitfield is
created.  MSVC rejects inline functions with more than 32 static locals,
and the externally visible mangling (?_B) only allows for one guard
variable per function.

On Eli's recommendation, I used MangleNumberingContext to track which
bit each static corresponds to.

Implements PR16888.

Reviewers: rjmccall, eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1416

llvm-svn: 190427

10 years agoFix missing CHECK-LABELs
Matt Arsenault [Tue, 10 Sep 2013 19:57:05 +0000 (19:57 +0000)]
Fix missing CHECK-LABELs

llvm-svn: 190426

10 years agoTeach ScalarEvolution about pointer address spaces
Matt Arsenault [Tue, 10 Sep 2013 19:55:24 +0000 (19:55 +0000)]
Teach ScalarEvolution about pointer address spaces

llvm-svn: 190425

10 years agoFix typo
Matt Arsenault [Tue, 10 Sep 2013 19:54:54 +0000 (19:54 +0000)]
Fix typo

llvm-svn: 190424

10 years agoAdd getenv() wrapper that works on multibyte environment variable.
Rui Ueyama [Tue, 10 Sep 2013 19:45:51 +0000 (19:45 +0000)]
Add getenv() wrapper that works on multibyte environment variable.

On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

Differential Revision: http://llvm-reviews.chandlerc.com/D1612

llvm-svn: 190423

10 years agoLoopVectorize: PHI nodes are always at the beginning of a block, no need to scan...
Benjamin Kramer [Tue, 10 Sep 2013 18:46:15 +0000 (18:46 +0000)]
LoopVectorize: PHI nodes are always at the beginning of a block, no need to scan the whole block.

llvm-svn: 190422

10 years agoDebug Info: create scope children DIEs when the scope DIE is not null.
Manman Ren [Tue, 10 Sep 2013 18:40:41 +0000 (18:40 +0000)]
Debug Info: create scope children DIEs when the scope DIE is not null.

We try to create the scope children DIEs after we create the scope DIE. But
to avoid emitting empty lexical block DIE, we first check whether a scope
DIE is going to be null, then create the scope children if it is not null.
From the number of children, we decide whether to actually create the scope DIE.

This patch also removes an early exit which checks for a special condition.
It also removes deletion of un-used children DIEs that are generated
because we used to generate children DIEs before the scope DIE.

Deletion of un-used children DIEs may cause problem because we sometimes keep
created DIEs in a member variable of a CU.

llvm-svn: 190421

10 years agoObjectiveC migrator: rename inferred isXXX property,
Fariborz Jahanian [Tue, 10 Sep 2013 18:39:32 +0000 (18:39 +0000)]
ObjectiveC migrator: rename inferred isXXX property,
with a suitable 'getter' attribute.

llvm-svn: 190420

10 years agocmake: Install llvm-tblgen again
Hans Wennborg [Tue, 10 Sep 2013 18:35:14 +0000 (18:35 +0000)]
cmake: Install llvm-tblgen again

It was removed in r189130, but it turns out this makes life hard for
folks packaging LLVM and Clang and building the latter based on the
LLVM package.

Note that this only adds back the LLVM tblgen, and it's obviously
not included when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

llvm-svn: 190419

10 years agoDebug Info: define a DIRef template.
Manman Ren [Tue, 10 Sep 2013 18:30:07 +0000 (18:30 +0000)]
Debug Info: define a DIRef template.

Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure
the Value is indeed a scope ref and a type ref.

Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef
for getContainingType and getClassType.

DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for
readability and type safety.

llvm-svn: 190418

10 years agoARM: Use the PICADD opcode calculated.
Jim Grosbach [Tue, 10 Sep 2013 17:21:39 +0000 (17:21 +0000)]
ARM: Use the PICADD opcode calculated.

We were figuring out whether to use tPICADD or PICADD, then just using
tPICADD unconditionally anyway. Oops.

A testcase from someone familiar enough with ELF to produce one would
be appreciated. The existing PIC testcase correctly verifies the .s
generated, but that doesn't catch this bug, which only showed up in
direct-to-object mode.

http://llvm.org/bugs/show_bug.cgi?id=17180

llvm-svn: 190417

10 years agotest: Add @expectedFailureFreeBSD decorators
Ed Maste [Tue, 10 Sep 2013 17:15:05 +0000 (17:15 +0000)]
test: Add @expectedFailureFreeBSD decorators

llvm.org/pr17184 expression interpreter fails for crash/assert tests

llvm-svn: 190416

10 years agotest: Add @expectedFailureFreeBSD decorators
Ed Maste [Tue, 10 Sep 2013 16:25:05 +0000 (16:25 +0000)]
test: Add @expectedFailureFreeBSD decorators

http://llvm.org/pr17183 expression w/ varargs printf() fails
http://llvm.org/pr15302 'anonymous namespace' prefix missing

llvm-svn: 190415

10 years agoFixup for r190410: use lazy initialization for symbolizer as some compilers emit...
Alexey Samsonov [Tue, 10 Sep 2013 16:16:27 +0000 (16:16 +0000)]
Fixup for r190410: use lazy initialization for symbolizer as some compilers emit global constructor to setup vptr

llvm-svn: 190414

10 years agoAllow _clang-format as alternative to .clang-format config filename
Hans Wennborg [Tue, 10 Sep 2013 15:41:12 +0000 (15:41 +0000)]
Allow _clang-format as alternative to .clang-format config filename

Dotfiles are impractical on Windows. This makes clang-format search
for the style configuration file as '_clang-format' in addition to
the usual '.clang-format'. This is similar to how VIM searches for
'_vimrc' on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1629

llvm-svn: 190413

10 years agoRemove unused private member in ARMAsmPrinter.cpp.
Logan Chien [Tue, 10 Sep 2013 15:10:02 +0000 (15:10 +0000)]
Remove unused private member in ARMAsmPrinter.cpp.

This commit removes the unused "AttributeItem" from
ObjectAttributeEmitter.

llvm-svn: 190412

10 years ago[ASan] Remove the explicit function prototypes for intercepted functions on Windows
Timur Iskhodzhanov [Tue, 10 Sep 2013 14:42:15 +0000 (14:42 +0000)]
[ASan] Remove the explicit function prototypes for intercepted functions on Windows

llvm-svn: 190411

10 years ago[Sanitizer] Refactor symbolization interface: use class instead of several functions...
Alexey Samsonov [Tue, 10 Sep 2013 14:36:16 +0000 (14:36 +0000)]
[Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files

llvm-svn: 190410

10 years agoAdding LZMA as dep for XML2 on 2.8.0 or higher
Renato Golin [Tue, 10 Sep 2013 14:24:17 +0000 (14:24 +0000)]
Adding LZMA as dep for XML2 on 2.8.0 or higher

LibXML2 config doesn't specify lzma as a dependency, which breaks
cross-compilation builds using new linkers (ld 2.21 or higher).

There is a bug on libxml2 to fix that, but since it's going to take
a while for things to go round and back, so we should have a harmless
addition of the library until then.

llvm-svn: 190409

10 years agoDon't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144
Alexander Kornienko [Tue, 10 Sep 2013 13:41:43 +0000 (13:41 +0000)]
Don't divide L and #x in macro definitions. Fixes llvm.org/PR17144

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1639

llvm-svn: 190408

10 years ago[asan] refactor the use-after-return API so that the size class is computed at compil...
Kostya Serebryany [Tue, 10 Sep 2013 13:16:56 +0000 (13:16 +0000)]
[asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. llvm part

llvm-svn: 190407

10 years ago[asan] refactor the use-after-return API so that the size class is computed at compil...
Kostya Serebryany [Tue, 10 Sep 2013 13:16:26 +0000 (13:16 +0000)]
[asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. compiler-rt part

llvm-svn: 190406

10 years agoCorrectly calculate OriginalColumn after multi-line tokens.
Alexander Kornienko [Tue, 10 Sep 2013 12:29:48 +0000 (12:29 +0000)]
Correctly calculate OriginalColumn after multi-line tokens.

Summary: This also unifies the handling of escaped newlines for all tokens.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1638

llvm-svn: 190405

10 years ago[SystemZ] Update README.
Richard Sandiford [Tue, 10 Sep 2013 12:22:45 +0000 (12:22 +0000)]
[SystemZ] Update README.

llvm-svn: 190404

10 years ago[msan] Make all pointers in msan_interface "const volatile void *".
Evgeniy Stepanov [Tue, 10 Sep 2013 11:54:51 +0000 (11:54 +0000)]
[msan] Make all pointers in msan_interface "const volatile void *".

This way msan annotations can be used with both normal and volatile memory.

llvm-svn: 190403

10 years ago[msan] bool -> int to make msan_interface.h C-compatible.
Evgeniy Stepanov [Tue, 10 Sep 2013 11:04:37 +0000 (11:04 +0000)]
[msan] bool -> int to make msan_interface.h C-compatible.

llvm-svn: 190402

10 years agoclang-format: Understand function type typedefs with typeof.
Daniel Jasper [Tue, 10 Sep 2013 10:26:38 +0000 (10:26 +0000)]
clang-format: Understand function type typedefs with typeof.

Before:
  typedef typeof(int(int, int)) * MyFunc;
After:
  typedef typeof(int(int, int)) *MyFunc;

This fixes llvm.org/PR17178.

llvm-svn: 190401

10 years ago[SystemZ] Add TM and TMY
Richard Sandiford [Tue, 10 Sep 2013 10:20:32 +0000 (10:20 +0000)]
[SystemZ] Add TM and TMY

The main complication here is that TM and TMY (the memory forms) set
CC differently from the register forms.  When the tested bits contain
some 0s and some 1s, the register forms set CC to 1 or 2 based on the
value the uppermost bit.  The memory forms instead set CC to 1
regardless of the uppermost bit.

Until now, I've tried to make it so that a branch never tests for an
impossible CC value.  E.g. NR only sets CC to 0 or 1, so branches on the
result will only test for 0 or 1.  Originally I'd tried to do the same
thing for TM and TMY by using custom matching code in ISelDAGToDAG.
That ended up being very ugly though, and would have meant duplicating
some of the chain checks that the common isel code does.

I've therefore gone for the simpler alternative of adding an extra
operand to the TM DAG opcode to say whether a memory form would be OK.
This means that the inverse of a "TM;JE" is "TM;JNE" rather than the
more precise "TM;JNLE", just like the inverse of "TMLL;JE" is "TMLL;JNE".
I suppose that's arguably less confusing though...

llvm-svn: 190400

10 years ago[mips][msa] Removed unsupported dot product instructions (dotp_[su].b).
Daniel Sanders [Tue, 10 Sep 2013 10:10:39 +0000 (10:10 +0000)]
[mips][msa] Removed unsupported dot product instructions (dotp_[su].b).

The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190399

10 years ago[mips][msa] Removed unsupported dot product instructions (dotp_[su].b)
Daniel Sanders [Tue, 10 Sep 2013 09:51:43 +0000 (09:51 +0000)]
[mips][msa] Removed unsupported dot product instructions (dotp_[su].b)

The dotp_[su].b instructions never existed in any revision of the MSA spec.

llvm-svn: 190398

10 years agoAdd test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register...
Vladimir Medic [Tue, 10 Sep 2013 09:50:01 +0000 (09:50 +0000)]
Add test cases for Mips mthc1/mfhc1 instructions. Add check for odd value of register when PFU is 32 bit.

llvm-svn: 190397

10 years agoRemove obsolete code from MipsAsmParser.cpp.
Vladimir Medic [Tue, 10 Sep 2013 09:39:55 +0000 (09:39 +0000)]
Remove obsolete code from MipsAsmParser.cpp.

llvm-svn: 190396

10 years agoCalculate and store ColumnWidth instead of CodePointCount in FormatTokens.
Alexander Kornienko [Tue, 10 Sep 2013 09:38:25 +0000 (09:38 +0000)]
Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.

Summary:
This fixes various issues with mixed tabs and spaces handling, e.g.
when realigning block comments.

Reviewers: klimek, djasper

Reviewed By: djasper

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

llvm-svn: 190395

10 years agoDelete unused static class members
Alexey Samsonov [Tue, 10 Sep 2013 09:26:48 +0000 (09:26 +0000)]
Delete unused static class members

llvm-svn: 190394

10 years agoRejected 190391, due to failures on clang-x86_64-darwin11-nobootstrap-RAincremental.
Stepan Dyatkovskiy [Tue, 10 Sep 2013 08:37:22 +0000 (08:37 +0000)]
Rejected 190391, due to failures on clang-x86_64-darwin11-nobootstrap-RAincremental.

llvm-svn: 190393

10 years ago[ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID
Timur Iskhodzhanov [Tue, 10 Sep 2013 08:36:21 +0000 (08:36 +0000)]
[ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID

Also make DescribeThread easier to use.
This was firing on Dr.ASan runs, not sure how to repro InvalidTID in a simple test.

llvm-svn: 190392

10 years agoFix for PR16752. Second commit.
Stepan Dyatkovskiy [Tue, 10 Sep 2013 08:18:44 +0000 (08:18 +0000)]
Fix for PR16752. Second commit.

PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.

Fixes:
1st Commit (Done): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.

llvm-svn: 190391

10 years agoFix minor coding style issue in r190296 pointed out by Richard Smith.
David Tweed [Tue, 10 Sep 2013 08:00:34 +0000 (08:00 +0000)]
Fix minor coding style issue in r190296 pointed out by Richard Smith.

llvm-svn: 190390

10 years ago[python-bindings] Changed test_memory_buffer_create_from_file to just use the generic...
Michael Gottesman [Tue, 10 Sep 2013 06:58:00 +0000 (06:58 +0000)]
[python-bindings] Changed test_memory_buffer_create_from_file to just use the generic provided test_file instead of a binary.

llvm-svn: 190389

10 years ago[python bindings] Added code to get the length of a memory buffer. Tests are included.
Michael Gottesman [Tue, 10 Sep 2013 06:57:57 +0000 (06:57 +0000)]
[python bindings] Added code to get the length of a memory buffer. Tests are included.

This is a part of a series of patches that have been sitting fallow on a
personal branch that I have been messing with for a bit.

The patches start to flesh out the python llvm-c wrapper to the point where you can:

1. Load Modules from Bitcode/Dump/Print them.
2. Iterate over Functions from those modules/get their names/dump them.
3. Iterate over the BasicBlocks from said function/get the BB's name/dump it.
4. Iterate over the Instructions in said BasicBlocks/get the instructions
   name/dump the instruction.

My main interest in developing this was to be able to gather statistics about
LLVM IR using python scripts to speed up statistical profiling of different IR
level transformations (hence the focus on printing/dumping/getting names).

This is a gift from me to the LLVM community = ).

I am going to be committing the patches slowly over the next bit as I have time
to prepare the patches.

The overall organization follows the c-api like the bindings that are already
implemented.

llvm-svn: 190388

10 years agoSeparate popcnt and sse4.2 feature control somewhat to match gcc behavior.
Craig Topper [Tue, 10 Sep 2013 06:55:47 +0000 (06:55 +0000)]
Separate popcnt and sse4.2 feature control somewhat to match gcc behavior.

Enabling sse4.2 will implicitly enable popcnt unless popcnt is explicitly disabled.
Disabling sse4.2 will not disable popcnt if popcnt is explicitly enabled.

llvm-svn: 190387

10 years agoMCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/,...
NAKAMURA Takumi [Tue, 10 Sep 2013 06:01:56 +0000 (06:01 +0000)]
MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344.

XFAIL can be removed. (in r190374)

llvm-svn: 190386

10 years agoGenerate code for the move assignment operator using memcpy, the same as we do
Nick Lewycky [Tue, 10 Sep 2013 05:14:39 +0000 (05:14 +0000)]
Generate code for the move assignment operator using memcpy, the same as we do
for the copy assignment operator.

llvm-svn: 190385

10 years agoTempScopInfo: Microoptimize constant conditions
Tobias Grosser [Tue, 10 Sep 2013 04:47:19 +0000 (04:47 +0000)]
TempScopInfo: Microoptimize constant conditions

Use 0 >= 1 instead of 0 != 0 to represent 'false'. This might be slightly more
efficient as isl may create a union of sets for 0 != 0, whereas this is never
needed for the expression 0 >= 1.

Contributed-by: Alexandre Isoard <alexandre.isoard@gmail.com>
llvm-svn: 190384

10 years agoDelete unused variables.
Eli Friedman [Tue, 10 Sep 2013 03:27:07 +0000 (03:27 +0000)]
Delete unused variables.

llvm-svn: 190383

10 years agoMake -Wunused warning rules more consistent.
Eli Friedman [Tue, 10 Sep 2013 03:05:56 +0000 (03:05 +0000)]
Make -Wunused warning rules more consistent.

This patch does a few different things.

This patch improves unused var diags for const vars: we no longer
unconditionally suppress diagnostics for const vars, instead only suppressing
the diagnostic when the declaration appears to be useful.

This patch also makes us more consistently use whether a variable/function
is declared in the main file to suppress diagnostics where appropriate.

Fixes <rdar://problem/14907887>.

llvm-svn: 190382

10 years agoChanging the default shell to /bin/sh brought up a long-standing bug on OS X,
Jim Ingham [Tue, 10 Sep 2013 02:09:47 +0000 (02:09 +0000)]
Changing the default shell to /bin/sh brought up a long-standing bug on OS X,
that /bin/sh re-exec's itself to /bin/bash, so it needs one more resume when you
are using it as the shell than /bin/bash did or you will stop at the start of your
program, rather than running it.

So I added a Platform API to get the number of resumes needed when launching with
a particular shell, and set the right values for Mac OS X.

<rdar://problem/14935282>

llvm-svn: 190381

10 years agoChange the "breakpoint fuzz" algorithm from "coalesce the line ranges for a file...
Jim Ingham [Tue, 10 Sep 2013 02:06:17 +0000 (02:06 +0000)]
Change the "breakpoint fuzz" algorithm from "coalesce the line ranges for a file & line breakpoint if they are contiguous" to
"coalesce the line ranges for a file & line breakpoint to the first range in each block".  We were still setting a silly number
of independent breakpoints sometimes, and until we get a compiler that emits trustworthy is_stmt flags in the line table, we
need to do something to reduce the noise.

<rdar://problem/14920404>

llvm-svn: 190380

10 years ago[dfsan] Initial set of DFSAN_OPTIONS flags.
Peter Collingbourne [Tue, 10 Sep 2013 01:51:35 +0000 (01:51 +0000)]
[dfsan] Initial set of DFSAN_OPTIONS flags.

llvm-svn: 190379

10 years agoclang-cl: use -fdiagnostics-format=msvc by default
Hans Wennborg [Tue, 10 Sep 2013 01:07:07 +0000 (01:07 +0000)]
clang-cl: use -fdiagnostics-format=msvc by default

This allows for navigating to errors within the MSVC IDE by clicking
on the diagnostics.

llvm-svn: 190378

10 years agoIgnore calling conventions when checking function template specializations
Reid Kleckner [Tue, 10 Sep 2013 01:04:45 +0000 (01:04 +0000)]
Ignore calling conventions when checking function template specializations

Summary:
Calling conventions are inherited during decl merging.  Before this
change, deduction would fail due to a type mismatch between the template
and the specialization.  This change adjusts the CCs to match before
deduction, and lets the decl merging logic diagnose mismatch or inherit
the CC from the template.

This allows specializations of static member function templates in the
Microsoft C++ ABI.

Reviewers: rsmith

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

llvm-svn: 190377

10 years agoDon't use getSetCCResultType for creating a vselect
Matt Arsenault [Tue, 10 Sep 2013 00:41:56 +0000 (00:41 +0000)]
Don't use getSetCCResultType for creating a vselect

The vselect mask isn't a setcc.

This breaks in the case when the result of getSetCCResultType
is larger than the vector operands

e.g. %tmp = select i1 %cmp <2 x i8> %a, <2 x i8> %b
when getSetCCResultType returns <2 x i32>, the assertion
that the (MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits())
is hit.

No test since I don't think I can hit this with any of the current
targets. The R600/SI implementation would break, since it returns a
vector of i1 for this, but it doesn't reach ExpandSELECT for other
reasons.

llvm-svn: 190376

10 years agoUse StringRef::npos for StringRef instead of std::string one
Matt Arsenault [Tue, 10 Sep 2013 00:41:53 +0000 (00:41 +0000)]
Use StringRef::npos for StringRef instead of std::string one

llvm-svn: 190375

10 years agollvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for...
NAKAMURA Takumi [Tue, 10 Sep 2013 00:28:23 +0000 (00:28 +0000)]
llvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for now. Investigating.

FIXME: llvm-dwarfdump doesn't handle PECOFF.
llvm-svn: 190374

10 years agoRevert r190366. It was breaking build bots.
Bill Wendling [Tue, 10 Sep 2013 00:20:27 +0000 (00:20 +0000)]
Revert r190366. It was breaking build bots.

llvm-svn: 190373

10 years agoObjectiveC migrator. Do not infer NS_RETURNS_INNER_POINTER
Fariborz Jahanian [Mon, 9 Sep 2013 23:56:14 +0000 (23:56 +0000)]
ObjectiveC migrator. Do not infer NS_RETURNS_INNER_POINTER
annotation on methods which return typedef of pointer to
an incomplete struct type.

llvm-svn: 190372

10 years agoAdd ability to set OPTIONS for compile
Marshall Clow [Mon, 9 Sep 2013 23:53:08 +0000 (23:53 +0000)]
Add ability to set OPTIONS for compile

llvm-svn: 190371

10 years agoAttempting to unbreak the makefile-base builds.
Aaron Ballman [Mon, 9 Sep 2013 23:50:01 +0000 (23:50 +0000)]
Attempting to unbreak the makefile-base builds.

llvm-svn: 190370

10 years agoAdding a FIXME based on feedback from Richard Smith.
Aaron Ballman [Mon, 9 Sep 2013 23:40:31 +0000 (23:40 +0000)]
Adding a FIXME based on feedback from Richard Smith.

llvm-svn: 190369

10 years agoAttribute tablegen now understands that attribute arguments can be optional. This...
Aaron Ballman [Mon, 9 Sep 2013 23:33:17 +0000 (23:33 +0000)]
Attribute tablegen now understands that attribute arguments can be optional.  This allows for automated checking of the number of arguments expected vs number of arguments given for attributes.  Greatly reduces the amount of manual checking required.

llvm-svn: 190368

10 years agoEnable -misched-cyclicpath by default.
Andrew Trick [Mon, 9 Sep 2013 23:31:14 +0000 (23:31 +0000)]
Enable -misched-cyclicpath by default.

llvm-svn: 190367

10 years agoUse a default value for the prologue's debug location.
Bill Wendling [Mon, 9 Sep 2013 23:28:15 +0000 (23:28 +0000)]
Use a default value for the prologue's debug location.

llvm-svn: 190366

10 years agoFixed parsing of the .debug_aranges section so that LLDB will still work correctly...
Richard Mitton [Mon, 9 Sep 2013 23:17:40 +0000 (23:17 +0000)]
Fixed parsing of the .debug_aranges section so that LLDB will still work correctly even if arange data is not available for every object file in the program.

llvm-svn: 190365

10 years agoDebug Info: In DIBuilder, the context fields of a TAG_inheritance and a
Manman Ren [Mon, 9 Sep 2013 23:07:58 +0000 (23:07 +0000)]
Debug Info: In DIBuilder, the context fields of a TAG_inheritance and a
TAG_friend are updated to use scope reference.

Added testing cases to verify that class with inheritance can be uniqued.

llvm-svn: 190364

10 years agoDebug Info: move DIScope::getContext back from DwarfDebug.
Manman Ren [Mon, 9 Sep 2013 22:35:23 +0000 (22:35 +0000)]
Debug Info: move DIScope::getContext back from DwarfDebug.

This partially reverts r190330. DIScope::getContext now returns DIScopeRef
instead of DIScope. We construct a DIScopeRef from DIScope when we are
dealing with subprogram, lexical block or name space.

llvm-svn: 190362

10 years ago<rdar://problem/14728845>
Enrico Granata [Mon, 9 Sep 2013 22:35:18 +0000 (22:35 +0000)]
<rdar://problem/14728845>

Making the --timeout (-t) option to "platform shell" work for real

llvm-svn: 190361

10 years agomi-sched: smooth out the cyclicpath heuristic.
Andrew Trick [Mon, 9 Sep 2013 22:28:08 +0000 (22:28 +0000)]
mi-sched: smooth out the cyclicpath heuristic.

Arnold's idea.

I generally try to avoid stateful heuristics because it can make
debugging harder. However, we need a way to prevent the latency
priority from dominating, and it somewhat makes sense to schedule
aggressively for latency only within an issue group.

Swift in particular likes this, and it doesn't hurt anyone else:
| Benchmarks/MiBench/consumer-lame              |  10.39% |
| Benchmarks/Misc/himenobmtxpa                  |   9.63% |

llvm-svn: 190360

10 years agoDon't allow a NULL-length file. Try to revert to the buffered version.
Bill Wendling [Mon, 9 Sep 2013 22:25:46 +0000 (22:25 +0000)]
Don't allow a NULL-length file. Try to revert to the buffered version.

llvm-svn: 190359

10 years agowhite spaces and long lines
Jack Carter [Mon, 9 Sep 2013 22:02:08 +0000 (22:02 +0000)]
white spaces and long lines

llvm-svn: 190358

10 years agoDon't shrink atomic ops to bool in GlobalOpt.
Eli Friedman [Mon, 9 Sep 2013 22:00:13 +0000 (22:00 +0000)]
Don't shrink atomic ops to bool in GlobalOpt.

LLVM IR doesn't currently allow atomic bool load/store operations, and the
transformation is dubious anyway because it isn't profitable on all platforms.

PR17163.

llvm-svn: 190357

10 years agoDisabling tests affected by llvm.org/pr16170 on Linux
Daniel Malea [Mon, 9 Sep 2013 21:28:44 +0000 (21:28 +0000)]
Disabling tests affected by llvm.org/pr16170 on Linux
- occasional lldb hangs are causing noisy buildbots and trouble in the (Debian/Ubuntu) package builder

llvm-svn: 190355

10 years agoSet the encoding to '0' if we don't have an MAB.
Bill Wendling [Mon, 9 Sep 2013 21:22:44 +0000 (21:22 +0000)]
Set the encoding to '0' if we don't have an MAB.

llvm-svn: 190354

10 years agoFix a crash introduced in r189828.
Matt Beaumont-Gay [Mon, 9 Sep 2013 21:07:58 +0000 (21:07 +0000)]
Fix a crash introduced in r189828.

The predicates in CXXRecordDecl which test various properties of special
members can't be called on incomplete decls.

llvm-svn: 190353

10 years ago[InstCombiner] Expose opportunities to merge subtract and comparison.
Quentin Colombet [Mon, 9 Sep 2013 20:56:48 +0000 (20:56 +0000)]
[InstCombiner] Expose opportunities to merge subtract and comparison.

Several architectures use the same instruction to perform both a comparison and
a subtract. The instruction selection framework does not allow to consider
different basic blocks to expose such fusion opportunities.

Therefore, these instructions are “merged” by CSE at MI IR level.

To increase the likelihood of CSE to apply in such situation, we reorder the
operands of the comparison, when they have the same complexity, so that they
matches the order of the most frequent subtract.
E.g.,

icmp A, B
...
sub B, A

<rdar://problem/14514580>

llvm-svn: 190352

10 years agoDebug Info Testing: remove a commented out line.
Manman Ren [Mon, 9 Sep 2013 20:45:34 +0000 (20:45 +0000)]
Debug Info Testing: remove a commented out line.

llvm-svn: 190351

10 years agoAnother attempt to fix windows buildbots.
Bill Wendling [Mon, 9 Sep 2013 20:29:32 +0000 (20:29 +0000)]
Another attempt to fix windows buildbots.

llvm-svn: 190350

10 years agoAttempt to fix buildbots by giving an explicit output to the llvm-mc command.
Bill Wendling [Mon, 9 Sep 2013 20:22:38 +0000 (20:22 +0000)]
Attempt to fix buildbots by giving an explicit output to the llvm-mc command.

llvm-svn: 190349

10 years agoExpand test to make sure that we can generate compact unwind from an ASM file.
Bill Wendling [Mon, 9 Sep 2013 20:12:36 +0000 (20:12 +0000)]
Expand test to make sure that we can generate compact unwind from an ASM file.

llvm-svn: 190348

10 years agoExpand test to make sure that we can generate compact unwind from an ASM file.
Bill Wendling [Mon, 9 Sep 2013 20:10:54 +0000 (20:10 +0000)]
Expand test to make sure that we can generate compact unwind from an ASM file.

llvm-svn: 190347

10 years agoAlways add global names. We're adding them in the rest of the code
Eric Christopher [Mon, 9 Sep 2013 20:03:20 +0000 (20:03 +0000)]
Always add global names. We're adding them in the rest of the code
as well as types.

No functional change as they're not emitted unless the option
is true anyhow.

llvm-svn: 190346

10 years agoRename for consistency.
Eric Christopher [Mon, 9 Sep 2013 20:03:17 +0000 (20:03 +0000)]
Rename for consistency.

llvm-svn: 190345

10 years agoAdd the gnu pubnames and pubtypes sections to the mc object file
Eric Christopher [Mon, 9 Sep 2013 20:03:14 +0000 (20:03 +0000)]
Add the gnu pubnames and pubtypes sections to the mc object file
handling.

llvm-svn: 190344

10 years agoAdd constant defines for gnu pubnames and gnu pubtypes - they're used
Eric Christopher [Mon, 9 Sep 2013 20:03:11 +0000 (20:03 +0000)]
Add constant defines for gnu pubnames and gnu pubtypes - they're used
for the gdb index as the names convey.

llvm-svn: 190343