platform/upstream/llvm.git
11 years ago[PowerPC] Preparatory refactoring for making prologue and epilogue
Bill Schmidt [Fri, 16 Aug 2013 20:05:04 +0000 (20:05 +0000)]
[PowerPC] Preparatory refactoring for making prologue and epilogue
safe on PPC32 SVR4 ABI

[Patch and following text by Mark Minich; committing on his behalf.]

There are FIXME's in PowerPC/PPCFrameLowering.cpp, method
PPCFrameLowering::emitPrologue() related to "negative offsets of R1"
on PPC32 SVR4. They're true, but the real issue is that on PPC32 SVR4
(and any ABI without a Red Zone), no spills may be made until after
the stackframe is claimed, which also includes the LR spill which is
at a positive offset. The same problem exists in emitEpilogue(),
though there's no FIXME for it. I intend to fix this issue, making
LLVM-compiled code finally safe for use on SVR4/EABI/e500 32-bit
platforms (including in particular, OS-free embedded systems & kernel
code, where interrupts may share the same stack as user code).

In preparation for making these changes, to make the diffs for the
functional changes less cluttered, I am providing the non-functional
refactorings in two stages:

Stage 1 does some minor fluffy refactorings to pull multiple method
calls up into a single bool, creating named bools for repeated uses of
obscure logic, moving some code up earlier because either stage 2 or
my final version will require it earlier, and rewording/adding some
comments. My stage 1 changes can be characterized as primarily fluffy
cleanup, the purpose of which may be unclear until the stage 2 or
final changes are made.

My stage 2 refactorings combine the separate PPC32 & PPC64 logic,
which is currently performed by largely duplicate code, into a single
flow, with the differences handled by a group of constants initialized
early in the methods.

This submission is for my stage 1 changes. There should be no
functional changes whatsoever; this is a pure refactoring.

llvm-svn: 188573

11 years agoFixed RuntimeDyldELF absolute relocations.
Richard Mitton [Fri, 16 Aug 2013 18:54:26 +0000 (18:54 +0000)]
Fixed RuntimeDyldELF absolute relocations.

If an ELF relocation is pointed at an absolute address, it will have a symbol ID of zero.
RuntimeDyldELF::processRelocationRef was not previously handling this case, and was instead trying to handle it as a section-relative fixup.

I think this is the right fix here, but my elf-fu is poor on some of the more exotic platforms, so I'd appreciate it if anyone with greater knowledge could verify this.

llvm-svn: 188572

11 years agoThread safety analysis: new test case
DeLesley Hutchins [Fri, 16 Aug 2013 18:28:00 +0000 (18:28 +0000)]
Thread safety analysis: new test case

llvm-svn: 188571

11 years agoTest commit.
Richard Mitton [Fri, 16 Aug 2013 18:18:31 +0000 (18:18 +0000)]
Test commit.

llvm-svn: 188570

11 years agoIntroduce the clangIDE library.
Argyrios Kyrtzidis [Fri, 16 Aug 2013 18:17:55 +0000 (18:17 +0000)]
Introduce the clangIDE library.

Libclang has a lot of functionality that is inaccessible.
The purpose of clangIDE is to move most of the functionality of libclang to it so we
can expose it and have libclang be more of a thin C wrapper over clangIDE.

Start by moving the USR generation functionality into clangIDE.

llvm-svn: 188569

11 years agoTest commit.
Richard Mitton [Fri, 16 Aug 2013 18:09:06 +0000 (18:09 +0000)]
Test commit.

llvm-svn: 188568

11 years ago[tests] Another attempt to workaround broken misched-copy.s test on some buildbots.
Daniel Dunbar [Fri, 16 Aug 2013 18:01:18 +0000 (18:01 +0000)]
[tests] Another attempt to workaround broken misched-copy.s test on some buildbots.

llvm-svn: 188567

11 years agoSwitching to using a helper function instead of manually converting the string to...
Aaron Ballman [Fri, 16 Aug 2013 17:53:28 +0000 (17:53 +0000)]
Switching to using a helper function instead of manually converting the string to UTF-8.

llvm-svn: 188566

11 years agoRemoving unused functionality.
Aaron Ballman [Fri, 16 Aug 2013 17:33:57 +0000 (17:33 +0000)]
Removing unused functionality.

llvm-svn: 188565

