platform/upstream/llvm.git
10 years ago[sanitizer] Disable ForEachMappedRegion on Android.
Evgeniy Stepanov [Tue, 30 Jul 2013 08:39:16 +0000 (08:39 +0000)]
[sanitizer] Disable ForEachMappedRegion on Android.

It needs interface that is missing from the NDK, and it is not used on Android anyway.

llvm-svn: 187407

10 years agoFix underscore to be the proper length.
Bill Wendling [Tue, 30 Jul 2013 08:26:24 +0000 (08:26 +0000)]
Fix underscore to be the proper length.

llvm-svn: 187406

10 years agoclang/test/Driver/qa_override.c: Resurrect a part of r187376. It still requires the...
NAKAMURA Takumi [Tue, 30 Jul 2013 07:47:58 +0000 (07:47 +0000)]
clang/test/Driver/qa_override.c: Resurrect a part of r187376. It still requires the feature 'clang-driver' for cygming.

llvm-svn: 187405

10 years ago[ARM] check bitwidth in PerformORCombine
Saleem Abdulrasool [Tue, 30 Jul 2013 04:43:08 +0000 (04:43 +0000)]
[ARM] check bitwidth in PerformORCombine

When simplifying a (or (and B A) (and C ~A)) to a (VBSL A B C) ensure that the
bitwidth of the second operands to both ands match before comparing the negation
of the values.

Split the check of the value of the second operands to the ands.  Move the cast
and variable declaration slightly higher to make it slightly easier to follow.

Bug-Id: 16700
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 187404

10 years agoRemove more dead documentation.
Rafael Espindola [Tue, 30 Jul 2013 04:06:06 +0000 (04:06 +0000)]
Remove more dead documentation.

llvm-svn: 187403

10 years ago[Sparc] Use call's debugloc for the unimp instruction.
Venkatraman Govindaraju [Tue, 30 Jul 2013 02:26:29 +0000 (02:26 +0000)]
[Sparc] Use call's debugloc for the unimp instruction.

llvm-svn: 187402

10 years agoAdded the notion of Type and TargetSpecific attributes to the clang tablegen. In...
Aaron Ballman [Tue, 30 Jul 2013 01:44:15 +0000 (01:44 +0000)]
Added the notion of Type and TargetSpecific attributes to the clang tablegen.  In turn, this fixes a mistake with Ptr32, Ptr64, UPtr and SPtr attribtues generating AST nodes that are never actually used.

llvm-svn: 187401

10 years agoerr_attribute_not_string has been subsumed by err_attribute_argument_type.
Aaron Ballman [Tue, 30 Jul 2013 01:31:03 +0000 (01:31 +0000)]
err_attribute_not_string has been subsumed by err_attribute_argument_type.

llvm-svn: 187400

10 years ago[PowerPC] Skeletal FastISel support for 64-bit PowerPC ELF.
Bill Schmidt [Tue, 30 Jul 2013 00:50:39 +0000 (00:50 +0000)]
[PowerPC] Skeletal FastISel support for 64-bit PowerPC ELF.

This is the first of many upcoming patches for PowerPC fast
instruction selection support.  This patch implements the minimum
necessary for a functional (but extremely limited) FastISel pass.  It
allows the table-generated portions of the selector to be created and
used, but in most cases selection will fall back to the DAG selector.
None of the block terminator instructions are implemented yet, and
most interesting instructions require some special handling.
Therefore there aren't any new test cases with this patch.  There will
be quite a few tests coming with future patches.

This patch adds the make/CMake support for the new code (including
tablegen -gen-fast-isel) and creates the FastISel object for PPC64 ELF
only.  It instantiates the necessary virtual functions
(TargetSelectInstruction, TargetMaterializeConstant,
TargetMaterializeAlloca, tryToFoldLoadIntoMI, and FastLowerArguments),
but of these, only TargetMaterializeConstant contains any useful
implementation.  This is present since the table-generated code
requires the ability to materialize integer constants for some
instructions.

This patch has been tested by building and running the
projects/test-suite code with -O0.  All tests passed with the
exception of a couple of long-running tests that time out using -O0
code generation.

llvm-svn: 187399

10 years agoRefactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using...
Aaron Ballman [Tue, 30 Jul 2013 00:48:57 +0000 (00:48 +0000)]
Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using custom logic.  No functional changes intended.

llvm-svn: 187398

10 years ago[R600] Replicate old DAGCombiner behavior in target specific DAG combine.
Quentin Colombet [Tue, 30 Jul 2013 00:27:16 +0000 (00:27 +0000)]
[R600] Replicate old DAGCombiner behavior in target specific DAG combine.

build_vector is lowered to REG_SEQUENCE, which is something the register
allocator does a good job at optimizing.

llvm-svn: 187397

