Commit Graph

198660 Commits

Author SHA1 Message Date
Hans Wennborg 5615f6bcd5 clang-cl: support -fsyntax-only (PR23197)
This might help running Clang tooling (which appends this option)
with clang-cl command-lines.

llvm-svn: 234990
2015-04-15 10:02:21 +00:00
Denis Protivensky 7f6b22ee84 [ARM] Pass Thumb flag to handler methods instead of atom
llvm-svn: 234989
2015-04-15 09:57:04 +00:00
Alexey Bataev bcb4a8fe1b Changed test to not brake ARM buildbots, NFC.
llvm-svn: 234988
2015-04-15 09:52:50 +00:00
Tamas Berghammer d8c338d42f Add single stepping logic for linux arm
Linux arm don't support hardware stepping (neither mismatch
breakpoints). This patch implement signle stepping with doing a software
emulation of the next instruction and then setting a temporary
breakpoint at the address where the thread will stop next.

Differential revision: http://reviews.llvm.org/D8976

llvm-svn: 234987
2015-04-15 09:47:02 +00:00
Tamas Berghammer 63c8be9571 Fix breakpoint trap opcode detection for arm linux
llvm-svn: 234986
2015-04-15 09:38:48 +00:00
Tamas Berghammer 23fc4b00a9 Fix test makefile after r234949.
On non OSX architectures we don't need a space between the arch flag
(-m) and the value.

llvm-svn: 234985
2015-04-15 09:28:31 +00:00
Filipe Cabecinhas 7dc896fcce Verify sizes when trying to read a VBR
Also added an assert to ReadVBR64.

llvm-svn: 234984
2015-04-15 08:48:08 +00:00
Renato Golin c640ff63e2 Revert "[CodeGen] Fix crash with duplicated mangled name."
This reverts commit r234767, as it was breaking all ARM buildbots for two days and the
assert is not in the code, making it difficult to spot the error, which would keep the
bots red for a few more days. New errors were silently introduced because of this bug,
and we don't want this to escalate.

llvm-svn: 234983
2015-04-15 08:44:40 +00:00
Yaron Keren 96acdf60a3 Fix lib\support\Windows/TimeValue.inc(48): warning C4189:
'Error' : local variable is initialized but not referenced.

llvm-svn: 234982
2015-04-15 07:45:52 +00:00
Denis Protivensky 97375dc751 [ELF] Fix gcc -pedantic warnings (remove extra ';')
llvm-svn: 234981
2015-04-15 07:45:11 +00:00
Daniel Jasper 2b1865c251 clang-format: Determine "in" as a keyword in ObjC for loops more precisely
Before:
  for (int i = 0; i < in [a]; ++i) ..

After:
  for (int i = 0; i < in[a]; ++i) ..

Also do some related cleanups.

llvm-svn: 234980
2015-04-15 07:26:18 +00:00
Daniel Jasper a73f3d51ac Re-apply r234898 and fix tests.
This commit makes LLVM not estimate branch probabilities when doing a
single bit bitmask tests.

The code that originally made me discover this is:

  if ((a & 0x1) == 0x1) {
    ..
  }

In this case we don't actually have any branch probability information
and should not assume to have any. LLVM transforms this into:

  %and = and i32 %a, 1
  %tobool = icmp eq i32 %and, 0

So, in this case, the result of a bitwise and is compared against 0,
but nevertheless, we should not assume to have probability
information.

CodeGen/ARM/2013-10-11-select-stalls.ll started failing because the
changed probabilities changed the results of
ARMBaseInstrInfo::isProfitableToIfCvt() and led to an Ifcvt of the
diamond in the test. AFAICT, the test was never meant to test this and
thus changing the test input slightly to not change the probabilities
seems like the best way to preserve the meaning of the test.

llvm-svn: 234979
2015-04-15 06:24:07 +00:00
Alexey Bataev 69c62a9bdb [OPENMP] Codegen for 'firstprivate' clause in 'for' directive.
Adds proper codegen for 'firstprivate' clause in for directive. Initially codegen for 'firstprivate' clause was implemented for 'parallel' directive only.
Also this patch emits sync point only after initialization of firstprivate variables, not all private variables. This sync point is not required for privates, lastprivates etc., only for initialization of firstprivate variables.
Differential Revision: http://reviews.llvm.org/D8660

llvm-svn: 234978
2015-04-15 04:52:20 +00:00
Lang Hames 042e35cab9 [RuntimeDyld] Add casts to make delta computation 64-bit.
Hopefully this will fix the i686/msvc build failure described at:
http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/803

llvm-svn: 234977
2015-04-15 04:46:01 +00:00
Richard Trieu 20abd6bc04 Use concrete type instead of auto in for-loop. No functionality change.
llvm-svn: 234976
2015-04-15 03:48:48 +00:00
Lang Hames 38aac6495a [RuntimeDyld] Make sure we emit MachO __eh_frame and __gcc_except_tab sections,
even if there are no references to them in the code.