11 years agoFileCheck: Fix stray quote in CHECK-LABEL error message.
Stephen Lin [Fri, 16 Aug 2013 17:29:01 +0000 (17:29 +0000)]
FileCheck: Fix stray quote in CHECK-LABEL error message.

llvm-svn: 188564

11 years agoInstCombine: Use isAllOnesValue() instead of explicit -1.
Jim Grosbach [Fri, 16 Aug 2013 17:03:36 +0000 (17:03 +0000)]
InstCombine: Use isAllOnesValue() instead of explicit -1.

llvm-svn: 188563

11 years agoclang-format utils/TableGen/TableGen.cpp.
Rafael Espindola [Fri, 16 Aug 2013 16:46:27 +0000 (16:46 +0000)]
clang-format utils/TableGen/TableGen.cpp.

I have a patch that edits the file. Running clang-format first makes the patch
a lot easier to review.

llvm-svn: 188562

11 years agoRefactor ArgumentAdaptativeMatcher matchers to remove the template from their declara...
Samuel Benzaquen [Fri, 16 Aug 2013 16:19:42 +0000 (16:19 +0000)]
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.

Summary:
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
This facilitates dynamic registration. Change the registry code to use the regular overload resolution mechanism for adaptative matchers.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1402

llvm-svn: 188560

11 years agoR600/SI: Add pattern for xor of i1
Michel Danzer [Fri, 16 Aug 2013 16:19:31 +0000 (16:19 +0000)]
R600/SI: Add pattern for xor of i1

Fixes two recent piglit regressions with radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188559

11 years agoR600/SI: Fix broken encoding of DS_WRITE_B32
Michel Danzer [Fri, 16 Aug 2013 16:19:24 +0000 (16:19 +0000)]
R600/SI: Fix broken encoding of DS_WRITE_B32

The logic in SIInsertWaits::getHwCounts() only really made sense for SMRD
instructions, and trying to shoehorn it into handling DS_WRITE_B32 caused
it to corrupt the encoding of that by clobbering the first operand with
the second one.

Undo that damage and only apply the SMRD logic to that.

Fixes some derivates related piglit regressions with radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188558

11 years agoReverted test commit (r188556)
Daniel Sanders [Fri, 16 Aug 2013 15:27:12 +0000 (15:27 +0000)]
Reverted test commit (r188556)

llvm-svn: 188557

11 years agoTest commit. Just a blank line
Daniel Sanders [Fri, 16 Aug 2013 15:26:36 +0000 (15:26 +0000)]
Test commit. Just a blank line

llvm-svn: 188556

11 years agoR600: Allocate memoperand in the MachienFunction so it doesn't leak.
Benjamin Kramer [Fri, 16 Aug 2013 14:48:09 +0000 (14:48 +0000)]
R600: Allocate memoperand in the MachienFunction so it doesn't leak.

llvm-svn: 188555

11 years agoUpdating function comments; no functional changes intended.
Aaron Ballman [Fri, 16 Aug 2013 14:33:07 +0000 (14:33 +0000)]
Updating function comments; no functional changes intended.

llvm-svn: 188554

11 years agoPassing false instead of 0; no functional change intended.
Aaron Ballman [Fri, 16 Aug 2013 13:42:41 +0000 (13:42 +0000)]
Passing false instead of 0; no functional change intended.

llvm-svn: 188553

11 years agoPassing false instead of 0; no functional change intended.
Aaron Ballman [Fri, 16 Aug 2013 13:34:39 +0000 (13:34 +0000)]
Passing false instead of 0; no functional change intended.

llvm-svn: 188552

11 years agoWhen initializing the PIC global base register on ARM/ELF add pc to fix the address.
Benjamin Kramer [Fri, 16 Aug 2013 12:52:08 +0000 (12:52 +0000)]
When initializing the PIC global base register on ARM/ELF add pc to fix the address.

This unbreaks PIC with fast isel on ELF targets (PR16717). The output matches
what GCC and SDag do for PIC but may not cover all of the many flavors of PIC
that exist.

llvm-svn: 188551

11 years agoTweak Replacement comparisons
Edwin Vane [Fri, 16 Aug 2013 12:18:53 +0000 (12:18 +0000)]
Tweak Replacement comparisons

* Introduce operator< to replace Replacement::Less
* Make operator== and operator< on Replacements non-member functions
* Change order of comparisons in operator< to do string comparisons last

llvm-svn: 188550