10 years ago[DAGCombiner] insert_vector_elt: Avoid building a vector twice.
Quentin Colombet [Tue, 30 Jul 2013 00:24:09 +0000 (00:24 +0000)]
[DAGCombiner] insert_vector_elt: Avoid building a vector twice.

This patch prevents the following combine when the input vector is used more
than once.
insert_vector_elt (build_vector elt0, ..., eltN), NewEltIdx, idx
=>
build_vector elt0, ..., NewEltIdx, ..., eltN

The reasons are:
- Building a vector may be expensive, so try to reuse the existing part of a
  vector instead of creating a new one (think big vectors).
- elt0 to eltN now have two users instead of one. This may prevent some other
  optimizations.

llvm-svn: 187396

10 years ago<rdar://problem/14526890>
Greg Clayton [Tue, 30 Jul 2013 00:23:06 +0000 (00:23 +0000)]
<rdar://problem/14526890>

Fixed a crasher when using memory threads where a thread is sticking around too long and was causing problems when it didn't have a thread plan.

llvm-svn: 187395

10 years agoMove file to X86 and add a triple to fix darwin bots for now.
Eric Christopher [Tue, 30 Jul 2013 00:20:06 +0000 (00:20 +0000)]
Move file to X86 and add a triple to fix darwin bots for now.

The problem is due to the section name being explicitly mentioned in
the IR and differing between the two platforms.

llvm-svn: 187394

10 years agoFix a truly egregious thinko in anonymous namespace check,
Eric Christopher [Mon, 29 Jul 2013 23:53:08 +0000 (23:53 +0000)]
Fix a truly egregious thinko in anonymous namespace check,
update testcase to make sure we generate debug info for walrus
by adding a non-trivial constructor and verify that we don't
emit an ODR signature for the type.

llvm-svn: 187393

10 years agoMake sure we don't emit an ODR hash for types with no name and make
Eric Christopher [Mon, 29 Jul 2013 23:53:05 +0000 (23:53 +0000)]
Make sure we don't emit an ODR hash for types with no name and make
sure the comments for each testcase are a bit easier to distinguish.

llvm-svn: 187392

10 years agoClarify comments for types contained in anonymous namespaces and
Eric Christopher [Mon, 29 Jul 2013 23:53:01 +0000 (23:53 +0000)]
Clarify comments for types contained in anonymous namespaces and
odr hashes.

llvm-svn: 187391

10 years ago[PECOFF][Driver] Remove quotes from command line arguments.
Rui Ueyama [Mon, 29 Jul 2013 23:32:22 +0000 (23:32 +0000)]
[PECOFF][Driver] Remove quotes from command line arguments.

The command line option in .drectve section may be quoted by double
quotes, and if that's the case we have to remove them.

llvm-svn: 187390

10 years agoFix TestConcurrentEvents to behave nicely with GCC 4.8
Daniel Malea [Mon, 29 Jul 2013 23:13:08 +0000 (23:13 +0000)]
Fix TestConcurrentEvents to behave nicely with GCC 4.8
- newer gcc generates additional debuginfo for function exit (stack object desctruction) which was causing tests to fail
- work-around consists of not declaring any stack objects in main()

llvm-svn: 187389

10 years ago[PECOFF] Process Import Name/Type field in the import library.
Rui Ueyama [Mon, 29 Jul 2013 22:55:39 +0000 (22:55 +0000)]
[PECOFF] Process Import Name/Type field in the import library.

This patch removes hacky mangle() function, which strips all decorations
uncondtitionally. LLD now interprets Import Name/Type field in the import
library properly as described in the Microsoft PE/COFF Spec.

llvm-svn: 187388

10 years agoRemove assert header dependency in test
David Blaikie [Mon, 29 Jul 2013 22:37:42 +0000 (22:37 +0000)]
Remove assert header dependency in test

llvm-svn: 187387

10 years agoSimplified SourceManager::translateLineCol a bit.
Alexander Kornienko [Mon, 29 Jul 2013 22:26:10 +0000 (22:26 +0000)]
Simplified SourceManager::translateLineCol a bit.

Reviewers: rsmith

Reviewed By: rsmith

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

llvm-svn: 187386

10 years agoElaborate a bit on the type unit and ODR conditional code.
Eric Christopher [Mon, 29 Jul 2013 22:24:32 +0000 (22:24 +0000)]
Elaborate a bit on the type unit and ODR conditional code.

llvm-svn: 187385

10 years agoFixed comment typo.
John Thompson [Mon, 29 Jul 2013 21:59:41 +0000 (21:59 +0000)]
Fixed comment typo.

llvm-svn: 187384

10 years agoMake file_status::getUniqueID const.
Rafael Espindola [Mon, 29 Jul 2013 21:55:38 +0000 (21:55 +0000)]
Make file_status::getUniqueID const.

