Alexey Samsonov [Wed, 31 Dec 2014 00:40:28 +0000 (00:40 +0000)]
Revert "merge consecutive stores of extracted vector elements"
This reverts commit r224611. This change causes crashes
in X86 DAG->DAG Instruction Selection.
llvm-svn: 225031
Peter Collingbourne [Wed, 31 Dec 2014 00:25:39 +0000 (00:25 +0000)]
irgen: modify the ABI to use init guards instead of priority
The new ABI is simpler for use cases such as dynamically loaded packages.
The calling convention for import functions is similar to what go/ssa would
produce if BareInits were cleared. However, simply clearing this flag causes
two additional issues:
1) We would need to special case the 'init$guard' variable (see
discussion in https://codereview.appspot.com/
78780043/).
2) The call to __go_register_gc_roots needs to appear in the right
place, i.e. after the guard check. Making this check appear
in the right place with non-bare inits seems unreliable at best.
So we keep BareInits set and generate the necessary code manually.
It is still possible to get the old ABI by specifying a path to a gccgo
installation.
Differential Revision: http://reviews.llvm.org/D6804
llvm-svn: 225030
Peter Collingbourne [Wed, 31 Dec 2014 00:25:36 +0000 (00:25 +0000)]
irgen: make it possible to use a custom importer
Differential Revision: http://reviews.llvm.org/D6803
llvm-svn: 225029
Peter Collingbourne [Wed, 31 Dec 2014 00:25:35 +0000 (00:25 +0000)]
irgen: return a types.Package to the compiler client
Differential Revision: http://reviews.llvm.org/D6802
llvm-svn: 225028
Peter Collingbourne [Wed, 31 Dec 2014 00:25:34 +0000 (00:25 +0000)]
irgen: introduce ManglePackagePath function
This is useful for clients that need to use llgo's mangling of the package
path to look up a specific function within a given package.
Differential Revision: http://reviews.llvm.org/D6801
llvm-svn: 225027
Peter Collingbourne [Wed, 31 Dec 2014 00:25:32 +0000 (00:25 +0000)]
irgen, driver: modify Compiler.Compile to take a FileSet and Files
This change allows clients to generate IR using "files" received from locations
other than the file system. The regular file parser is moved to a new library,
"driver", which is intended to eventually contain much of the logic from
the existing driver.
Differential Revision: http://reviews.llvm.org/D6794
llvm-svn: 225026
Colin LeMahieu [Wed, 31 Dec 2014 00:08:34 +0000 (00:08 +0000)]
[Hexagon] Adding accumulating add/sub, doubleword logic-not variants, doubleword bitfield extract, word parity, accumulating multiplies with saturation.
llvm-svn: 225024
Zachary Turner [Wed, 31 Dec 2014 00:06:49 +0000 (00:06 +0000)]
Update the website with information about LLDB on Windows.
This patch updates the list of supported platforms to include
Windows, and also provides some detailed getting started instructions
for building LLDB on Windows.
Differential Revision: http://reviews.llvm.org/D6805
llvm-svn: 225023
Zachary Turner [Wed, 31 Dec 2014 00:06:41 +0000 (00:06 +0000)]
Fix HTML formatting and non-conformance.
llvm-svn: 225022
David Blaikie [Wed, 31 Dec 2014 00:06:08 +0000 (00:06 +0000)]
Handle PPC64 return type (signext i32 rather than plain i32) in test case
llvm-svn: 225021
David Blaikie [Tue, 30 Dec 2014 23:33:55 +0000 (23:33 +0000)]
Fix a test case to not depend on asm comment syntax, so as to be portable
Too many different comment characters - instead of trying to account for
them all, instead disable the comments and just check for end-of-line
instead.
llvm-svn: 225020
David Blaikie [Tue, 30 Dec 2014 23:23:58 +0000 (23:23 +0000)]
Generalize even further, for ARM comment syntax (@)
llvm-svn: 225019
Colin LeMahieu [Tue, 30 Dec 2014 23:22:39 +0000 (23:22 +0000)]
[Hexagon] Adding double-logic on predicate instructions.
llvm-svn: 225018
David Blaikie [Tue, 30 Dec 2014 23:21:57 +0000 (23:21 +0000)]
Generalize test case to handle different asm syntax (# or // comments)
llvm-svn: 225017
Kostya Serebryany [Tue, 30 Dec 2014 23:16:12 +0000 (23:16 +0000)]
[asan] fix coverage between fork() and exec(): reinitialize the guards after fork()
llvm-svn: 225016
Colin LeMahieu [Tue, 30 Dec 2014 23:04:21 +0000 (23:04 +0000)]
[Hexagon] Adding newvalue compare and jumps.
llvm-svn: 225015
Peter Collingbourne [Tue, 30 Dec 2014 22:52:33 +0000 (22:52 +0000)]
RTDyldMemoryManager.cpp: Make the reference to __morestack weak.
This fixes the DSO build for now. Eventually we should develop some
other mechanism to make this work correctly with DSOs.
llvm-svn: 225014
Saleem Abdulrasool [Tue, 30 Dec 2014 22:52:08 +0000 (22:52 +0000)]
Driver: unify compiler-rt component selection
Unify the component handling for compiler-rt. The components are regularly
named, built up from:
${LIBRARY_PREFIX}clang_rt.${component}-${arch}[-${environment}]${LIBRARY_SUFFIX}
Unify the handling for all the various components, into a single path to link
against the various components in a number of places. This reduces duplication
of the clang_rt library name construction logic.
llvm-svn: 225013
Saleem Abdulrasool [Tue, 30 Dec 2014 22:52:06 +0000 (22:52 +0000)]
Driver: whitespace
Fixup some whitespace/style issues. NFC.
llvm-svn: 225012
David Blaikie [Tue, 30 Dec 2014 22:47:13 +0000 (22:47 +0000)]
DebugInfo: Omit is_stmt from line table entries on the same line.
GCC does this for non-zero discriminators and since GCC doesn't produce
column info, that was the only place it comes up there. For LLVM, since
we can emit discriminators and/or column info, it makes more sense to
invert the condition and just test for changes in line number.
This should resolve at least some of the GDB 7.5 test suite failures
created by recent Clang changes that increase the location fidelity
(which, since Clang defaults to including column info on Linux by
default created a bunch of cases that confused GDB).
In theory we could do this better/differently by grouping actual source
statements together in a similar manner to the way lexical scopes are
handled but given that GDB isn't really in a position to consume that (&
users are probably somewhat used to different lines being different
'statements') this seems the safest and cheapest change. (I'm concerned
that doing this 'right' would bloat the debugloc data even further -
something Duncan's working hard to address)
llvm-svn: 225011
Colin LeMahieu [Tue, 30 Dec 2014 22:34:08 +0000 (22:34 +0000)]
[Hexagon] Adding postincrement register newvalue stores.
llvm-svn: 225010
Colin LeMahieu [Tue, 30 Dec 2014 22:28:31 +0000 (22:28 +0000)]
[Hexagon] Removing old newvalue store variants. Adding postincrement immediate newvalue stores.
llvm-svn: 225009
Zoran Jovanovic [Tue, 30 Dec 2014 22:04:16 +0000 (22:04 +0000)]
[mips][microMIPS] Relocate with symbol for micromips symbols
Differential Revision: http://reviews.llvm.org/D6796
llvm-svn: 225008
Colin LeMahieu [Tue, 30 Dec 2014 22:00:26 +0000 (22:00 +0000)]
[Hexagon] Adding indexed store new-value variants.
llvm-svn: 225007
Colin LeMahieu [Tue, 30 Dec 2014 21:01:38 +0000 (21:01 +0000)]
[Hexagon] Adding indexed store of immediates.
llvm-svn: 225006
Colin LeMahieu [Tue, 30 Dec 2014 20:42:23 +0000 (20:42 +0000)]
[Hexagon] Adding indexed stores.
llvm-svn: 225005
Nico Weber [Tue, 30 Dec 2014 20:13:37 +0000 (20:13 +0000)]
Remove a comment that appears a second time 22 lines further down.
llvm-svn: 225004
Peter Collingbourne [Tue, 30 Dec 2014 20:05:19 +0000 (20:05 +0000)]
x86_64: Fix calls to __morestack under the large code model.
Under the large code model, we cannot assume that __morestack lives within
2^31 bytes of the call site, so we cannot use pc-relative addressing. We
cannot perform the call via a temporary register, as the rax register may
be used to store the static chain, and all other suitable registers may be
either callee-save or used for parameter passing. We cannot use the stack
at this point either because __morestack manipulates the stack directly.
To avoid these issues, perform an indirect call via a read-only memory
location containing the address.
This solution is not perfect, as it assumes that the .rodata section
is laid out within 2^31 bytes of each function body, but this seems to
be sufficient for JIT.
Differential Revision: http://reviews.llvm.org/D6787
llvm-svn: 225003
Kostya Serebryany [Tue, 30 Dec 2014 19:55:04 +0000 (19:55 +0000)]
[asan] add flag coverage_pcs. When false, the coverage is not dumped as PCs. Useful e.g. if the user only needs coverage is bitset
llvm-svn: 225002
David Blaikie [Tue, 30 Dec 2014 19:54:25 +0000 (19:54 +0000)]
Reapply debug info changes now that more precise column information is available.
(recommitting as the Clang patch is back in with the latest fix -
hopefully it sticks)
llvm-svn: 225001
David Blaikie [Tue, 30 Dec 2014 19:39:33 +0000 (19:39 +0000)]
Reapply "DebugInfo: Generalize debug info location handling"
Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).
Recommitted in r224941 and reverted in r224970 after it caused a crash
when building compiler-rt. Looks to be due to this change zeroing out
the debug location when emitting default arguments (which were meant to
inherit their outer expression's location) thus creating call
instructions without locations - these create problems for inlining and
must not be created. That is fixed and tested in this version of the
change.
Original commit message:
This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.
This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.
I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.
Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.
I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.
llvm-svn: 225000
Kostya Serebryany [Tue, 30 Dec 2014 19:29:28 +0000 (19:29 +0000)]
[asan] change _sanitizer_cov_module_init to accept int* instead of int**
llvm-svn: 224999
Michael Kuperstein [Tue, 30 Dec 2014 19:23:48 +0000 (19:23 +0000)]
[COFF] Don't try to add quotes to already quoted linker directives
If a linker directive is already quoted, don't try to quote it again, otherwise it creates a mess.
This pops up in places like:
#pragma comment(linker,"\"/foo bar'\"")
Differential Revision: http://reviews.llvm.org/D6792
llvm-svn: 224998
Colin LeMahieu [Tue, 30 Dec 2014 18:58:47 +0000 (18:58 +0000)]
[Hexagon] Adding reg-reg indexed load forms.
llvm-svn: 224997
Saleem Abdulrasool [Tue, 30 Dec 2014 18:55:37 +0000 (18:55 +0000)]
Driver: use the canonical library prefix on Windows
Unlike Unices, Windows does not use a library prefix. Use the traditional
naming scheme even for Windows itanium environments. This makes the builtins
behave more like the sanitisers as well.
llvm-svn: 224996
Yaron Keren [Tue, 30 Dec 2014 18:46:42 +0000 (18:46 +0000)]
Add non-const version getFileSystemOpts() access function.
All the other get*Opts have both versions.
llvm-svn: 224995
Peter Collingbourne [Tue, 30 Dec 2014 18:22:06 +0000 (18:22 +0000)]
The __morestack function is only available on i386 and x86_64 architectures.
llvm-svn: 224994
Peter Collingbourne [Tue, 30 Dec 2014 18:06:52 +0000 (18:06 +0000)]
Make the __morestack function available to the JIT memory manager under Linux.
This function's implementation lives in libgcc, a static library, so we need
to expose it explicitly, like the other such functions.
Differential Revision: http://reviews.llvm.org/D6788
llvm-svn: 224993
Colin LeMahieu [Tue, 30 Dec 2014 17:53:54 +0000 (17:53 +0000)]
[Hexagon] Dropping old combine instructions without encodings.
llvm-svn: 224992
Colin LeMahieu [Tue, 30 Dec 2014 17:39:24 +0000 (17:39 +0000)]
[Hexagon] Adding compare byte/halfword reg-reg/reg-imm forms. Adding compare to general register reg-imm form.
llvm-svn: 224991
Hafiz Abid Qadeer [Tue, 30 Dec 2014 17:11:31 +0000 (17:11 +0000)]
Cleanup lldb-mi test cases.
Following changes were done.
1. Remove the extra line after -exec-run.
2. Remove check for prompt.
3. Remove 'quit' command.
Initial patch was contributed by ki.stfu@gmail.com.
llvm-svn: 224990
Colin LeMahieu [Tue, 30 Dec 2014 15:44:17 +0000 (15:44 +0000)]
[Hexagon] Updating constant extender def, adding alu-not instructions, compare to general register, and inverted compares.
llvm-svn: 224989
Timur Iskhodzhanov [Tue, 30 Dec 2014 15:30:19 +0000 (15:30 +0000)]
Follow-up to r224987: fix a lint warning
llvm-svn: 224988
Timur Iskhodzhanov [Tue, 30 Dec 2014 14:44:12 +0000 (14:44 +0000)]
[ASan/Win] Sort the list of modules when we fail to reserve the shadow memory range
llvm-svn: 224987
Elena Demikhovsky [Tue, 30 Dec 2014 14:28:14 +0000 (14:28 +0000)]
Some code improvements in Masked Load/Store.
No functional changes.
llvm-svn: 224986
Rafael Espindola [Tue, 30 Dec 2014 13:13:27 +0000 (13:13 +0000)]
Remove doesSectionRequireSymbols.
In an assembly expression like
bar:
.long L0 + 1
the intended semantics is that bar will contain a pointer one byte past L0.
In sections that are merged by content (strings, 4 byte constants, etc), a
single position in the section doesn't give the linker enough information.
For example, it would not be able to tell a relocation must point to the
end of a string, since that would look just like the start of the next.
The solution used in ELF to use relocation with symbols if there is a non-zero
addend.
In MachO before this patch we would just keep all symbols in some sections.
This would miss some cases (only cstrings on x86_64 were implemented) and was
inefficient since most relocations have an addend of 0 and can be represented
without the symbol.
This patch implements the non-zero addend logic for MachO too.
llvm-svn: 224985
Elena Demikhovsky [Tue, 30 Dec 2014 10:17:21 +0000 (10:17 +0000)]
reverted prev commit (it was a mistake)
llvm-svn: 224984
Elena Demikhovsky [Tue, 30 Dec 2014 10:13:38 +0000 (10:13 +0000)]
v
llvm-svn: 224983
Keno Fischer [Tue, 30 Dec 2014 08:12:39 +0000 (08:12 +0000)]
Add a public accessor for GlobalCtors in CodeGenModule
Summary:
In a JIT context it is useful to be able to access the GlobalCtors
and especially clear them once they have been emitted and called.
This adds a public method to be able to access the list.
Subscribers: yaron.keren, cfe-commits
Differential Revision: http://reviews.llvm.org/D6790
llvm-svn: 224982
Philip Reames [Tue, 30 Dec 2014 05:55:58 +0000 (05:55 +0000)]
Add IRBuilder routines for gc.statepoints, gc.results, and gc.relocates
Nothing particularly interesting, just adding infrastructure for use by in tree users and out of tree users.
Note: These were extracted out of a working frontend, but they have not been well tested in isolation.
Differential Revision: http://reviews.llvm.org/D6807
llvm-svn: 224981
Rafael Espindola [Tue, 30 Dec 2014 05:09:17 +0000 (05:09 +0000)]
Simplify test a bit.
It looks like the original intent was to check which symbols were created.
With macho-dump the sections were being checked just to match which symbol
was in which section.
llvm-objdump prints the section a symbol is in.
llvm-svn: 224980
Peter Zotov [Tue, 30 Dec 2014 03:24:14 +0000 (03:24 +0000)]
[OCaml] Fix bitrot in tests.
llvm-svn: 224979
Peter Zotov [Tue, 30 Dec 2014 03:24:11 +0000 (03:24 +0000)]
[lit] Make config.llvm_lib_dir available on cmake, too.
The OCaml tests require config.llvm_lib_dir to determine
the OCaml package search path.
llvm-svn: 224978
Peter Zotov [Tue, 30 Dec 2014 03:24:07 +0000 (03:24 +0000)]
[OCaml] [cmake] Use LLVM_LIBRARY_DIR instead of LLVM_LIBRARY_OUTPUT_INTDIR.
The latter variable is internal.
Original patch by Ramkumar Ramachandra <artagnon@gmail.com>
llvm-svn: 224977
Craig Topper [Tue, 30 Dec 2014 02:35:56 +0000 (02:35 +0000)]
Testcases for r224939.
llvm-svn: 224976
Saleem Abdulrasool [Tue, 30 Dec 2014 02:10:36 +0000 (02:10 +0000)]
Driver: unify addClangRT{Linux,Windows}
The differences are pretty superficial:
- .lib vs .a extensions
- whether or not to link (potentially) incorrectly against libgcc_s
llvm-svn: 224975
Nico Weber [Tue, 30 Dec 2014 02:06:40 +0000 (02:06 +0000)]
Don't crash on an invalid trailing return type on a function before a '...'
clang tries to produce a helpful diagnostic for the traiilng '...', but the
code that r216778 added for this doesn't expect an invalid trailing return type.
Add code to explicitly handle this.
Having explicit code for this but not for other things looks a bit strange, but
trailing return types are special in that they have a separate existence bit in
addition to the type (see r158348).
llvm-svn: 224974
Rafael Espindola [Tue, 30 Dec 2014 01:34:06 +0000 (01:34 +0000)]
Convert test to llvm-readobj. NFC.
llvm-svn: 224973
Alexey Samsonov [Tue, 30 Dec 2014 00:33:50 +0000 (00:33 +0000)]
Revert "UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases"
This reverts commit r221445. This change leads to false positives
reports from -fsanitize=vptr. See original commit thread for more
details.
llvm-svn: 224972
Philip Reames [Mon, 29 Dec 2014 23:55:33 +0000 (23:55 +0000)]
Semantic tests for memory invalidation at statepoints
These are simply a collection of tests intended to show that information about the contents of gc references in the heap is lost at a statepoint. I've tried to write them so that they don't disallow correct transformations, while still being fairly easy to understand.
p.s. Ideas for additional tests are welcome.
Differential Revision: http://reviews.llvm.org/D6491
llvm-svn: 224971
David Blaikie [Mon, 29 Dec 2014 23:49:00 +0000 (23:49 +0000)]
Revert "DebugInfo: Generalize debug info location handling"
Asserting when building compiler-rt when using a GCC host compiler.
Reverting while I investigate.
This reverts commit r224941.
llvm-svn: 224970
David Blaikie [Mon, 29 Dec 2014 23:48:46 +0000 (23:48 +0000)]
Revert "Reapply debug info changes now that r224385 has been recommitted to clang (in r224941)"
Asserting when building compiler-rt when using a gcc host compiler.
Reverting while I investigate.
This reverts commit r224942.
llvm-svn: 224969
Philip Reames [Mon, 29 Dec 2014 23:27:30 +0000 (23:27 +0000)]
Carry facts about nullness and undef across GC relocation
This change implements four basic optimizations:
If a relocated value isn't used, it doesn't need to be relocated.
If the value being relocated is null, relocation doesn't change that. (Technically, this might be collector specific. I don't know of one which it doesn't work for though.)
If the value being relocated is undef, the relocation is meaningless.
If the value being relocated was known nonnull, the relocated pointer also isn't null. (Since it points to the same source language object.)
I outlined other planned work in comments.
Differential Revision: http://reviews.llvm.org/D6600
llvm-svn: 224968
David Majnemer [Mon, 29 Dec 2014 23:24:27 +0000 (23:24 +0000)]
Fix build breakage
That's what I get for last second changes...
llvm-svn: 224967
David Majnemer [Mon, 29 Dec 2014 23:12:23 +0000 (23:12 +0000)]
Parse: Recover more gracefully from extra :: tokens before a {
Instead of crashing, recover by eating the extra trailing scope
qualifier. This means we will treat 'struct A:: {' as 'struct A {'.
llvm-svn: 224966
Philip Reames [Mon, 29 Dec 2014 23:00:57 +0000 (23:00 +0000)]
Refine the notion of MayThrow in LICM to include a header specific version
In LICM, we have a check for an instruction which is guaranteed to execute and thus can't introduce any new faults if moved to the preheader. To handle a function which might unconditionally throw when first called, we check for any potentially throwing call in the loop and give up.
This is unfortunate when the potentially throwing condition is down a rare path. It prevents essentially all LICM of potentially faulting instructions where the faulting condition is checked outside the loop. It also greatly diminishes the utility of loop unswitching since control dependent instructions - which are now likely in the loops header block - will not be lifted by subsequent LICM runs.
define void @nothrow_header(i64 %x, i64 %y, i1 %cond) {
; CHECK-LABEL: nothrow_header
; CHECK-LABEL: entry
; CHECK: %div = udiv i64 %x, %y
; CHECK-LABEL: loop
; CHECK: call void @use(i64 %div)
entry:
br label %loop
loop: ; preds = %entry, %for.inc
%div = udiv i64 %x, %y
br i1 %cond, label %loop-if, label %exit
loop-if:
call void @use(i64 %div)
br label %loop
exit:
ret void
}
The current patch really only helps with non-memory instructions (i.e. divs, etc..) since the maythrow call down the rare path will be considered to alias an otherwise hoistable load. The one exception is that it does kick in for loads which are known to be invariant without regard to other possible stores, i.e. those marked with either !invarant.load metadata of tbaa 'is constant memory' metadata.
Differential Revision: http://reviews.llvm.org/D6725
llvm-svn: 224965
Chandler Carruth [Mon, 29 Dec 2014 22:57:21 +0000 (22:57 +0000)]
[cmake/multilib] Teach llgo to respect the LLVM_LIBDIR_SUFFIX variable for
multilib build and installs.
Summary:
This requires introducing a generated header to encapsulate the
LLVM_LIBDIR_SUFFIX value from the build system and push it into the go
code. From there, I've adjusted the gllgo code to systematically use
this rather than a raw "lib". This requires some awkwardness as one of
the flags *must* be "lib"-relative for compatibility with how gccgo
works. For that flag, we use ".." to back up a directory and then go
into the proper lib directory.
Differential Revision: http://reviews.llvm.org/D6795
llvm-svn: 224964
David Blaikie [Mon, 29 Dec 2014 22:53:52 +0000 (22:53 +0000)]
PR22051: Missing debug location on calls in dtor thunks in Windows.
llvm-svn: 224963
Chandler Carruth [Mon, 29 Dec 2014 22:50:30 +0000 (22:50 +0000)]
[go] Teach the go cmake build functions to funnel the include directories down into the cgo-setup variables of llvm-go.
Summary:
This in turn allows us to use #includes with cgo that rely on CMake
provided include directories which is particularly useful for handling
generated headers that aren't reasonable to put in an "installable"
location.
Differential Revision: http://reviews.llvm.org/D6798
llvm-svn: 224962
Philip Reames [Mon, 29 Dec 2014 22:46:21 +0000 (22:46 +0000)]
Loading from null is valid outside of addrspace 0
This patches fixes a miscompile where we were assuming that loading from null is undefined and thus we could assume it doesn't happen. This transform is perfectly legal in address space 0, but is not neccessarily legal in other address spaces.
We really should introduce a hook to control this property on a per target per address space basis. We may be loosing valuable optimizations in some address spaces by being too conservative.
Original patch by Thomas P Raoux (submitted to llvm-commits), tests and formatting fixes by me.
llvm-svn: 224961
David Blaikie [Mon, 29 Dec 2014 22:39:45 +0000 (22:39 +0000)]
Use std::find_if instead of manual loop.
llvm-svn: 224960
Rafael Espindola [Mon, 29 Dec 2014 22:14:35 +0000 (22:14 +0000)]
Convert test to llvm-readobj. NFC.
llvm-svn: 224959
Nico Weber [Mon, 29 Dec 2014 21:56:22 +0000 (21:56 +0000)]
Crash even less on malformed attributes in an incorrect location.
This is a follow-up to r224915. This adds a bit more line noise to the tests
added in that revision to make sure the parser is ready for a toplevel decl
after each incorrect line. Use this to move the tests up to where they belong.
This uncovered that the early return was missing a call to
ActOnTagDefinitionError(), so add that. (Also fixes at least one of the crashes
on SLi's bot.)
llvm-svn: 224958
Colin LeMahieu [Mon, 29 Dec 2014 21:33:45 +0000 (21:33 +0000)]
[Hexagon] Adding allocframe, post-increment circular immediate stores, post-increment circular register stores, and bit reversed post-increment stores.
llvm-svn: 224957
Alexey Samsonov [Mon, 29 Dec 2014 21:28:15 +0000 (21:28 +0000)]
Fix use-after-destruction introduced in r224924.
getMainExecutable() returns a std::string, assigning its result
to StringRef immediately creates a dangling pointer. This was
detected by half-broken fast-MSan-bootstrap bot.
llvm-svn: 224956
Colin LeMahieu [Mon, 29 Dec 2014 21:18:02 +0000 (21:18 +0000)]
[Hexagon] Fixing 224952 where an addressing mode update was missed.
llvm-svn: 224955
Saleem Abdulrasool [Mon, 29 Dec 2014 21:02:47 +0000 (21:02 +0000)]
Driver: convert a couple more instances to range based loops
More conversion to range based for loops rather than direct iterators with
dereferencing. NFC.
llvm-svn: 224954
Alexey Samsonov [Mon, 29 Dec 2014 20:59:02 +0000 (20:59 +0000)]
Remove unnecessary StringRef->std::string conversion.
llvm-svn: 224953
Colin LeMahieu [Mon, 29 Dec 2014 20:44:51 +0000 (20:44 +0000)]
[Hexagon] Adding post-increment register form stores and register-immediate form stores with tests.
llvm-svn: 224952
Colin LeMahieu [Mon, 29 Dec 2014 20:00:43 +0000 (20:00 +0000)]
[Hexagon] Replacing the remaining postincrement stores with versions that have encoding bits.
llvm-svn: 224951
Rafael Espindola [Mon, 29 Dec 2014 19:50:32 +0000 (19:50 +0000)]
Convert test to FileCheck. NFC.
llvm-svn: 224950
Colin LeMahieu [Mon, 29 Dec 2014 19:42:14 +0000 (19:42 +0000)]
[Hexagon] Renaming old multiclass for removal. Adding post-increment store classes and instruction defs.
llvm-svn: 224949
Chandler Carruth [Mon, 29 Dec 2014 19:36:05 +0000 (19:36 +0000)]
[py3] Teach the CMake build to reject Python versions older than 2.7.
Continue to require Python 2 however as recent experiments suggest
LLDB's build requires it.
llvm-svn: 224948
Chandler Carruth [Mon, 29 Dec 2014 19:23:31 +0000 (19:23 +0000)]
[py3] Make this test compatible with Python 3 where bytes and
strings don't mix so easily. This fixes the last remaining failure
I have in 'check-all' on a system with both Python3 and and Python2
installed.
llvm-svn: 224947
Alexey Samsonov [Mon, 29 Dec 2014 19:21:59 +0000 (19:21 +0000)]
Remove darwin_fat.mk.
Summary:
Its seems to be replaced by clang_darwin.mk in the Makefile-based
build, and is only referenced in unittest scripts, which are
broken for a long time now.
Test Plan: n/a
Reviewers: bob.wilson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6574
llvm-svn: 224946
David Majnemer [Mon, 29 Dec 2014 19:19:18 +0000 (19:19 +0000)]
Parse: Ignore '::' in 'struct :: {'
Let's pretend that we didn't see the '::' instead of go on believing
that we've got some anonymous, but globally qualified, struct.
llvm-svn: 224945
Saleem Abdulrasool [Mon, 29 Dec 2014 19:01:36 +0000 (19:01 +0000)]
Driver: convert a number of loops to range based
Iterate over the arguments via range based for loops rather than iterators and
explicitly dereferencing them. NFC.
llvm-svn: 224944
David Blaikie [Mon, 29 Dec 2014 18:37:03 +0000 (18:37 +0000)]
Add an assertion to verify a container is non-empty before calling 'back()'
This would've helped stabilize/deflake some failures that were seen
after some recent changes.
llvm-svn: 224943
David Blaikie [Mon, 29 Dec 2014 18:19:36 +0000 (18:19 +0000)]
Reapply debug info changes now that r224385 has been recommitted to clang (in r224941)
llvm-svn: 224942
David Blaikie [Mon, 29 Dec 2014 18:18:45 +0000 (18:18 +0000)]
Reapply "DebugInfo: Generalize debug info location handling"
Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).
Original commit message:
This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.
This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.
I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.
Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.
I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.
llvm-svn: 224941
Craig Topper [Mon, 29 Dec 2014 16:25:26 +0000 (16:25 +0000)]
[X86] Fix some cases where some 8-bit instructions were marked as being convertible to three address instructions, but aren't really.
llvm-svn: 224940
Craig Topper [Mon, 29 Dec 2014 16:25:23 +0000 (16:25 +0000)]
[X86] Add the 0x82 instructions to the disassebmler. They are identical in functionality to the 0x80 opcode instructions, but are not valid in 64-bit mode.
llvm-svn: 224939
Craig Topper [Mon, 29 Dec 2014 16:25:22 +0000 (16:25 +0000)]
[x86] Refactor some tablegen instruction info classes slightly to prepare for another change. NFC.
llvm-svn: 224938
Craig Topper [Mon, 29 Dec 2014 16:25:19 +0000 (16:25 +0000)]
[x86] Remove unused classes from tablegen instruction info.
llvm-svn: 224937
Rafael Espindola [Mon, 29 Dec 2014 15:47:28 +0000 (15:47 +0000)]
Add segmented stack support for DragonFlyBSD.
Patch by Michael Neumann.
llvm-svn: 224936
Rafael Espindola [Mon, 29 Dec 2014 15:18:31 +0000 (15:18 +0000)]
Refactor duplicated code.
No intended functionality change.
llvm-svn: 224935
Chandler Carruth [Mon, 29 Dec 2014 13:29:38 +0000 (13:29 +0000)]
Effectively revert r151058 which caused Clang's unwind.h to defer to
libunwind in all cases when installed.
At the time, Clang's unwind.h didn't provide huge chunks of the
LSB-specified unwind interface, and was generally too aenemic to use for
real software. However, it has since then become a strict superset of
the APIs provided by libunwind on Linux. Notably, you cannot compile
llgo's libgo library against libunwind, but you can against Clang's
unwind.h. So let's just use our header. =] I've checked pretty
thoroughly for any incompatibilities, and I am not aware of any.
An open question is whether or not we should continue to munge
GNU_SOURCE here. I didn't touch that as it potentially has compatibility
implications on systems I cannot easily test -- Darwin. If a Darwin
maintainer can verify that this is in fact unnecessary and remove it,
cool. Until then, leaving it in makes this change a no-op there, and
only really relevant on Linux systems where it is pretty clearly the
right way to go.
llvm-svn: 224934
Chandler Carruth [Mon, 29 Dec 2014 13:29:36 +0000 (13:29 +0000)]
Add a missing declaration to our unwind.h implementation. This is
necessary to be fully compatible with existing software that calls into
the linux unwind code. You can find documentation of this API and why it
exists in the discussion abot NPTL here:
https://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html
llvm-svn: 224933
Andy Gibbs [Mon, 29 Dec 2014 13:03:19 +0000 (13:03 +0000)]
Fix trivial signed/unsigned comparison warnings
llvm-svn: 224932
Peter Collingbourne [Mon, 29 Dec 2014 13:01:28 +0000 (13:01 +0000)]
irgen: remove unused compiler.runtimetypespkg field.
llvm-svn: 224931