11 years agoAdd support for Thumb2 literal loads with negative zero offset
Mihai Popa [Fri, 16 Aug 2013 12:03:00 +0000 (12:03 +0000)]
Add support for Thumb2 literal loads with negative zero offset

Thumb2 literal loads use an offset encoding which allows for
negative zero. This fixes parsing and encoding so that #-0
is correctly processed. The parser represents #-0 as INT32_MIN.

llvm-svn: 188549

11 years agoFix Thumb2 aliasing complementary instructions taking modified immediates
Mihai Popa [Fri, 16 Aug 2013 11:55:44 +0000 (11:55 +0000)]
Fix Thumb2 aliasing complementary instructions taking modified immediates

There are many Thumb instructions which take 12-bit immediates encoded in a special
8-byte value + 4-byte rotator form. Not all numbers are represented, and it's legal
to transform an assembly instruction to be able to encode the immediate.

For example: AND and BIC are complementary instructions; one can switch the AND
to a BIC as long as the immediate is complemented.

The intent is to switch one instruction into its complementary one when the immediate
cannot be encoded in the form requested in the original assembly and when the
complementary immediate is encodable.

The patch addresses two issues:
1. definition of t2SOImmNot immediate - it has to check that the orignal value is
not encoded naturally
2. t2AND and t2BIC instruction aliases which should use the Thumb2 SOImm operand
rather than the ARM one.

llvm-svn: 188548

11 years ago[SystemZ] Use SRST to implement strlen and strnlen
Richard Sandiford [Fri, 16 Aug 2013 11:41:43 +0000 (11:41 +0000)]
[SystemZ] Use SRST to implement strlen and strnlen

It would also make sense to use it for memchr; I'm working on that now.

llvm-svn: 188547

11 years ago[SystemZ] Use MVST to implement strcpy and stpcpy
Richard Sandiford [Fri, 16 Aug 2013 11:29:37 +0000 (11:29 +0000)]
[SystemZ] Use MVST to implement strcpy and stpcpy

llvm-svn: 188546

11 years ago[ASan/RTL] Disable colored reporting on Windows
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:26:26 +0000 (11:26 +0000)]
[ASan/RTL] Disable colored reporting on Windows

llvm-svn: 188545

11 years ago[SystemZ] Use CLST to implement strcmp
Richard Sandiford [Fri, 16 Aug 2013 11:21:54 +0000 (11:21 +0000)]
[SystemZ] Use CLST to implement strcmp

llvm-svn: 188544

11 years agoSplit UnwrappedLineFormatter into individual components.
Daniel Jasper [Fri, 16 Aug 2013 11:20:30 +0000 (11:20 +0000)]
Split UnwrappedLineFormatter into individual components.

Goals: Structure code better and make components easier to use for
future features (e.g. column layout for long braced initializers).

No functional changes intended.

llvm-svn: 188543

11 years agotsan: better report formatting for Go
Dmitry Vyukov [Fri, 16 Aug 2013 11:15:14 +0000 (11:15 +0000)]
tsan: better report formatting for Go
Say that gorotuine 1 is main goroutine.
Remove excessive new line.

llvm-svn: 188542