llvm-svn: 187383

10 years ago[PECOFF] Replace the magic number with sizeof().
Rui Ueyama [Mon, 29 Jul 2013 21:54:43 +0000 (21:54 +0000)]
[PECOFF] Replace the magic number with sizeof().

llvm-svn: 187382

10 years agoFix test failure introduced in r187271 by enabling pipefail.
Rui Ueyama [Mon, 29 Jul 2013 21:50:33 +0000 (21:50 +0000)]
Fix test failure introduced in r187271 by enabling pipefail.

llvm-svn: 187381

10 years agoDelete documentation for deleted options.
Rafael Espindola [Mon, 29 Jul 2013 21:35:48 +0000 (21:35 +0000)]
Delete documentation for deleted options.

llvm-svn: 187380

10 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 29 Jul 2013 21:26:52 +0000 (21:26 +0000)]
Update for llvm api change.

llvm-svn: 187379

10 years agoInclude st_dev to make the result of getUniqueID actually unique.
Rafael Espindola [Mon, 29 Jul 2013 21:26:49 +0000 (21:26 +0000)]
Include st_dev to make the result of getUniqueID actually unique.

This will let us use getUniqueID instead of st_dev directly on clang.

llvm-svn: 187378

10 years agoUse flag instead of rwlock state to track process running state
Ed Maste [Mon, 29 Jul 2013 20:58:06 +0000 (20:58 +0000)]
Use flag instead of rwlock state to track process running state

LLDB requires that the inferior process be stopped before, and remain
stopped during, certain accesses to process state.

Previously this was achieved with a POSIX rwlock which had a write lock
taken for the duration that the process was running, and released when
the process was stopped.  Any access to process state was performed with
a read lock held.

However, POSIX requires that pthread_rwlock_unlock() be called from the
same thread as pthread_rwlock_wrlock(), and lldb needs to stop and start
the process from different threads.  Violating this constraint is
technically undefined behaviour, although as it happens Linux and Darwin
result in the unlock proceeding in this case.  FreeBSD follows POSIX
more strictly, and the unlock would fail, resulting in a hang later upon
the next attempt to take the lock.

All read lock consumers use ReadTryLock() and handle failure to obtain
the lock (typically by logging an error "process is running").  Thus,
instead of using the lock state itself to track the running state, this
change adds an explicit m_running flag.  ReadTryLock tests the flag, and
if the process is not running it returns with the read lock held.

WriteLock and WriteTryLock are renamed to SetRunning and TrySetRunning,
and (if successful) they set m_running with the lock held.  This way,
read consumers can determine if the process is running and act
appropriately, and write consumers are still held off from starting the
process if read consumers are active.

Note that with this change there are still some curious access patterns,
such as calling WriteUnlock / SetStopped twice in a row, and there's no
protection from multiple threads trying to simultaneously start the
process.  In practice this does not seem to be a problem, and was
exposing other undefined POSIX behaviour prior to this change.

llvm-svn: 187377

10 years agoMake this test not try to write on object file and test all of the
Chandler Carruth [Mon, 29 Jul 2013 20:29:53 +0000 (20:29 +0000)]
Make this test not try to write on object file and test all of the
output rather than just part of it.

Also, remove the frighteningly ancient comment about not working with
the gcc-driver. (!!!)

llvm-svn: 187376

10 years agoDebug Info: enable verifier for testing cases.
Manman Ren [Mon, 29 Jul 2013 20:18:19 +0000 (20:18 +0000)]
Debug Info: enable verifier for testing cases.

llvm-svn: 187375

10 years agoPR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if
Richard Smith [Mon, 29 Jul 2013 20:14:16 +0000 (20:14 +0000)]
PR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if
corresponding 'operator new' was actually emitted as a function marked 'nobuiltin'.

llvm-svn: 187374

10 years agoFix warning.
Peter Collingbourne [Mon, 29 Jul 2013 20:13:41 +0000 (20:13 +0000)]
Fix warning.

llvm-svn: 187373

10 years agoMove UnpoisonMappedDSO to sanitizer_common.
Peter Collingbourne [Mon, 29 Jul 2013 19:09:49 +0000 (19:09 +0000)]
Move UnpoisonMappedDSO to sanitizer_common.

This is so DFSan will be able to use it.

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

llvm-svn: 187372

10 years ago[mips] Add comment and simplify function.
Akira Hatanaka [Mon, 29 Jul 2013 19:08:34 +0000 (19:08 +0000)]
[mips] Add comment and simplify function.

llvm-svn: 187371

10 years agoFixed comment issues (non-ASCII chars, typos) per review, expanded some comments.
John Thompson [Mon, 29 Jul 2013 19:07:00 +0000 (19:07 +0000)]
Fixed comment issues (non-ASCII chars, typos) per review, expanded some comments.

