Commit Graph

198303 Commits

Author SHA1 Message Date
Alexander Kornienko f5e72b0448 [clang-tidy] Add readability-simplify-boolean-expr check to clang-tidy
This check looks for comparisons between boolean expressions and boolean
constants and simplifies them to just use the appropriate boolean expression
directly.

if (b == true) becomes if (b)
if (b == false) becomes if (!b)
if (b && true) becomes if (b)
if (b && false) becomes if (false)
if (b || true) becomes if (true)
if (b || false) becomes if (b)
e ? true : false becomes e
e ? false : true becomes !e
if (true) t(); else f(); becomes t();
if (false) t(); else f(); becomes f();
if (e) return true; else return false; becomes return (e);
if (e) return false; else return true; becomes return !(e);
if (e) b = true; else b = false; becomes b = e;
if (e) b = false; else b = true; becomes b = !(e);

http://reviews.llvm.org/D7648

Patch by Richard Thomson!

llvm-svn: 234626
2015-04-10 19:26:43 +00:00
Siva Chandra 18d1696d62 [TestFormatters, TestDataFormatterSynthVal] Mark as xfail.
Summary:
This is to get the bots to go green while a robust solution to fix these
tests is worked out.

Reviewers: chaoren, tberghammer, clayborg

Reviewed By: tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 234625
2015-04-10 19:25:50 +00:00
Siva Chandra d7a2fc830f [TestAnonymous] Enable all tests for GCC
Summary:
Also added "_with_dsym" prefix to the dsym tests, and "_with_dwarf" to the dwarf tests.


Test Plan: dotest.py -C gcc -p TestAnonymous

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 234624
2015-04-10 19:24:48 +00:00
Kaelyn Takata 5cc8535596 Don't eagerly typo-correct to a keyword if the next token is a right paren.
Take advantage of the delayed typo no longer being eagerly corrected to
a keyword to filter out keyword corrections (and other things like
unresolved & overloaded expressions, which have placeholder types) when
correcting typos inside of a decltype().

llvm-svn: 234623
2015-04-10 19:16:46 +00:00
Sanjay Patel 89e28f67cc use update_llc_test_checks.py to tighten checking
test features, not CPUs

remove unnecessary cruft

llvm-svn: 234622
2015-04-10 18:31:42 +00:00
Rafael Espindola c8bc303faa Testcase for the previous commit.
Sorry, fogot to "git add" the previous time.

llvm-svn: 234621
2015-04-10 18:18:17 +00:00
Rafael Espindola d7e306fbcc Actually check if lseek works instead of using a filename based heuristic.
llvm-svn: 234620
2015-04-10 18:16:30 +00:00
Rafael Espindola 74d2f617f2 Remember if lseek works in this FD.
It will be used in clang in a sec.

llvm-svn: 234619
2015-04-10 18:15:51 +00:00
Reid Kleckner 5522d815eb [SEH] Add test for inline functions using SEH helpers
Such helpers should always be comdat with the parent function and have
internal linkage.

llvm-svn: 234618
2015-04-10 18:07:38 +00:00
Duncan P. N. Exon Smith 457bfc779a DebugInfo: Stop leaking temporaries in DIBuilder::createCompileUnit()
Stop leaking temporary nodes from `DIBuilder::createCompileUnit()`.
`replaceAllUsesWith()` doesn't delete the nodes, so we need to delete
them "manually" (well, `TempMDTuple` does that for us).

Similarly, stop leaking the temporary nodes used for variables of
subprograms.

llvm-svn: 234617
2015-04-10 18:01:58 +00:00
Reid Kleckner 7553a4bca0 Really fix exceptions-seh-finally.c
llvm-svn: 234616
2015-04-10 17:53:39 +00:00
Rafael Espindola a4800720b0 Have one raw_fd_ostream constructor forward to the other.
This fixes some odd behavior differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.

llvm-svn: 234615
2015-04-10 17:52:22 +00:00
Reid Kleckner 865c2ca882 Try to fix exceptions-seh-finally.c
llvm-svn: 234614
2015-04-10 17:45:23 +00:00
Reid Kleckner 11859afd5f [SEH] Re-land r234532, but use internal linkage for all SEH helpers
Even though these symbols are in a comdat group, the Microsoft linker
really wants them to have internal linkage.