11 years ago[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:04:59 +0000 (11:04 +0000)]
[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows

llvm-svn: 188541

11 years ago[SystemZ] Fix handling of 64-bit memcmp results
Richard Sandiford [Fri, 16 Aug 2013 10:55:47 +0000 (10:55 +0000)]
[SystemZ] Fix handling of 64-bit memcmp results

Generalize r188163 to cope with return types other than MVT::i32, just
as the existing visitMemCmpCall code did.  I've split this out into a
subroutine so that it can be used for other upcoming patches.

I also noticed that I'd used the wrong API to record the out chain.
It's a load that uses DAG.getRoot() rather than getRoot(), so the out
chain should go on PendingLoads.  I don't have a testcase for that because
we don't do any interesting scheduling on z yet.

llvm-svn: 188540

11 years agoRevert r188498.
Evgeniy Stepanov [Fri, 16 Aug 2013 10:35:31 +0000 (10:35 +0000)]
Revert r188498.

This change broke release+asserts build with compiler-rt.

llvm-svn: 188539

11 years ago[SystemZ] Fix sign of integer memcmp result
Richard Sandiford [Fri, 16 Aug 2013 10:22:54 +0000 (10:22 +0000)]
[SystemZ] Fix sign of integer memcmp result

r188163 used CLC to implement memcmp.  Code that compares the result
directly against zero can test the CC value produced by CLC, but code
that needs an integer result must use IPM.  The sequence I'd used was:

   ipm <reg>
   sll <reg>, 2
   sra <reg>, 30

but I'd forgotten that this inverts the order, so that CC==1 ("less")
becomes an integer greater than zero, and CC==2 ("greater") becomes
an integer less than zero.  This sequence should only be used if the
CLC arguments are reversed to compensate.  The problem then is that
the branch condition must also be reversed when testing the CLC
result directly.

Rather than do that, I went for a different sequence that works with
the natural CLC order:

   ipm <reg>
   srl <reg>, 28
   rll <reg>, <reg>, 31

One advantage of this is that it doesn't clobber CC.  A disadvantage
is that any sign extension to 64 bits must be done separately,
rather than being folded into the shifts.

llvm-svn: 188538

11 years agoThis patch implements wait instruction for mips. Examples are added in test files.
Vladimir Medic [Fri, 16 Aug 2013 10:17:03 +0000 (10:17 +0000)]
This patch implements wait instruction for mips. Examples are added in test files.

llvm-svn: 188537

11 years agoParse: Do not 'HandleTopLevelDecl' on templated functions.
David Majnemer [Fri, 16 Aug 2013 08:29:13 +0000 (08:29 +0000)]
Parse: Do not 'HandleTopLevelDecl' on templated functions.

Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.

Reviewers: rsmith

Reviewed By: rsmith

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

llvm-svn: 188536

11 years agoFix typo pointed out by Jordan.
Ted Kremenek [Fri, 16 Aug 2013 06:22:23 +0000 (06:22 +0000)]
Fix typo pointed out by Jordan.

llvm-svn: 188535

11 years agoDon't use v16i32 for load pattern matching. All 512-bit loads are cated to v8i64.
Craig Topper [Fri, 16 Aug 2013 06:07:34 +0000 (06:07 +0000)]
Don't use v16i32 for load pattern matching. All 512-bit loads are cated to v8i64.

llvm-svn: 188534

11 years agoUse -std=c++11 when no compilation database is provided
Ariel J. Bernal [Fri, 16 Aug 2013 04:40:44 +0000 (04:40 +0000)]
Use -std=c++11 when no compilation database is provided

Allow the migrator to be used without specifing --. If neither -- nor -p is
provided and no compilation database can be detecteded from the first source
file path then -std=c++11 is added as the only compiler argument.

llvm-svn: 188533

11 years agoAdd a new Section::SetFileAddress method to change a Section's file
Jason Molenda [Fri, 16 Aug 2013 03:20:42 +0000 (03:20 +0000)]
Add a new Section::SetFileAddress method to change a Section's file
address.

When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.

I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.

<rdar://problem/12335086>

llvm-svn: 188532

11 years agoWindows ToolChain: add VS bin dir to PogramPaths
Hans Wennborg [Fri, 16 Aug 2013 03:15:10 +0000 (03:15 +0000)]
Windows ToolChain: add VS bin dir to PogramPaths

We have a lot of fancy logic to find Visual Studio, which is currently used
to set the system header include paths.

Use the same code to set the ProgramPaths, which is used for finding programs
such as link.exe. Previously, Clang would just search PATH for link.exe,
but now it should find it if it's able to find Visual Studio.

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

llvm-svn: 188531

11 years agoRe-disabling C4291 warnings for MSVC because AttributeList.h requires it. This was...
Aaron Ballman [Fri, 16 Aug 2013 03:06:38 +0000 (03:06 +0000)]
Re-disabling C4291 warnings for MSVC because AttributeList.h requires it.  This was accidentally removed in r187279.

llvm-svn: 188530

11 years agoAdd missing test for GEP + bitcast transformation
Matt Arsenault [Fri, 16 Aug 2013 02:59:17 +0000 (02:59 +0000)]
Add missing test for GEP + bitcast transformation

llvm-svn: 188529

11 years agoCalling the base class constructor from the derived class' initializer list. This...
Aaron Ballman [Fri, 16 Aug 2013 02:56:43 +0000 (02:56 +0000)]
Calling the base class constructor from the derived class' initializer list.  This matches DenseMap's behavior, and silences some warnings.

llvm-svn: 188528

11 years ago[tests] Add a hack to eliminate some dangling .s files on buildbots.
Daniel Dunbar [Fri, 16 Aug 2013 02:54:00 +0000 (02:54 +0000)]
[tests] Add a hack to eliminate some dangling .s files on buildbots.

 - Benjamin fixed the emission of this file in r179937, but it still lives on a
   few buildbots. We should probably clean up the build dirs once in a while,
   eh?

llvm-svn: 188527

11 years ago[tests] Remove an out-dated failing test.
Daniel Dunbar [Fri, 16 Aug 2013 02:53:29 +0000 (02:53 +0000)]
[tests] Remove an out-dated failing test.

llvm-svn: 188526

11 years agoRemoving a spurious semi-colon; this macro expands into a namespace.
Aaron Ballman [Fri, 16 Aug 2013 01:53:58 +0000 (01:53 +0000)]
Removing a spurious semi-colon; this macro expands into a namespace.

llvm-svn: 188525

11 years agoFixing a warning about control reaching the end of a non-void function.
Aaron Ballman [Fri, 16 Aug 2013 01:43:31 +0000 (01:43 +0000)]
Fixing a warning about control reaching the end of a non-void function.

llvm-svn: 188524

11 years agoRevert "R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions"
Tom Stellard [Fri, 16 Aug 2013 01:18:43 +0000 (01:18 +0000)]
Revert "R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions"

This reverts commit a6a39ced095c2f453624ce62c4aead25db41a18f.
This is the wrong version of this fix.

llvm-svn: 188523

11 years agoR600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions
Tom Stellard [Fri, 16 Aug 2013 01:12:20 +0000 (01:12 +0000)]
R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions

The SIInsertWaits pass was overwriting the first operand (gds bit) of
DS_WRITE_B32 with the second operand (value to write).  This meant that
any time the value to write was stored in an odd number VGPR, the gds
bit would be set causing the instruction to write to GDS instead of LDS.

llvm-svn: 188522

11 years agoR600: Add support for global vector loads with element types less than 32-bits
Tom Stellard [Fri, 16 Aug 2013 01:12:16 +0000 (01:12 +0000)]
R600: Add support for global vector loads with element types less than 32-bits

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188521

11 years agoR600: Add support for global vector stores with elements less than 32-bits
Tom Stellard [Fri, 16 Aug 2013 01:12:11 +0000 (01:12 +0000)]
R600: Add support for global vector stores with elements less than 32-bits

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188520

11 years agoR600: Add support for i16 and i8 global stores
Tom Stellard [Fri, 16 Aug 2013 01:12:06 +0000 (01:12 +0000)]
R600: Add support for i16 and i8 global stores

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188519

11 years agoR600: Add support for v4i32 stores on Cayman
Tom Stellard [Fri, 16 Aug 2013 01:12:00 +0000 (01:12 +0000)]
R600: Add support for v4i32 stores on Cayman

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188518

11 years agoR600: Enable folding of inline literals into REQ_SEQUENCE instructions
Tom Stellard [Fri, 16 Aug 2013 01:11:55 +0000 (01:11 +0000)]
R600: Enable folding of inline literals into REQ_SEQUENCE instructions

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188517

11 years agoR600: Add IsExport bit to TableGen instruction definitions
Tom Stellard [Fri, 16 Aug 2013 01:11:51 +0000 (01:11 +0000)]
R600: Add IsExport bit to TableGen instruction definitions

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188516

11 years agoR600: Change the RAT instruction assembly names so they match the docs
Tom Stellard [Fri, 16 Aug 2013 01:11:46 +0000 (01:11 +0000)]
R600: Change the RAT instruction assembly names so they match the docs

Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188515

11 years ago[analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.
Jordan Rose [Fri, 16 Aug 2013 01:06:30 +0000 (01:06 +0000)]
[analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.

This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)

One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.

Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.

llvm-svn: 188514

11 years ago[tests] Cleanup initialization of test suffixes.
Daniel Dunbar [Fri, 16 Aug 2013 00:37:11 +0000 (00:37 +0000)]
[tests] Cleanup initialization of test suffixes.

 - Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).

 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).

 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.