llvm-svn: 187370

10 years agoDebug mode for unordered_multiset. The exercise spotted a few places I had missed...
Howard Hinnant [Mon, 29 Jul 2013 19:05:47 +0000 (19:05 +0000)]
Debug mode for unordered_multiset.  The exercise spotted a few places I had missed on unordered_set, so I picked those up as well.

There are actually two debug modes:

   1.  -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1
       This is a relatively expensive debug mode, but very thorough.  This is normally what you want to debug with, but may turn O(1) operations into O(N) operations.

   2.  -D_LIBCPP_DEBUG2=0
       This is "debug lite."  Only preconditions that can be checked with O(1) expense are checked.  For example range checking on an indexing operation.  But not iterator validity.

llvm-svn: 187369

10 years agoAdd the C source code to the test to make it easier to update when debug info changes.
Nadav Rotem [Mon, 29 Jul 2013 18:47:36 +0000 (18:47 +0000)]
Add the C source code to the test to make it easier to update when debug info changes.
Thanks Eric.

llvm-svn: 187368

10 years agoConvert a use of status with llvm::sys::fs::getUniqueID.
Rafael Espindola [Mon, 29 Jul 2013 18:43:40 +0000 (18:43 +0000)]
Convert a use of status with llvm::sys::fs::getUniqueID.

llvm-svn: 187367

10 years agotest/Driver/cl.c, remove quotes around /help
Hans Wennborg [Mon, 29 Jul 2013 18:40:38 +0000 (18:40 +0000)]
test/Driver/cl.c, remove quotes around /help

The quotes (from r187330) didn't really help here, the trick was to disable
the test on MSYS builds. This removes those quotes, changes back the comment
to explain why /? has to be quoted specifically, and moves the REQUIRES
line to the top of the file because that's important.

llvm-svn: 187366

10 years agoSupport for Thread Safety Analysis in C
David Blaikie [Mon, 29 Jul 2013 18:24:03 +0000 (18:24 +0000)]
Support for Thread Safety Analysis in C

Patch by Ethan Jackson.

llvm-svn: 187365

10 years agoConvert a use of stat with sys::fs::status.
Rafael Espindola [Mon, 29 Jul 2013 18:22:23 +0000 (18:22 +0000)]
Convert a use of stat with sys::fs::status.

llvm-svn: 187364

10 years agoSLPVectorier: update the debug location for the new instructions.
Nadav Rotem [Mon, 29 Jul 2013 18:18:46 +0000 (18:18 +0000)]
SLPVectorier: update the debug location for the new instructions.

llvm-svn: 187363

10 years agoDebug Info: update testing cases to pass verifier.
Manman Ren [Mon, 29 Jul 2013 18:12:58 +0000 (18:12 +0000)]
Debug Info: update testing cases to pass verifier.

llvm-svn: 187362

10 years agoAdds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressions
Ashok Thirumurthi [Mon, 29 Jul 2013 16:05:11 +0000 (16:05 +0000)]
Adds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressions
in LLDB that load the canonical frame address rather than a location list.

- Handles the simple case where a CFA can be pulled from the current stack frame.
- Fixes more than one hundred failing tests with gcc 4.8!

TODO: Use UnwindPlan::GetRowForFunctionOffset if the DWARFExpression needs
to be evaluated in a context analogous to a virtual unwind (perhaps using RegisterContextLLDB).

- Also adds some comments to DWARFCallFrameInfo whenever I got confused.

llvm-svn: 187361

10 years agocpp11-migrate: Add -for-compilers command line switch.
Guillaume Papin [Mon, 29 Jul 2013 15:58:47 +0000 (15:58 +0000)]
cpp11-migrate: Add -for-compilers command line switch.

This change add a new option command line option -for-compilers that allows the
user to enable multiple transforms automatically.

Another difference is that now all transforms are enabled by default.

llvm-svn: 187360