I'm planning to tweak the mangling in a follow-up change. This is a
straight revert with a 1-line fix.

llvm-svn: 234613
2015-04-10 17:34:52 +00:00
Reid Kleckner 0aa128e219 [Frontend] Close open file handles before renaming output files
The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

llvm-svn: 234612
2015-04-10 17:27:58 +00:00
Reid Kleckner d03f9f4016 [FS] Report errors from llvm::sys::fs::rename on Windows
Previously we would always report success, which is pretty bogus.

I'm too lazy to write a test where rename will portably fail on all
platforms. I'm just trying to fix breakage introduced by r234597, which
happened to tickle this.

llvm-svn: 234611
2015-04-10 17:20:45 +00:00
Oleksiy Vyalov cc81556831 Use llvm::sys::fs::create_directories to create new directory on Windows.
http://reviews.llvm.org/D8977

llvm-svn: 234610
2015-04-10 17:02:26 +00:00
Greg Clayton a625f7bcf4 Check in missing file.
llvm-svn: 234609
2015-04-10 16:48:37 +00:00
Reid Kleckner 6e48a826e8 [WinEH] Try to make outlining invokes work a little better
WinEH currently turns invokes into calls. Long term, we will reconsider
this, but for now, make sure we remap the operands and clone the
successors of the new terminator.

llvm-svn: 234608
2015-04-10 16:26:42 +00:00
Adrian McCarthy 42b33806bf Add logging plugin for Windows
llvm-svn: 234607
2015-04-10 16:18:08 +00:00
Benjamin Kramer b3bcf604d1 [CallSite] Use the injected base class name. NFC.
llvm-svn: 234606
2015-04-10 16:02:34 +00:00
Tobias Grosser aa7f0f8d5c Drop ISL_INSTALL path
There is no need for an isl install path anymore. isl is now part of Polly.

llvm-svn: 234605
2015-04-10 15:41:14 +00:00
Timur Iskhodzhanov bd989e78f1 [ASan] Use a better name for a function parameter
llvm-svn: 234604
2015-04-10 15:31:16 +00:00
Hal Finkel a9fceb803d [PowerPC] Prefetching should also consider depth > 1 loops
Iterating over loops from the LoopInfo instance only provides top-level loops.
We need to search the whole tree of loops to find the inner ones.

llvm-svn: 234603
2015-04-10 15:05:02 +00:00
Timur Iskhodzhanov ea1f332b79 Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portable
On Windows, we have to know if a memory to be protected is mapped or not.
On POSIX, Mprotect was semantically different from mprotect most people know.

llvm-svn: 234602
2015-04-10 15:02:19 +00:00
Benjamin Kramer 3a09ef64ee [CallSite] Make construction from Value* (or Instruction*) explicit.
CallSite roughly behaves as a common base CallInst and InvokeInst. Bring
the behavior closer to that model by making upcasts explicit. Downcasts
remain implicit and work as before.

Following dyn_cast as a mental model checking whether a Value *V isa
CallSite now looks like this: 
  if (auto CS = CallSite(V)) // think dyn_cast
instead of:
  if (CallSite CS = V)

This is an extra token but I think it is slightly clearer. Making the
ctor explicit has the advantage of not accidentally creating nullptr
CallSites, e.g. when you pass a Value * to a function taking a CallSite
argument.

llvm-svn: 234601
2015-04-10 14:50:08 +00:00
Benjamin Kramer c19cde119d Don't rely on implicit CallSite construction.
llvm-svn: 234600
2015-04-10 14:49:31 +00:00
Rafael Espindola 5cb3cf0312 Try to make MSVC happy.
llvm-svn: 234599
2015-04-10 14:37:39 +00:00
Rafael Espindola c80a40661c Return std::unique_ptr to avoid a release and recreate.
llvm-svn: 234598
2015-04-10 14:30:43 +00:00
Rafael Espindola 269ec0f470 Use a std::unique_ptr to make it easier to see who owns the stream.
llvm-svn: 234597
2015-04-10 14:11:52 +00:00
Szabolcs Sipos 8429681d57 [clang-tidy] Fix for llvm.org/PR23161
The misc-static-assert check will not warn on the followings:
  assert("Some message" == NULL);
  assert(NULL == "Some message");

