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

11 years agoDataFlowSanitizer: Add a debugging feature to help us track nonzero labels.
Peter Collingbourne [Thu, 15 Aug 2013 18:51:12 +0000 (18:51 +0000)]
DataFlowSanitizer: Add a debugging feature to help us track nonzero labels.

Summary:
When the -dfsan-debug-nonzero-labels parameter is supplied, the code
is instrumented such that when a call parameter, return value or load
produces a nonzero label, the function __dfsan_nonzero_label is called.
The idea is that a debugger breakpoint can be set on this function
in a nominally label-free program to help identify any bugs in the
instrumentation pass causing labels to be introduced.

Reviewers: eugenis

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

llvm-svn: 188472

11 years ago[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.
Peter Collingbourne [Thu, 15 Aug 2013 18:51:07 +0000 (18:51 +0000)]
[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.

Reviewers: eugenis

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

llvm-svn: 188471

11 years agoObjectiveC migrator: In deciding NS_OPTION over
Fariborz Jahanian [Thu, 15 Aug 2013 18:46:37 +0000 (18:46 +0000)]
ObjectiveC migrator: In deciding NS_OPTION over
NS_ENUM, at least one power of 2 enumerator
must be greater than two.

llvm-svn: 188470

11 years agoConstify the function parameters.
Bill Wendling [Thu, 15 Aug 2013 18:46:14 +0000 (18:46 +0000)]
Constify the function parameters.

llvm-svn: 188469

11 years ago[analyzer] If realloc fails on an escaped region, that region doesn't leak.
Jordan Rose [Thu, 15 Aug 2013 17:22:06 +0000 (17:22 +0000)]
[analyzer] If realloc fails on an escaped region, that region doesn't leak.

When a region is realloc()ed, MallocChecker records whether it was known
to be allocated or not. If it is, and the reallocation fails, the original
region has to be freed. Previously, when an allocated region escaped,
MallocChecker completely stopped tracking it, so a failed reallocation
still (correctly) wouldn't require freeing the original region. Recently,
however, MallocChecker started tracking escaped symbols, so that if it were
freed we could check that the deallocator matched the allocator. This
broke the reallocation model for whether or not a symbol was allocated.

Now, MallocChecker will actually check if a symbol is owned, and only
require freeing after a failed reallocation if it was owned before.

PR16730

llvm-svn: 188468

11 years agoDrive-by fix for a doxygen comment in MachineInstr.h.
Joey Gouly [Thu, 15 Aug 2013 16:02:44 +0000 (16:02 +0000)]
Drive-by fix for a doxygen comment in MachineInstr.h.

llvm-svn: 188467

11 years agoThis fixes three issues related to Thumb literal loads:
Mihai Popa [Thu, 15 Aug 2013 15:43:06 +0000 (15:43 +0000)]
This fixes three issues related to Thumb literal loads:

1. The offset range for Thumb1 PC relative loads is [0..1020] and not [-1024..1020]
2. Thumb2 PC relative loads may define the PC, so the restriction placed on target register is removed
3. Removes unneeded alias between "ldr.n" and t1LDRpci. ".n" is actually stripped by both tablegen
and the ASM parser, so this alias rule really does nothing

llvm-svn: 188466

11 years agoThread safety analysis: move warnings within lock/unlock functions out of beta.
DeLesley Hutchins [Thu, 15 Aug 2013 15:31:25 +0000 (15:31 +0000)]
Thread safety analysis: move warnings within lock/unlock functions out of beta.

llvm-svn: 188465

11 years ago[Mips][msa] Add support for half
Jack Carter [Thu, 15 Aug 2013 15:16:57 +0000 (15:16 +0000)]
[Mips][msa] Add support for half

Add support for half (a.k.a. __fp16) in builtin descriptions.
The second argument to BUILTIN() now accepts 'h' to represent half.

Patch by Daniel Sanders

llvm-svn: 188464

11 years agoBuild unwind tables by default on NetBSD.
Joerg Sonnenberger [Thu, 15 Aug 2013 15:08:33 +0000 (15:08 +0000)]
Build unwind tables by default on NetBSD.

llvm-svn: 188463

11 years agoUse the integrated assembler on NetBSD/powerpc by default.
Joerg Sonnenberger [Thu, 15 Aug 2013 15:04:56 +0000 (15:04 +0000)]
Use the integrated assembler on NetBSD/powerpc by default.

llvm-svn: 188462

11 years ago[Mips][msa] Added most builtins from add.a to xori
Jack Carter [Thu, 15 Aug 2013 14:47:02 +0000 (14:47 +0000)]
[Mips][msa] Added most builtins from add.a to xori

Includes:
add.a, adds_a, adds_s, adds_u, addv, addvi, andi.b, asub_[su], ave_[su],
aver_[su], bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bset,
bseti, c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw],
div_[su], dotp_[su], dpadd_[su], dpsub_[su], fadd, fceq, fclass, fcl[et], fcne,
fdiv, fexp2, ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, fseq, fsle, fslt, fsne, fsqr, fsub, ftint_[su],
ftq, ilvev, ilvl, ilvod, ilvr, ldi, frcp, frsqrt, madd_q, maddr_q, maddv,
max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su], msub_q, msubr_q, msubv,
mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev, pckod, pcnt, sat_[su], shf,
sld, sldi, sll, slli, splat, splati, sr[al], sr[al]i, subs_[su], subv, subvi,
xori