10 years agoFix handling of "clang c:foo"
Rafael Espindola [Mon, 29 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Fix handling of "clang c:foo"

On windows, c:foo is a valid file path, but stat fails on just "c:". This
causes a problem for clang since its file manager wants to cache data about
the parent directory.

There are refactorings to be done in here, but this gives clang the correct
behavior and testing first.

Patch by Yunzhong Gao!

llvm-svn: 187359

10 years agoAdd operator new[] to test. Partial fix for valgrind warning in http://llvm.org...
Howard Hinnant [Mon, 29 Jul 2013 14:43:42 +0000 (14:43 +0000)]
Add operator new[] to test.  Partial fix for valgrind warning in llvm.org/bugs/show_bug.cgi?id=16703.

llvm-svn: 187358

10 years agoImplement N3421; comparison predicates<void>
Marshall Clow [Mon, 29 Jul 2013 14:21:53 +0000 (14:21 +0000)]
Implement N3421; comparison predicates<void>

llvm-svn: 187357

10 years agoUse proper section suffix for COFF weak symbols
Nico Rieck [Mon, 29 Jul 2013 13:58:39 +0000 (13:58 +0000)]
Use proper section suffix for COFF weak symbols

32-bit symbols have "_" as global prefix, but when forming the name of
COMDAT sections this prefix is ignored. The current behavior assumes that
this prefix is always present which is not the case for 64-bit and names
are truncated.

llvm-svn: 187356

10 years agoProper va_arg/va_copy lowering on win64
Nico Rieck [Mon, 29 Jul 2013 13:07:06 +0000 (13:07 +0000)]
Proper va_arg/va_copy lowering on win64

Win64 uses CharPtrBuiltinVaList instead of X86_64ABIBuiltinVaList like
other 64-bit targets.

llvm-svn: 187355

10 years agoRe-application of 187310. Re-enabling warning C4275 for MSVC 11 and up, but not...
Aaron Ballman [Mon, 29 Jul 2013 13:02:08 +0000 (13:02 +0000)]
Re-application of 187310.  Re-enabling warning C4275 for MSVC 11 and up, but not MSVC 10 since it is still required there.

llvm-svn: 187354

10 years agoAdd support for the 's' operation to llvm-ar.
Rafael Espindola [Mon, 29 Jul 2013 12:40:31 +0000 (12:40 +0000)]
Add support for the 's' operation to llvm-ar.

If no other operation is specified, 's' becomes an operation instead of an
modifier. The s operation just creates a symbol table. It is the same as
running ranlib.

We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and
if the symbol table is present, then it is current. We use that to optimize
the most common case: a broken build system that thinks it has to run ranlib.

llvm-svn: 187353

10 years agoMC: Support larger COFF string tables
Nico Rieck [Mon, 29 Jul 2013 12:30:12 +0000 (12:30 +0000)]
MC: Support larger COFF string tables

Single-slash encoded entries do not require a terminating null. This bumps
the maximum table size from ~1MB to ~9.5MB.

llvm-svn: 187352

10 years agoExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]
NAKAMURA Takumi [Mon, 29 Jul 2013 11:03:50 +0000 (11:03 +0000)]
ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]

llvm-svn: 187351

10 years agoSome Intel Penryn CPUs come with SSE4 disabled. Detect them as core 2.
Benjamin Kramer [Mon, 29 Jul 2013 11:02:08 +0000 (11:02 +0000)]
Some Intel Penryn CPUs come with SSE4 disabled. Detect them as core 2.

PR16721.

llvm-svn: 187350

10 years agoAllow generation of vmla.f32 instructions when targeting Cortex-A15. The patch also...
Silviu Baranga [Mon, 29 Jul 2013 09:25:50 +0000 (09:25 +0000)]
Allow generation of vmla.f32 instructions when targeting Cortex-A15. The patch also adds the VFP4 feature to Cortex-A15 and fixes the DontUseFusedMAC predicate so that we can still generate vmla.f32 instructions on non-darwin targets with VFP4.

llvm-svn: 187349

10 years agotest commit
Robert Lytton [Mon, 29 Jul 2013 09:23:13 +0000 (09:23 +0000)]
test commit

llvm-svn: 187348

10 years agoTeach the AllocaPromoter which is wrapped around the SSAUpdater
Chandler Carruth [Mon, 29 Jul 2013 09:06:53 +0000 (09:06 +0000)]
Teach the AllocaPromoter which is wrapped around the SSAUpdater
infrastructure to do promotion without a domtree the same smarts about
looking through GEPs, bitcasts, etc., that I just taught mem2reg about.
This way, if SROA chooses to promote an alloca which still has some
noisy instructions this code can cope with them.

I've not used as principled of an approach here for two reasons:
1) This code doesn't really need it as we were already set up to zip
   through the instructions used by the alloca.
2) I view the code here as more of a hack, and hopefully a temporary one.

The SSAUpdater path in SROA is a real sore point for me. It doesn't make
a lot of architectural sense for many reasons:
- We're likely to end up needing the domtree anyways in a subsequent
  pass, so why not compute it earlier and use it.
- In the future we'll likely end up needing the domtree for parts of the
  inliner itself.
- If we need to we could teach the inliner to preserve the domtree. Part
  of the re-work of the pass manager will allow this to be very powerful
  even in large SCCs with many functions.
- Ultimately, computing a domtree has gotten significantly faster since
  the original SSAUpdater-using code went into ScalarRepl. We no longer
  use domfrontiers, and much of domtree is lazily done based on queries
  rather than eagerly.
- At this point keeping the SSAUpdater-based promotion saves a total of
  0.7% on a build of the 'opt' tool for me. That's not a lot of
  performance given the complexity!