llvm-svn: 188513

11 years agoInstCombine: Simplify if(x!=0 && x!=-1).
Jim Grosbach [Fri, 16 Aug 2013 00:15:20 +0000 (00:15 +0000)]
InstCombine: Simplify if(x!=0 && x!=-1).

When both constants are positive or both constants are negative,
InstCombine already simplifies comparisons like this, but when
it's exactly zero and -1, the operand sorting ends up reversed
and the pattern fails to match. Handle that special case.

Follow up for rdar://14689217

llvm-svn: 188512

11 years agoDon't allow unary negation on scoped enums.
Eli Friedman [Fri, 16 Aug 2013 00:09:18 +0000 (00:09 +0000)]
Don't allow unary negation on scoped enums.

PR16900.

llvm-svn: 188511

11 years agoFix for dependent contexts in alias templates.
Eli Friedman [Thu, 15 Aug 2013 23:59:20 +0000 (23:59 +0000)]
Fix for dependent contexts in alias templates.

When we are parsing a type for an alias template, we are not entering
the context, so we can't look into dependent classes.  Make sure the
parser handles this correctly.

PR16904.

llvm-svn: 188510

11 years agoCMake: polish the Windows packaging rules
Hans Wennborg [Thu, 15 Aug 2013 23:44:31 +0000 (23:44 +0000)]
CMake: polish the Windows packaging rules