Patch by Daniel Sanders

llvm-svn: 188461

11 years ago[Mips][msa] Added the simple builtins (madd_q to xori)
Jack Carter [Thu, 15 Aug 2013 14:22:07 +0000 (14:22 +0000)]
[Mips][msa] Added the simple builtins (madd_q to xori)

Includes:
madd_q, maddr_q, maddv, max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su],
msub_q, msubr_q, msubv, mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev,
pckod, pcnt, sat_[su], shf, sld, sldi, sll, slli, splat, splati, sr[al],
sr[al]i, subs_[su], subss_u, subus_s, subv, subvi, vshf, xori

Patch by Daniel Sanders

llvm-svn: 188460

11 years agoUpdate sanitizer attribute documentation to match behaviour change in r187967.
Evgeniy Stepanov [Thu, 15 Aug 2013 13:57:11 +0000 (13:57 +0000)]
Update sanitizer attribute documentation to match behaviour change in r187967.

llvm-svn: 188459

11 years ago[Mips][msa] Added the simple builtins (fadd to ftq)
Jack Carter [Thu, 15 Aug 2013 13:45:36 +0000 (13:45 +0000)]
[Mips][msa] Added the simple builtins (fadd to ftq)

Includes:
fadd, fceq, fcg[et], fclass, fcl[et], fcne, fcun, fdiv, fexdo, fexp2,
fexup[lr], ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, frcp, frsqrt, fseq, fsge, fsgt, fsle, fslt,
fsne, fsqr, fsub, ftint_s, ftq

Patch by Daniel Sanders

llvm-svn: 188458

11 years ago[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)
Jack Carter [Thu, 15 Aug 2013 12:24:57 +0000 (12:24 +0000)]
[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)

Includes:
add_a, adds_[asu], addv, addvi, andi.b, asub_[su].[bhwd], aver?_[su]_[bhwd],
bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bseli, bset, bseti,
c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw], div_[su],
dotp_[su], dpadd_[su], dpsub_[su], ilvev, ilvl, ilvod, ilvr, insv, insve,
ldi

Patch by Daniel Sanders

llvm-svn: 188457

11 years agoFix the build failure of Realease version
Hao Liu [Thu, 15 Aug 2013 11:38:54 +0000 (11:38 +0000)]
Fix the build failure of Realease version

llvm-svn: 188456

11 years ago[sanitizer] Add missing include.
Evgeniy Stepanov [Thu, 15 Aug 2013 10:20:30 +0000 (10:20 +0000)]
[sanitizer] Add missing include.

llvm-svn: 188455

11 years agoRevert r188449 as it turns out we're just missing the instructions that need the...
Craig Topper [Thu, 15 Aug 2013 08:38:25 +0000 (08:38 +0000)]
Revert r188449 as it turns out we're just missing the instructions that need the v16i32/v16f32 matching.