This allows exceptions thrown from JIT'd code to be caught by the JIT itself.

llvm-svn: 234975
2015-04-15 03:39:22 +00:00
Richard Trieu 46f2cc9e44 Change range-based for-loop to use const auto&. No functionality change.
llvm-svn: 234974
2015-04-15 03:17:49 +00:00
Duncan P. N. Exon Smith 8a7b84b4d0 uselistorder: Remove the global bits
Remove all the global bits to do with preserving use-list order by
moving the `cl::opt`s to the individual tools that want them.  There's a
minor functionality change to `libLTO`, in that you can't send in
`-preserve-bc-uselistorder=false`, but making that bit settable (if it's
worth doing) should be through explicit LTO API.

As a drive-by fix, I removed some includes of `UseListOrder.h` that were
made unnecessary by recent commits.

llvm-svn: 234973
2015-04-15 03:14:06 +00:00
Duncan P. N. Exon Smith fda02091e6 uselistorder: Remove dead include
Forgot to remove the include in r234970

llvm-svn: 234972
2015-04-15 03:04:45 +00:00
Alexei Starovoitov 1a8102e020 [bpf] fix build
fix build due to refactoring in DIL/MDL and raw_pwrite_stream

llvm-svn: 234971
2015-04-15 02:48:57 +00:00
Duncan P. N. Exon Smith bb9cadf4eb uselistorder: -mllvm -preserve-ll-use-list-order => -emit-llvm-uselists
Follow up to r234962, start respecting `-emit-llvm-uselists even for
LLVM assembly.  Note that the driver never passes this flag; this is
just a interface convenience/consistency for those using `-cc1`
directly.  This required LLVM r234969 (and predecessors).

llvm-svn: 234970
2015-04-15 02:45:28 +00:00
Duncan P. N. Exon Smith 8a74f6846d uselistorder: Pull the bit through PrintModulePass
Now the callers of `PrintModulePass()` (etc.) that care about use-list
order in assembly pass in the flag.

llvm-svn: 234969
2015-04-15 02:38:06 +00:00
Duncan P. N. Exon Smith c4f0a325a7 uselistorder: Pull the assembly bit up out of the printer
Pull the `-preserve-ll-uselistorder` bit up through all the callers of
`Module::print()`.  I converted callers of `operator<<` to
`Module::print()` where necessary to pull the bit through.

llvm-svn: 234968
2015-04-15 02:12:41 +00:00
Duncan P. N. Exon Smith 89010d8356 uselistorder: Start pulling out -preserve-ll-uselistorder
For consistency, start pulling out `-preserve-ll-uselistorder`.  I'll
drop the global state for both eventually.  This pulls it up to
`Module::print()` (but not past there).

llvm-svn: 234966
2015-04-15 01:36:30 +00:00
Richard Trieu a60ca8104e Change range-based for-loop to be -Wrange-loop-analysis clean.
No functionality change.

llvm-svn: 234965
2015-04-15 01:21:57 +00:00
Richard Trieu b58413323d Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

llvm-svn: 234964
2015-04-15 01:21:42 +00:00
Richard Trieu 6b1aa5f5e1 Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

llvm-svn: 234963
2015-04-15 01:21:15 +00:00
Duncan P. N. Exon Smith bb61825cd5 uselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselists
Stop relying on `cl::opt` to pass along the driver's decision to
preserve use-lists.  Create a new `-cc1` option called
`-emit-llvm-uselists` that does the right thing (when -emit-llvm-bc).
Note that despite its generic name, it *doesn't* do the right thing when
-emit-llvm (LLVM assembly) yet.  I'll hook that up soon.

This doesn't really change the behaviour of the driver.  The default is
still to preserve use-lists for `clang -emit-llvm` and `clang
-save-temps`, and nothing else.  But it stops relying on global state
(and also is a nicer interface for hackers using `clang -cc1`).

llvm-svn: 234962
2015-04-15 01:16:18 +00:00
Reid Kleckner e07140eb3f Move the logic to avoid double global emission from Sema to CodeGen
Reverts the code changes from r234675 but keeps the test case.

We were already maintaining a DenseMap of globals with dynamic
initializers anyway.

Fixes the test case from PR23234.

llvm-svn: 234961
2015-04-15 01:08:06 +00:00
Duncan P. N. Exon Smith 58927f1aa2 uselistorder: Update for LLVM API change in r234959
Now that `addBitcodeWriterPass()` requires an explicit bit to preserve
use-list order, send it in from `clang`.  It looks like I'll be able to
push this up to the `-cc1` options.

llvm-svn: 234960
2015-04-15 00:36:14 +00:00
Duncan P. N. Exon Smith 679db3345c uselistorder: Pull bit through BitcodeWriterPass
Now the callers of `BitcodeWriterPass` decide whether or not to preserve
bitcode use-list order.

llvm-svn: 234959
2015-04-15 00:34:24 +00:00
Duncan P. N. Exon Smith e406c84e30 Fix build error from r234957
llvm-svn: 234958
2015-04-15 00:13:51 +00:00
Duncan P. N. Exon Smith a052ed6381 uselistorder: Pull the bit through WriteToBitcodFile()
Change the callers of `WriteToBitcodeFile()` to pass `true` or
`shouldPreserveBitcodeUseListOrder()` explicitly.  I left the callers
that want to send `false` alone.

I'll keep pushing the bit higher until hopefully I can delete the global
`cl::opt` entirely.

llvm-svn: 234957
2015-04-15 00:10:50 +00:00
Duncan P. N. Exon Smith 458593a457 uselistorder: Thread bit through ValueEnumerator
Canonicalize access to whether to preserve use-list order in bitcode on
a `bool` stored in `ValueEnumerator`.  Next step, expose this as a
`bool` through `WriteBitcodeToFile()`.

llvm-svn: 234956
2015-04-14 23:45:11 +00:00
Rui Ueyama bd94dbcf0a ELF: Attempt to simplify Segment::AssignVirtualAddress.
This is a retry of r234944.

llvm-svn: 234955
2015-04-14 23:11:14 +00:00
Rui Ueyama 13e41bcf9c temporary
llvm-svn: 234954
2015-04-14 23:11:12 +00:00
Rui Ueyama 0a57476c20 temporary
llvm-svn: 234953
2015-04-14 23:11:10 +00:00
Rafael Espindola 642a22165a Use the ability to pwrite to simplify the ELF writer.
Now we don't have to do 2 synchronized passes to compute offsets and then
write the file.

This also includes a fix for the corner case of seeking in /dev/null. It
is not an error, but on some systems (Linux) the returned offset is
always 0. An error is signaled by returning -1. This is checked by
the existing tests now that "clang -o /dev/null ..." seeks.

llvm-svn: 234952
2015-04-14 22:54:16 +00:00
Greg Clayton 50bd5a2dc6 Change SymbolVendor::GetCompileUnitAtIndex() and SymbolVendor::Dump() to make sure they are thread safe.
<rdar://problem/20263111>

llvm-svn: 234951
2015-04-14 22:34:00 +00:00
Rafael Espindola 5560a4cfbd Use raw_pwrite_stream in the object writer/streamer.
The ELF object writer will take advantage of that in the next commit.

llvm-svn: 234950
2015-04-14 22:14:34 +00:00
Greg Clayton 931b107364 MacOSX needs a space between $(ARCHFLAG) and $(ARCH) otherwise we try to call clang with "-archx86_64" which doesn't work.
llvm-svn: 234949
2015-04-14 22:08:17 +00:00
Reid Kleckner e5f13831d0 [WinEH] Avoid emitting xdata tables twice for cleanups
Since adding invokes of llvm.donothing to cleanups, we come here now,
and trivial EH cleanup usage from clang fails to compile.

llvm-svn: 234948
2015-04-14 21:42:36 +00:00
Rui Ueyama ed796d518c ELF: Move Instrcution definition to HexagonEncoding.h.
HexagonEncodings.h contains a list of bitmasks. The file is used
only by HexagonRelocationHandler.cpp. The header is odd in the sense
that it uses struct Instruction but it doesn't define the data type.

This patch moves the struct definition to the header.

llvm-svn: 234947
2015-04-14 21:41:00 +00:00
Rui Ueyama ae9168b718 Revert "ELF: Attempt to simplify Segment::assignVirtualAddress()."
This reverts commit r234944 because it seems to have broken the buildbots.

llvm-svn: 234946
2015-04-14 21:38:39 +00:00
Jason Molenda d2e46b19cb Remove unneeded include.
llvm-svn: 234945
2015-04-14 21:34:51 +00:00
Rui Ueyama 5ec40d6e73 ELF: Attempt to simplify Segment::assignVirtualAddress().
This function is too long and complicated. Looks like new code was
added incrementaly without any refactoring. Maybe no one can describe
its exact semantics any more? It even contains copy-pastes inside it.

This patch is an (incomplete) attempt to simplify the function.
I tried to mechanically translate code to another form more intelligible.
I don't still understand the whole picture, but this patch shouldn't
change the linker's functionality.

llvm-svn: 234944
2015-04-14 21:20:37 +00:00
Davide Italiano b60453fe29 Rename ExecutableAtom.hpp to ExecutableAtom.h
This is for consistency with what's used elsewhere in lld tree.

llvm-svn: 234943
2015-04-14 21:06:56 +00:00
Reid Kleckner ebaf28d13d Reland r234613 (and follow-ups 234614, 234616, 234618)
The frameescape intrinsic cannot be inlined, so I fixed the inliner in
r234937. This should address PR23216.

llvm-svn: 234942
2015-04-14 20:59:00 +00:00
Greg Clayton bef47e497f Fix printf warnings about a size mismatch on MacOSX.
llvm-svn: 234941
2015-04-14 20:58:08 +00:00
Greg Clayton 21667b64bc Remove unused functions that were causing warnings.
llvm-svn: 234940
2015-04-14 20:57:13 +00:00