This tweaks the CMake rules for building an installation package on Windows:
 - Sets license file (otherwise nsis shows an ugly default)
 - Adds LLVM logo
 - Shows "do you want to add this to the system path" dialog.

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

llvm-svn: 188509

11 years agoTighten up the yamilizer so it stops eliding empty sequences if the embedded empty...
Aaron Ballman [Thu, 15 Aug 2013 23:17:53 +0000 (23:17 +0000)]
Tighten up the yamilizer so it stops eliding empty sequences if the embedded empty sequence is the first key/value in a map which is itself in a sequence.

Patch with help from Nick Kledzik.

llvm-svn: 188508

11 years agoDon't do FoldCmpLoadFromIndexedGlobal for non inbounds GEPs
Matt Arsenault [Thu, 15 Aug 2013 23:11:07 +0000 (23:11 +0000)]
Don't do FoldCmpLoadFromIndexedGlobal for non inbounds GEPs

This path wasn't tested before without a datalayout,
so add some more tests and re-run with and without one.

llvm-svn: 188507

11 years agoFix spelling
Matt Arsenault [Thu, 15 Aug 2013 23:11:03 +0000 (23:11 +0000)]
Fix spelling

llvm-svn: 188506

11 years agoThread Safety Analysis: fix bug when using TryLock with && and || expressions.
DeLesley Hutchins [Thu, 15 Aug 2013 23:06:33 +0000 (23:06 +0000)]
Thread Safety Analysis: fix bug when using TryLock with && and || expressions.

llvm-svn: 188505

11 years agoRemove empty directory.
Daniel Dunbar [Thu, 15 Aug 2013 22:53:10 +0000 (22:53 +0000)]
Remove empty directory.

llvm-svn: 188504