llvm-svn: 188454

11 years agoAdd back a test that was removed in r188450
David Majnemer [Thu, 15 Aug 2013 08:34:07 +0000 (08:34 +0000)]
Add back a test that was removed in r188450

llvm-svn: 188453

11 years agoClang and AArch64 backend patches to support shll/shl and vmovl instructions and...
Hao Liu [Thu, 15 Aug 2013 08:26:30 +0000 (08:26 +0000)]
Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions

llvm-svn: 188452

11 years agoClang and AArch64 backend patches to support shll/shl and vmovl instructions and...
Hao Liu [Thu, 15 Aug 2013 08:26:11 +0000 (08:26 +0000)]
Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions

llvm-svn: 188451

11 years ago[-cxx-abi microsoft] Mangle member pointers better
David Majnemer [Thu, 15 Aug 2013 08:13:23 +0000 (08:13 +0000)]
[-cxx-abi microsoft] Mangle member pointers better

Summary:
There were several things going wrong:
- We mangled in useless qualifiers like "volatile void" return types.
- We didn't propagate 64-bit pointer markers sufficiently.
- We mangled qualifiers belonging to the pointee incorrectly.

This fixes PR16844 and PR16848.

Reviewers: rnk, whunt

Reviewed By: rnk

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

llvm-svn: 188450

11 years agoDon't let isPermImmMask handle v16i32 since VPERMI doesn't match on that type. Remove...
Craig Topper [Thu, 15 Aug 2013 07:30:51 +0000 (07:30 +0000)]
Don't let isPermImmMask handle v16i32 since VPERMI doesn't match on that type. Remove 128-bit vector handling from isPermImmMask too, it's covered by isPSHUFDMask.

llvm-svn: 188449

11 years agoTentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer
Alexey Samsonov [Thu, 15 Aug 2013 07:11:34 +0000 (07:11 +0000)]
Tentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer

llvm-svn: 188448

11 years agoCHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
Stephen Lin [Thu, 15 Aug 2013 06:47:53 +0000 (06:47 +0000)]
CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.

llvm-svn: 188447

11 years agoUse MVT instead of EVT in X86ISelDAGToDAG since all the types should be legal.
Craig Topper [Thu, 15 Aug 2013 05:57:07 +0000 (05:57 +0000)]
Use MVT instead of EVT in X86ISelDAGToDAG since all the types should be legal.

llvm-svn: 188446

11 years agoUse MVT in place of EVT in more X86 operation lowering functions.
Craig Topper [Thu, 15 Aug 2013 05:33:45 +0000 (05:33 +0000)]
Use MVT in place of EVT in more X86 operation lowering functions.

llvm-svn: 188445

11 years agoFixed typo in CMakeLists.txt.
Michael Gottesman [Thu, 15 Aug 2013 04:16:12 +0000 (04:16 +0000)]
Fixed typo in CMakeLists.txt.

We were marking both LLVMBUILDOUTPUT and LLVMBUILDERRORS as
ERROR_VARIABLES when clearly LLVMBUILDOUTPUT should be marked as
OUTPUT_VARIABLE.

llvm-svn: 188444

11 years agoA new test case which adds a dSYM to an executable mid-debug session
Jason Molenda [Thu, 15 Aug 2013 02:49:16 +0000 (02:49 +0000)]
A new test case which adds a dSYM to an executable mid-debug session
where the executable has been slid.  This detects the regression fixed in
r188289.

llvm-svn: 188443

11 years agoReplace getValueType().getSimpleVT() with getSimpleValueType().
Craig Topper [Thu, 15 Aug 2013 02:44:19 +0000 (02:44 +0000)]
Replace getValueType().getSimpleVT() with getSimpleValueType().

llvm-svn: 188442

11 years agoReplace getValueType().getSimpleVT() with getSimpleValueType(). Also remove one weird...
Craig Topper [Thu, 15 Aug 2013 02:33:50 +0000 (02:33 +0000)]
Replace getValueType().getSimpleVT() with getSimpleValueType(). Also remove one weird cast from MVT->EVT just to call getSimpleVT().

llvm-svn: 188441