So I'm leaving this a bit ugly in the hope that eventually we just
remove all of this nonsense.

I can't even readily test this because this code isn't reachable except
through SROA. When I re-instate the patch that fast-tracks allocas
already suitable for promotion, I'll add a testcase there that failed
before this change. Before that, SROA will fix any test case I give it.

llvm-svn: 187347

10 years agoFix build error caused by r187345.
Daniel Jasper [Mon, 29 Jul 2013 08:43:57 +0000 (08:43 +0000)]
Fix build error caused by r187345.

llvm-svn: 187346

10 years agoInitial architecture for clang-tidy.
Daniel Jasper [Mon, 29 Jul 2013 08:19:24 +0000 (08:19 +0000)]
Initial architecture for clang-tidy.

This is the first version of a possible clang-tidy architecture. The
purpose of clang-tidy is to detect errors in adhering to common coding
patterns, e.g. described in the LLVM Coding Standards.

This is still heavily in flux.

Review: http://llvm-reviews.chandlerc.com/D884
llvm-svn: 187345

10 years agoReturn ExprError if both arguments to the mask form of __builtin_shufflvector don...
Craig Topper [Mon, 29 Jul 2013 06:47:04 +0000 (06:47 +0000)]
Return ExprError if both arguments to the mask form of __builtin_shufflvector don't have the same number of elements or the mask isn't an integer vector.

Previously a diagnostic was issued, but the code went ahead and built the ShuffleVectorExpr. While I'm here also simplify a couple lines by wrapping the return ExprError around the Diag calls.

llvm-svn: 187344

10 years agoRemove '-debug-only' from test case
Tobias Grosser [Mon, 29 Jul 2013 05:35:11 +0000 (05:35 +0000)]
Remove '-debug-only' from test case

This flags was not used in the test case, but caused failures when LLVM was
built without debugging. We can savely remove it.

llvm-svn: 187343

10 years agoTempScop: Actually load Polly in this test case
Tobias Grosser [Mon, 29 Jul 2013 05:18:09 +0000 (05:18 +0000)]
TempScop: Actually load Polly in this test case

llvm-svn: 187342

10 years agoRemove second '-analyze' from command line
Tobias Grosser [Mon, 29 Jul 2013 05:15:33 +0000 (05:15 +0000)]
Remove second '-analyze' from command line

llvm-svn: 187341

10 years agoDon't vectorize when the attribute NoImplicitFloat is used.
Nadav Rotem [Mon, 29 Jul 2013 05:13:00 +0000 (05:13 +0000)]
Don't vectorize when the attribute NoImplicitFloat is used.

llvm-svn: 187340

10 years agoJSONImporter: Free new schedule if found invalid
Tobias Grosser [Mon, 29 Jul 2013 05:12:01 +0000 (05:12 +0000)]
JSONImporter: Free new schedule if found invalid

In case we detect that the schedule the user wants to import is invalid we
refuse it _and_ free the isl_maps containing it.

Another bug found thanks to Rafael.

llvm-svn: 187339

10 years agoCodeGeneration: Fix double free in vector for
Tobias Grosser [Mon, 29 Jul 2013 01:58:07 +0000 (01:58 +0000)]
CodeGeneration: Fix double free in vector for

We now use __isl_take to annotate the uses of the isl_set where we got the
memory management wrong.

Thanks to Rafael! His pipefail work hardened our test environment and exposed
this bug nicely.

llvm-svn: 187338

10 years agoclang/test/Driver/cl.c: Don't attempt slash switches on msys bash.
NAKAMURA Takumi [Mon, 29 Jul 2013 01:37:10 +0000 (01:37 +0000)]
clang/test/Driver/cl.c: Don't attempt slash switches on msys bash.

llvm-svn: 187337

10 years agoFix -Wdocumentation warnings.
Rafael Espindola [Sun, 28 Jul 2013 23:43:28 +0000 (23:43 +0000)]
Fix -Wdocumentation warnings.

llvm-svn: 187336

10 years agoUpdate comments for SSAUpdater to use the modern doxygen comment
Chandler Carruth [Sun, 28 Jul 2013 22:00:33 +0000 (22:00 +0000)]
Update comments for SSAUpdater to use the modern doxygen comment
standards for LLVM. Remove duplicated comments on the interface from the
implementation file (implementation comments are left there of course).
Also clean up, re-word, and fix a few typos and errors in the commenst
spotted along the way.

This is in preparation for changes to these files and to keep the
uninteresting tidying in a separate commit.

llvm-svn: 187335

10 years agoFix up formatting. No functional change.
Craig Topper [Sun, 28 Jul 2013 21:50:10 +0000 (21:50 +0000)]
Fix up formatting. No functional change.