llvm-svn: 234596
2015-04-10 13:55:39 +00:00
Toma Tabacu ae47f93b74 [mips] [IAS] Improve comments in MipsAsmParser::expandLoadImm. NFC.
llvm-svn: 234595
2015-04-10 13:28:16 +00:00
Chad Rosier 518659d9b4 [AArch64] Changes some SchedAlias to WriteRes for Cortex-A57.
Using SchedAliases is convenient and works well for latency and resource
lookup for instructions.  However, this creates an entry in
AArch64WriteLatencyTable with a WriteResourceID of 0, breaking any
SchedReadAdvance since the lookup will fail.

http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 234594
2015-04-10 13:19:27 +00:00
Chad Rosier a82c876045 [AArch64] Adjusts Cortex-A57 machine model to handle zero shift.
http://reviews.llvm.org/D8043
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 234593
2015-04-10 13:19:21 +00:00
Rafael Espindola bfd25d4d8a Return a pointer instead of having a pointer outparam and a bool return.
llvm-svn: 234592
2015-04-10 13:14:31 +00:00
Aaron Ballman fe47a98c18 Initializing an uninitialized data member; should be NFC.
llvm-svn: 234591
2015-04-10 13:05:04 +00:00
Rafael Espindola 47de149565 Return a pointer instead of having a pointer outparam and a bool return.
llvm-svn: 234590
2015-04-10 12:54:53 +00:00
Benjamin Kramer 9b88fed323 Microoptimize DenseMap::clear.
Cache NumEntries locally, it's only used in an assert and using the member
variable prevents the compiler from eliminating the tombstone check for types
with trivial destructors. No functionality change intended.

llvm-svn: 234589
2015-04-10 12:46:44 +00:00
Denis Protivensky fb8afb8f81 [ARM] Implement PLT for dynamic pass
This includes implementation of PLT0 entry.

For testing, libfn.so binary is added since
there's no way to link shared objects with lld yet.

llvm-svn: 234588
2015-04-10 11:41:27 +00:00
Benjamin Kramer a008d3a9f9 Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.
No functional change intended.

llvm-svn: 234587
2015-04-10 11:37:55 +00:00
Benjamin Kramer 619c4e57ba Reduce dyn_cast<> to isa<> or cast<> where possible.
No functional change intended.

llvm-svn: 234586
2015-04-10 11:24:51 +00:00
Denis Protivensky e9c336aeb5 [ARM] Rework GOT/PLT entry generation
Use consistent naming: commonly used generator methods
don't have 'Entry' suffices.

llvm-svn: 234585
2015-04-10 11:05:11 +00:00
Toma Tabacu 038a330ede [mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.
Move the check lines below the code lines and change the indentation from 8
spaces to 2 spaces.

llvm-svn: 234584
2015-04-10 10:46:59 +00:00
Alexey Bataev 794ba0dcb7 [OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

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

llvm-svn: 234583
2015-04-10 10:43:45 +00:00
Denis Protivensky 8ad3627e19 [ARM] Replace dyn_cast with isa check
llvm-svn: 234582
2015-04-10 10:30:04 +00:00
Arnaud A. de Grandmaison 047a686d53 Remove threshold for inserting lifetime markers for named temporaries
Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

llvm-svn: 234581
2015-04-10 10:13:52 +00:00
Denis Protivensky b56dff5729 [ARM] Improve veneer handling and introduce handlePlain method
Handle veneers only for call-like relocations.

llvm-svn: 234580
2015-04-10 09:54:10 +00:00
Dmitry Vyukov 4bf08947a1 [sanitizer][MIPS] Fix warnings on MIPS
Fixed:
- stack frame size warning.
- msse3 flag unused warning.
- GoTsanRuntimeCheck dependency warning reported by cmake.

Change by Sagar Thakur
Reviewed in http://reviews.llvm.org/D8963

llvm-svn: 234579
2015-04-10 09:45:22 +00:00
Szabolcs Sipos f83a92302f Reverting test commit.
llvm-svn: 234578
2015-04-10 08:43:58 +00:00
Szabolcs Sipos 5acd963175 Test commit.
llvm-svn: 234577
2015-04-10 08:42:08 +00:00