11 years ago[tests] Fix refacto in r187764 that effectively disabled SimplifyCFG tests. :(
Daniel Dunbar [Thu, 15 Aug 2013 22:52:27 +0000 (22:52 +0000)]
[tests] Fix refacto in r187764 that effectively disabled SimplifyCFG tests. :(

llvm-svn: 188503

11 years ago[lit] Remove some done TODOs.
Daniel Dunbar [Thu, 15 Aug 2013 22:52:20 +0000 (22:52 +0000)]
[lit] Remove some done TODOs.

llvm-svn: 188502

11 years agoDebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result.
David Blaikie [Thu, 15 Aug 2013 22:50:29 +0000 (22:50 +0000)]
DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result.

llvm-svn: 188501

11 years agoRemove unnecessary explicit cast.
David Blaikie [Thu, 15 Aug 2013 22:42:12 +0000 (22:42 +0000)]
Remove unnecessary explicit cast.

llvm-svn: 188500

11 years agoSupport X86_64_GOTLoad relocations in RuntimeDyldMachO by treating them the
Lang Hames [Thu, 15 Aug 2013 22:31:40 +0000 (22:31 +0000)]
Support X86_64_GOTLoad relocations in RuntimeDyldMachO by treating them the
same way as X86_64_GOT relocations. The 'Load' part of GOTLoad is just an
optimization hint for the linker anyway, and can be safely ignored.

This patch also fixes some minor issues with the relocations introduced while
processing an X86_64_GOT[Load]: the addend for the GOT entry should always be
zero, and the addend for the replacement relocation at the original offset
should be the same as the addend of the relocation being replaced.

I haven't come up with a good way of testing this yet, but I'm working on it.

This fixes <rdar://problem/14651564>.

llvm-svn: 188499

11 years agoDebugInfo: Split out the implementation of getStaticDataMemberDeclaration for future use
David Blaikie [Thu, 15 Aug 2013 22:30:23 +0000 (22:30 +0000)]
DebugInfo: Split out the implementation of getStaticDataMemberDeclaration for future use

llvm-svn: 188498

11 years agoObjetiveC migrator: fix the test in my last patch
Fariborz Jahanian [Thu, 15 Aug 2013 22:26:10 +0000 (22:26 +0000)]
ObjetiveC migrator: fix the test in my last patch
to define real CF_RETURNS_RETAINED/CF_NO_RETURNS_RETAINED
pairs.

llvm-svn: 188497

11 years agoFix assert added in r188494
David Blaikie [Thu, 15 Aug 2013 22:18:13 +0000 (22:18 +0000)]
Fix assert added in r188494

llvm-svn: 188496

11 years agoProperly track l-paren of a CXXFucntionalCastExpr.
Eli Friedman [Thu, 15 Aug 2013 22:02:56 +0000 (22:02 +0000)]
Properly track l-paren of a CXXFucntionalCastExpr.

In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

llvm-svn: 188495

11 years agoDebugInfo: Remove unused conditional
David Blaikie [Thu, 15 Aug 2013 21:55:56 +0000 (21:55 +0000)]
DebugInfo: Remove unused conditional

llvm-svn: 188494

11 years agoObjectiveC migrator. Start annotating CF functions
Fariborz Jahanian [Thu, 15 Aug 2013 21:44:38 +0000 (21:44 +0000)]
ObjectiveC migrator. Start annotating CF functions
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.

llvm-svn: 188493

11 years agoDebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match...
David Blaikie [Thu, 15 Aug 2013 21:42:43 +0000 (21:42 +0000)]
DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics

Rather than having a cast immediately inside the function, push that
type requirement out to the callers.

llvm-svn: 188492

11 years agoDebugInfo: Add a FIXME, remove a FIXME.
David Blaikie [Thu, 15 Aug 2013 21:21:19 +0000 (21:21 +0000)]
DebugInfo: Add a FIXME, remove a FIXME.

(the removed FIXME no longer applies since we made this debug info
optimization not apply to C)

llvm-svn: 188491

11 years ago[dfsan] Initial set of custom functions and interceptors for libc.
Peter Collingbourne [Thu, 15 Aug 2013 21:18:53 +0000 (21:18 +0000)]
[dfsan] Initial set of custom functions and interceptors for libc.

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

llvm-svn: 188490

11 years agoFixing a corner-case bug in strchr and strrchr lib call optimizations where
Yunzhong Gao [Thu, 15 Aug 2013 20:58:59 +0000 (20:58 +0000)]
Fixing a corner-case bug in strchr and strrchr lib call optimizations where
the input character is not converted to char before comparing with zero.

The patch was discussed in this thread:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130812/184069.html

llvm-svn: 188489

11 years agomake arm-use-movt available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:54:45 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM

This updates clang according to a pending patch for llvm to
rename of the -arm-darwin-use-movt to arm-use-movt to make
it available for all of ARM.

note: please apply this close to the llvm change.

Patch by Jeroen Hofstee.

llvm-svn: 188488

11 years agomake arm-use-movt available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:54:38 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM

Before this patch this flag is IOS specific, but is also
useful for bare project like bootloaders / kernels etc,
since movw / movt prevents simple relocation. Therefore
make this flag more commonly available.

note: this patch depends on a similiar rename in clang

Patch by Jeroen Hofstee.

llvm-svn: 188487

11 years agoDebugInfo: Unify & optimize the lazy addition of record types
David Blaikie [Thu, 15 Aug 2013 20:49:17 +0000 (20:49 +0000)]
DebugInfo: Unify & optimize the lazy addition of record types

Rather than going through the whole getOrCreateType machinery to
manifest a type, cut straight to the implementation because we know we
have to do work.

While the previous implementation was sufficient for the two cases
(completeness and required completeness) we have already (the general
machinery could inspect the type for those attributes & go down the full
definition path), a pending change (to emit info for types when we emit
their vtables) won't have that luxury & we'll need to force the creation
rather than relying on the general purpose routine.

llvm-svn: 188486

11 years agomake arm-reserve-r9 available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:45:13 +0000 (20:45 +0000)]
make arm-reserve-r9 available for all ARM

r9 is defined as a platform-specific register in the ARM EABI.
It can be reserved for a special purpose or be used as a general
purpose register. Add support for reserving r9 for all ARM, while
leaving the IOS usage unchanged.

Patch by Jeroen Hofstee.

llvm-svn: 188485

11 years agoMake a few more things const.
Bill Wendling [Thu, 15 Aug 2013 20:25:44 +0000 (20:25 +0000)]
Make a few more things const.

llvm-svn: 188484

11 years agoUse a reference instead of making an unnecessary copy. Also use 'const'.
Bill Wendling [Thu, 15 Aug 2013 20:21:49 +0000 (20:21 +0000)]
Use a reference instead of making an unnecessary copy. Also use 'const'.

llvm-svn: 188483

11 years agoDebugInfo: Revert change to the return type of createRecordFwdDecl
David Blaikie [Thu, 15 Aug 2013 20:17:25 +0000 (20:17 +0000)]
DebugInfo: Revert change to the return type of createRecordFwdDecl

It still does only return DICompositeType, but I've no need to make that
change right now.

llvm-svn: 188482

11 years agoCodeGen: __uuidof should work even with an incomplete _GUID type
David Majnemer [Thu, 15 Aug 2013 19:59:14 +0000 (19:59 +0000)]
CodeGen: __uuidof should work even with an incomplete _GUID type

Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

This fixes PR16856.

Reviewers: rsmith, rnk, thakis

Reviewed By: rnk

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

llvm-svn: 188481

11 years agoAdd another test to my last patch (NS_OPTION vs. NS_ENUM)
Fariborz Jahanian [Thu, 15 Aug 2013 19:27:42 +0000 (19:27 +0000)]
Add another test to my last patch (NS_OPTION vs. NS_ENUM)
ObjectiveC migration.

llvm-svn: 188480

11 years ago[autotools->cmake] Added variable CLANG_VENDOR_UTI.
Michael Gottesman [Thu, 15 Aug 2013 19:22:36 +0000 (19:22 +0000)]
[autotools->cmake] Added variable CLANG_VENDOR_UTI.

llvm-svn: 188479

11 years ago[autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY...
Michael Gottesman [Thu, 15 Aug 2013 19:22:33 +0000 (19:22 +0000)]
[autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY_STRING.

This is a patch in a longer series of patches to add
capabilities/definitions that are present in the Autotools build chain
and not in the CMake build chain to the CMake build chain.

*NOTE* I am hacking on this in my free time. I will annotate each commit
with the [autotools->cmake] header.

llvm-svn: 188478

11 years agoAdd rhadd builtin
Aaron Watry [Thu, 15 Aug 2013 19:21:10 +0000 (19:21 +0000)]
Add rhadd builtin

rhadd = (x+y+1)>>1

Implemented as:
(x>>1) + (y>>1) + ((x&1)|(y&1))

This prevents us having to do assembly addition and overflow detection

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188477

11 years agoAdd hadd builtin
Aaron Watry [Thu, 15 Aug 2013 19:21:07 +0000 (19:21 +0000)]
Add hadd builtin

(x + y) >> 1 gets changed to:
(x>>1) + (y>>1) + (x&y&1)

Saves us having to do any llvm assembly and overflow checking in the addition.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188476

11 years agoDebugInfo: remove unnecessary type registration
David Blaikie [Thu, 15 Aug 2013 18:59:44 +0000 (18:59 +0000)]
DebugInfo: remove unnecessary type registration

This happens in the caller a few frames up anyway.

llvm-svn: 188475

11 years agoDebugInfo: Don't create duplicate forward declaration metadata unnecessarily.
David Blaikie [Thu, 15 Aug 2013 18:59:40 +0000 (18:59 +0000)]
DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.

No functionality change, at best a slight (questionable) optimization,
but necessary for correctness of future work.

llvm-svn: 188474

11 years agoFixes a gross conditional in my last patch.
Fariborz Jahanian [Thu, 15 Aug 2013 18:58:00 +0000 (18:58 +0000)]
Fixes a gross conditional in my last patch.
- This line, and those below, will be ignored--

M    lib/ARCMigrate/ObjCMT.cpp

llvm-svn: 188473