llvm-svn: 187334

10 years agoRemove use of sprintf added to X86 disassembler tablegen code. Send message with...
Craig Topper [Sun, 28 Jul 2013 21:28:02 +0000 (21:28 +0000)]
Remove use of sprintf added to X86 disassembler tablegen code. Send message with instruction name to errs() instead and use a generic message for the llvm_unreachable. Consistent with other places in this file.

llvm-svn: 187333

10 years agoGlen: Minor tweaks to locale.cpp to help it compile with exceptions turned off.
Howard Hinnant [Sun, 28 Jul 2013 18:20:00 +0000 (18:20 +0000)]
Glen: Minor tweaks to locale.cpp to help it compile with exceptions turned off.

llvm-svn: 187332

10 years agoPartial revert of 187310; it seems MSVC 10 still spits out this warning, but MSVC...
Aaron Ballman [Sun, 28 Jul 2013 18:04:26 +0000 (18:04 +0000)]
Partial revert of 187310; it seems MSVC 10 still spits out this warning, but MSVC 11 does not.

llvm-svn: 187331

10 years agoTry single quotes to fix the msys bot:
Rafael Espindola [Sun, 28 Jul 2013 17:13:24 +0000 (17:13 +0000)]
Try single quotes to fix the msys bot:

It was still failing with double quotes:

http://bb.pgr.jp/builders/clang-i686-msys/builds/698/steps/test_clang/logs/Clang%20%3A%3A%20Driver__cl.c

llvm-svn: 187330

10 years agoAvoid crashing if a directory has no pch files.
Rafael Espindola [Sun, 28 Jul 2013 13:23:37 +0000 (13:23 +0000)]
Avoid crashing if a directory has no pch files.

Should fix some of the bots that have assertions disabled.

llvm-svn: 187329

10 years agoUse a slightly smaller hammer to make this pass.
Rafael Espindola [Sun, 28 Jul 2013 11:13:49 +0000 (11:13 +0000)]
Use a slightly smaller hammer to make this pass.

When first updating this test I only noticided the first RUN line.

llvm-svn: 187328

10 years agoTemporarily revert r187323 until I update SSAUpdater to match mem2reg.
Chandler Carruth [Sun, 28 Jul 2013 09:05:49 +0000 (09:05 +0000)]
Temporarily revert r187323 until I update SSAUpdater to match mem2reg.
I forgot that we had two totally independent things here. :: sigh ::

llvm-svn: 187327

10 years agogitattributes: .png and .txt are no text files
Tobias Grosser [Sun, 28 Jul 2013 09:05:20 +0000 (09:05 +0000)]
gitattributes: .png and .txt are no text files

llvm-svn: 187326

10 years agofixed compilation issue
Elena Demikhovsky [Sun, 28 Jul 2013 08:45:12 +0000 (08:45 +0000)]
fixed compilation issue

llvm-svn: 187325

10 years agoAdded encoding prefixes for KNL instructions (EVEX).
Elena Demikhovsky [Sun, 28 Jul 2013 08:28:38 +0000 (08:28 +0000)]
Added encoding prefixes for KNL instructions (EVEX).
Added 512-bit operands printing.
Added instruction formats for KNL instructions.

llvm-svn: 187324

10 years agoNow that mem2reg understands how to cope with a slightly wider set of
Chandler Carruth [Sun, 28 Jul 2013 08:27:12 +0000 (08:27 +0000)]
Now that mem2reg understands how to cope with a slightly wider set of
uses of an alloca, we can pre-compute promotability while analyzing an
alloca for splitting in SROA. That lets us short-circuit the common case
of a bunch of trivially promotable allocas. This cuts 20% to 30% off the
run time of SROA for typical frontend-generated IR sequneces I'm seeing.
It gets the new SROA to within 20% of ScalarRepl for such code. My
current benchmark for these numbers is PR15412, but it fits the general
pattern of IR emitted by Clang so it should be widely applicable.

llvm-svn: 187323

10 years agoThread DataLayout through the callers and into mem2reg. This will be
Chandler Carruth [Sun, 28 Jul 2013 06:43:11 +0000 (06:43 +0000)]
Thread DataLayout through the callers and into mem2reg. This will be
useful in a subsequent patch, but causes an unfortunate amount of noise,
so I pulled it out into a separate patch.

llvm-svn: 187322

10 years ago[PECOFF] Simplicy FileCOFF ctor. No functionality change.
Rui Ueyama [Sun, 28 Jul 2013 04:29:30 +0000 (04:29 +0000)]
[PECOFF] Simplicy FileCOFF ctor. No functionality change.

Member functions to read the symbol table had too many parameters to propagate
all the temporary information from one to another. By storing the information
to data members, we can simplify the function signatures and improve the
readability.

llvm-svn: 187321

10 years ago[PowerPC] Add comment explaining preprocessor directive.
Bill Schmidt [Sun, 28 Jul 2013 03:23:32 +0000 (03:23 +0000)]
[PowerPC] Add comment explaining preprocessor directive.

llvm-svn: 187320

10 years agoRevert 187318
Bill Schmidt [Sun, 28 Jul 2013 02:13:24 +0000 (02:13 +0000)]
Revert 187318

llvm-svn: 187319

10 years ago[PowerPC] Remove unnecessary preprocessor checking.
Bill Schmidt [Sun, 28 Jul 2013 02:08:13 +0000 (02:08 +0000)]
[PowerPC] Remove unnecessary preprocessor checking.

The tests !defined(__ppc__) && !defined(__powerpc__) are not needed
or helpful when verifying that code is being compiled for a 64-bit
target.  The simpler test provided by this revision is sufficient to
tell if the target is 64-bit.

llvm-svn: 187318

10 years agoRemoved unnecessary parameter.
Rui Ueyama [Sun, 28 Jul 2013 01:50:24 +0000 (01:50 +0000)]
Removed unnecessary parameter.

llvm-svn: 187317

10 years agoUpdate the comment
Nadav Rotem [Sat, 27 Jul 2013 23:28:47 +0000 (23:28 +0000)]
Update the comment

llvm-svn: 187316

10 years agoReduce stack frame size by avoiding a large token vector on an error path.
Bob Wilson [Sat, 27 Jul 2013 21:59:57 +0000 (21:59 +0000)]
Reduce stack frame size by avoiding a large token vector on an error path.

Beginning with svn r186971, we noticed an internal test started to fail when
using clang built with LTO. After much investigation, it turns out that there
are no blatant bugs here, we are just running out of stack space and crashing.
Preprocessor::ReadFunctionLikeMacroArgs already has one vector of 64 Tokens,
and r186971 added another.  When built with LTO, that function is inlined into
Preprocessor::HandleMacroExpandedIdentifier, which for our internal test is
invoked in a deep recursive cycle. I'm leaving the original 64 Token vector
alone on the assumption that it is important for performance, but the new
FixedArgTokens vector is only used on an error path, so it should be OK if it
requires additional heap storage. It would be even better if we could avoid
the deep recursion, but I think this change is a good thing to do regardless.
<rdar://problem/14540345>

llvm-svn: 187315

10 years ago[APFloat] Make all arithmetic operations with NaN produce positive NaNs.
Michael Gottesman [Sat, 27 Jul 2013 21:49:25 +0000 (21:49 +0000)]
[APFloat] Make all arithmetic operations with NaN produce positive NaNs.

IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
interpretation of the sign of NaNs. In order to remove an irrelevant
variable that most floating point implementations do not use,
standardize add, sub, mul, div, mod so that operating anything with
NaN always yields a positive NaN.

In a later commit I am going to update the APIs for creating NaNs so
that one can not even create a negative NaN.

llvm-svn: 187314

10 years ago[APFloat] Move setting fcNormal in zeroSignificand() to calling code.
Michael Gottesman [Sat, 27 Jul 2013 21:49:21 +0000 (21:49 +0000)]
[APFloat] Move setting fcNormal in zeroSignificand() to calling code.

Zeroing the significand of a floating point number does not necessarily cause a
floating point number to become finite non zero. For instance, if one has a NaN,
zeroing the significand will cause it to become +/- infinity.

llvm-svn: 187313

10 years ago[APFloat] Removed nextafter from missing operations since it is implemented in APFloa...
Michael Gottesman [Sat, 27 Jul 2013 21:49:19 +0000 (21:49 +0000)]
[APFloat] Removed nextafter from missing operations since it is implemented in APFloat::next.

llvm-svn: 187312

10 years agoRe-enabling some more MSVC warnings; all of these compile cleanly with no further...
Aaron Ballman [Sat, 27 Jul 2013 20:20:28 +0000 (20:20 +0000)]
Re-enabling some more MSVC warnings; all of these compile cleanly with no further changes required.

llvm-svn: 187310

10 years agoMinor code simplification suggested by Duncan
Matt Arsenault [Sat, 27 Jul 2013 19:22:28 +0000 (19:22 +0000)]
Minor code simplification suggested by Duncan

llvm-svn: 187309

10 years agomodularize: Remove default case from fully covered switch.
Benjamin Kramer [Sat, 27 Jul 2013 15:57:46 +0000 (15:57 +0000)]
modularize: Remove default case from fully covered switch.

llvm-svn: 187306

10 years agoTemporary disable a test until I finished the fix
Tobias Grosser [Sat, 27 Jul 2013 15:19:57 +0000 (15:19 +0000)]
Temporary disable a test until I finished the fix

llvm-svn: 187305