1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

134 Commits

Author SHA1 Message Date
Adrian Prantl
928122c28f Pass length of string in Go binding of CreateCompileUnit 2020-01-17 13:35:30 -08:00
Adrian Prantl
3363ed7b0a Move the sysroot attribute from DIModule to DICompileUnit
[this re-applies c0176916a4824812d25a5a22c4ff7c95857b0cd6
 with the correct commit message and phabricator link]

This addresses point 1 of PR44213.
https://bugs.llvm.org/show_bug.cgi?id=44213

The DW_AT_LLVM_sysroot attribute is used for Clang module debug info,
to allow LLDB to import a Clang module from source. Currently it is
part of each DW_TAG_module, however, it is the same for all modules in
a compile unit. It is more efficient and less ambiguous to store it
once in the DW_TAG_compile_unit.

This should have no effect on DWARF consumers other than LLDB.

Differential Revision: https://reviews.llvm.org/D71732
2020-01-17 12:55:40 -08:00
Adrian Prantl
e3aa322358 Revert "Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot"
This reverts commit 12e479475a896f664fb721f98c2d6805185ac352.

I accidentally landed this patch with the wrong commit message ...
2020-01-17 12:52:36 -08:00
Adrian Prantl
6333dc4541 Revert "Attempt to fix Go syntax error"
This reverts commit c0176916a4824812d25a5a22c4ff7c95857b0cd6.
2020-01-17 12:52:25 -08:00
Adrian Prantl
5c0aa3ac1a Attempt to fix Go syntax error 2020-01-17 12:37:15 -08:00
Adrian Prantl
e436ebc793 Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot
This is a purely cosmetic change that is NFC in terms of the binary
output. I bugs me that I called the attribute DW_AT_LLVM_isysroot
since the "i" is an artifact of GCC command line option syntax
(-isysroot is in the category of -i options) and doesn't carry any
useful information otherwise.

This attribute only appears in Clang module debug info.

Differential Revision: https://reviews.llvm.org/D71722
2020-01-17 09:36:48 -08:00
Ayke van Laethem
b8b1c0544c [bindings/go] Add Subprogram method
This method allows getting the subprogram metadata object from a
function value.

Differential Revision: https://reviews.llvm.org/D71528
2020-01-03 22:17:46 +01:00
Kadir Cetinkaya
fb7e5ffa24 [llvm][bindings][go] Fix typo 2019-12-03 09:30:32 +01:00
Sourabh Singh Tomar
31018106ef Recommit "[DWARF5]Addition of alignment atrribute in typedef DIE."
This revision is revised to update Go-bindings and Release Notes.

The original commit message follows.

This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE.
When explicit alignment is specified.

Patch by Awanish Pandey <Awanish.Pandey@amd.com>

Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok,
deadalinx

Differential Revision: https://reviews.llvm.org/D70111
2019-12-03 09:51:43 +05:30
Djordje Todorovic
a84a1220f4 [DebugInfo] Remove the DIFlagArgumentNotModified debug info flag
Due to changes in D68206, we remove the DIFlagArgumentNotModified
and its usage.

Differential Revision: https://reviews.llvm.org/D68207
2019-11-20 13:18:40 +01:00
Kai Luo
8758920112 Revert "[Bindings][Go] Fix go.test failure due to missing argument"
This reverts commit 88235812a71d99c082e7aa2ef9356d43d1f83a80 due to
d27a16eb392f39f9ee04ff5194b1eff3e189e6f8.
2019-11-19 09:59:43 +08:00
Kai Luo
6f66840d08 [Bindings][Go] Fix go.test failure due to missing argument
go.test failed with error
```
/tmp/gopath431502532/src/llvm.org/llvm/bindings/go/llvm/dibuilder.go:514:40: not enough arguments in call to _Cfunc_LLVMDIBuilderCreateTypedef
        have (_Ctype_LLVMDIBuilderRef, _Ctype_LLVMMetadataRef, *_Ctype_char, _Ctype_ulong, _Ctype_LLVMMetadataRef, _Ctype_uint, _Ctype_LLVMMetadataRef)
        want (*_Ctype_struct_LLVMOpaqueDIBuilder, *_Ctype_struct_LLVMOpaqueMetadata, *_Ctype_char, _Ctype_ulong, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint)
```
This patch fixes above error.

Differential Revision: https://reviews.llvm.org/D70360
2019-11-19 09:07:37 +08:00
Adrian Prantl
d0dc528032 Remove the obsolete BlockByRefStruct flag from LLVM IR
DIFlagBlockByRefStruct is an unused DIFlag that originally was used by
clang to express (Objective-)C block captures in debug info. For the
last year Clang has been emitting complex DIExpressions to describe
block captures instead, which makes all the code supporting this flag
redundant.

This patch removes the flag and all supporting "dead" code, so we can
reuse the bit for something else in the future.

Since this only affects debug info generated by Clang with the block
extension this mostly affects Apple platforms and I don't have any
bitcode compatibility concerns for removing this. The Verifier will
reject debug info that uses the bit and thus degrade gracefully when
LTO'ing older bitcode with a newer compiler.

rdar://problem/44304813

Differential Revision: https://reviews.llvm.org/D67453

llvm-svn: 372272
2019-09-18 22:38:56 +00:00
Benjamin Kramer
33caf354b4 Bump llvm-go to C++14
llvm-svn: 368989
2019-08-15 10:55:25 +00:00
Djordje Todorovic
c9a5c0787f [IR/DIVar] Add the flag for params that have unmodified value
Introduce the debug info flag that indicates that a parameter has unchanged
value throughout a function. This info will be used to emit the expressions
with DW_OP_entry_value.

([4/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>

Differential Revision: https://reviews.llvm.org/D58034

llvm-svn: 364406
2019-06-26 11:19:26 +00:00
Ayke van Laethem
4645f9cb65 [bindings/go] Add debug information accessors
Add debug information accessors, as provided in the following patches:

https://reviews.llvm.org/D46627 (DILocation)
https://reviews.llvm.org/D52693 metadata kind
https://reviews.llvm.org/D60481 get/set debug location on a Value
https://reviews.llvm.org/D60489 (DIScope)

The API as proposed in this patch is similar to the current Value API,
with a single root type and methods that are only valid for certain
subclasses. I have considered just implementing generic Line() calls
(that are valid on all DINodes that have a line) but the implementation
of that got a bit awkward without support from the C API. I've also
considered creating generic getters like a Metadata.DebugLoc() that
returns a DebugLoc, but there is a mismatch between the Go DI nodes in
the LLVM API and the actual DINode class hierarchy, so that's also hard
to get right (without being confusing or breaking the API).

Differential Revision: https://reviews.llvm.org/D63056

llvm-svn: 364198
2019-06-24 16:23:17 +00:00
Ayke van Laethem
0e2df1660a [bindings/go][NFC] Format code with go fmt
Run go fmt (version 1.12) over the Go bindings. This cleans up lots of
inconsistencies in the code, it does not change the code in a functional
way.

Differential Revision: https://reviews.llvm.org/D63057

llvm-svn: 363148
2019-06-12 11:59:09 +00:00
Ayke van Laethem
7d6b8741a2 [bindings/go] Add wrappers for atomic operations.
This patch adds Go bindings for atomic operations in LLVM.

Differential Revision: https://reviews.llvm.org/D61034

llvm-svn: 362899
2019-06-09 10:06:35 +00:00
Ayke van Laethem
4390ba5b81 [bindings/go] Add bindings to LLVMGet?CmpPredicate
Add bindings so that predicates on comparisons (icmp/fcmp) can be
inspected from IR.

Note: I considered adding Value.ICmpPredicate() etc. instead but
Value.IntPredicate() seemed easier to read and matches the name of the
returned type.

(This change was also pushed two commits ago but accidentally had the
wrong title and description.)

Revision: https://reviews.llvm.org/D53884
llvm-svn: 362893
2019-06-08 22:21:37 +00:00
Ayke van Laethem
31cbc86342 Revert "[bindings/go] Add Go bindings for CalledValue"
This reverts commit f675a60ca7a93f22e22dd4209504a9846dd04630.
The commit had the wrong title/description. Sorry about the mess!

llvm-svn: 362892
2019-06-08 22:17:51 +00:00
Ayke van Laethem
bdf7e2e7bd [bindings/go] Add Go bindings for CalledValue
This is very useful for inspecting generated IR, there appears to be no
other way to get the called function from a CallInst.

Differential Revision: https://reviews.llvm.org/D52972

llvm-svn: 362891
2019-06-08 22:15:38 +00:00
Ayke van Laethem
06a69245a1 [bindings/go] Add Go bindings for CalledValue
This is very useful for inspecting generated IR, there appears to be no
other way to get the called function from a CallInst.

Revision: https://reviews.llvm.org/D52972
llvm-svn: 362890
2019-06-08 22:08:52 +00:00
Ayke van Laethem
a1af64264e [bindings/go] Add EraseFromParent
After using ReplaceAllUsesWith on an instruction, it may be necessary to
erase it even though it is dead.

llvm-svn: 362889
2019-06-08 22:00:19 +00:00
Ayke van Laethem
fa896f12c9 [NFC] Test commit
Add a newline, which is missing according to go fmt.

llvm-svn: 362888
2019-06-08 21:42:00 +00:00
Richard Trieu
84feefcd69 Fix bad go bindings test.
After r362128, the "byval" attribute has a stricter check and will cause an
assertion.  Remove the "byval" test case for now.

llvm-svn: 362189
2019-05-31 03:45:11 +00:00
Robert Widmann
d387cfbada [LLVM-C] Correct The Current Debug Location Accessors (Again)
Summary: Resubmitting D60484 with the conflicting Go bindings renamed to avoid collisions.

Reviewers: whitequark, deadalnix

Subscribers: hiraditya, llvm-commits, sammccall

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60511

llvm-svn: 358086
2019-04-10 14:19:05 +00:00
whitequark
9de745c81c [bindings/go] Fix building on 32-bit systems (ARM etc.)
Summary:
The patch in https://reviews.llvm.org/D53883 (by me) fails to build on 32-bit systems like ARM. Fix the array size to be less ridiculously large. 2<<20 should still be enough for all practical purposes.

Bug: https://bugs.llvm.org/show_bug.cgi?id=40426

Reviewers: whitequark, pcc

Reviewed By: whitequark

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58030

llvm-svn: 354207
2019-02-16 22:33:10 +00:00
Leonard Chan
9cbbc6a096 [NewPM] Second attempt at porting ASan
This is the second attempt to port ASan to new PM after D52739. This takes the
initialization requried by ASan from the Module by moving it into a separate
class with it's own analysis that the new PM ASan can use.

Changes:
- Split AddressSanitizer into 2 passes: 1 for the instrumentation on the
  function, and 1 for the pass itself which creates an instance of the first
  during it's run. The same is done for AddressSanitizerModule.
- Add new PM AddressSanitizer and AddressSanitizerModule.
- Add legacy and new PM analyses for reading data needed to initialize ASan with.
- Removed DominatorTree dependency from ASan since it was unused.
- Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the
  new PM analysis holds these 2 classes and will need to expose them.

Differential Revision: https://reviews.llvm.org/D56470

llvm-svn: 353985
2019-02-13 22:22:48 +00:00
Hans Wennborg
8b23ed2ade Fix format string in bindings/go/llvm/ir_test.go (PR40561)
The test started failing for me recently. I don't see any changes around
this code, so maybe it's my local go version that changed or something.

The error seems real to me: we're trying to print an Attribute with %d.
The test talks about "attribute masks" I'm not sure what that refers to,
but I suppose we could print the raw pointer value, since that's
what the test seems to be comparing.

Differential revision: https://reviews.llvm.org/D57672

llvm-svn: 353155
2019-02-05 11:01:54 +00:00
Chandler Carruth
ae65e281f3 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Philip Pfaffe
102ecb8ab9 [NewPM][TSan] Reiterate the TSan port
Summary:
Second iteration of D56433 which got reverted in rL350719. The problem
in the previous version was that we dropped the thunk calling the tsan init
function. The new version keeps the thunk which should appease dyld, but is not
actually OK wrt. the current semantics of function passes. Hence, add a
helper to insert the functions only on the first time. The helper
allows hooking into the insertion to be able to append them to the
global ctors list.

Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan

Subscribers: hiraditya, bollu, llvm-commits

Differential Revision: https://reviews.llvm.org/D56538

llvm-svn: 351314
2019-01-16 09:28:01 +00:00
Jorge Gorbe Moya
74b18e5174 Revert "Fix go bindings for r350647: missed a function rename"
This reverts commit a74266858a8164cfb23d4e138cd4c7c37be0b5d1. SVN revision r350657.

llvm-svn: 350790
2019-01-10 01:51:54 +00:00
Jorge Gorbe Moya
2dd391bb95 Fix go bindings for r350647: missed a function rename
Differential Revision: https://reviews.llvm.org/D56452

llvm-svn: 350657
2019-01-08 21:45:42 +00:00
Philip Pfaffe
65df098609 [NewPM] Port Msan
Summary:
Keeping msan a function pass requires replacing the module level initialization:
That means, don't define a ctor function which calls __msan_init, instead just
declare the init function at the first access, and add that to the global ctors
list.

Changes:
- Pull the actual sanitizer and the wrapper pass apart.
- Add a newpm msan pass. The function pass inserts calls to runtime
  library functions, for which it inserts declarations as necessary.
- Update tests.

Caveats:
- There is one test that I dropped, because it specifically tested the
  definition of the ctor.

Reviewers: chandlerc, fedor.sergeev, leonardchan, vitalybuka

Subscribers: sdardis, nemanjai, javed.absar, hiraditya, kbarton, bollu, atanasyan, jsji

Differential Revision: https://reviews.llvm.org/D55647

llvm-svn: 350305
2019-01-03 13:42:44 +00:00
whitequark
f26528e6d8 [bindings/go] Add Go bindings to LLVMGetIndices
Summary: This instruction is useful for inspecting extractvalue/insertvalue in IR. Unlike most other operations, indices cannot be inspected using the generic Value.Opcode() function so a specialized function needs to be added.

Reviewers: whitequark, pcc

Reviewed By: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53883

llvm-svn: 346388
2018-11-08 04:04:04 +00:00
Chandler Carruth
d0fc3bc097 [TI removal] Remove TerminatorInst references from bindings.
For the Go bindings, this just removes the no longer useful "isa"-style
wrapper. If there is a user that is interested, they can add a wrapper
for `Instruction::isTerminator`.

For the OCaml bindings, this is just a documentation update.

llvm-svn: 344726
2018-10-18 07:40:03 +00:00
whitequark
5762149801 [bindings/go] Add Go bindings to the Token type
Summary: This type is necessary for implementing coroutines.

Reviewers: whitequark

Reviewed By: whitequark

Subscribers: modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D47684

llvm-svn: 343345
2018-09-28 17:39:59 +00:00
whitequark
cb1976a242 [bindings/go] Add Go bindings for inline assembly
Reviewers: harlanhaskins, whitequark, pcc

Reviewed By: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46437

llvm-svn: 343339
2018-09-28 16:48:47 +00:00
whitequark
7a1938f4de Revert "[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints"
This reverts commit c4baf7c2f06ff5459c4f5998ce980346e72bff97.

Broke the bots, and should really be in Transforms/Coroutines
instead.

llvm-svn: 343337
2018-09-28 16:45:18 +00:00
whitequark
16e77f9e56 [LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints
Summary: This patch adds bindings to C and Go for addCoroutinePassesToExtensionPoints, which is used to add coroutine passes to the correct locations in PassManagerBuilder.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: mehdi_amini, modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D51642

llvm-svn: 343336
2018-09-28 16:38:11 +00:00
Peter Collingbourne
fdc75b32a2 [bindings/go] Add DebugLoc parameter to InsertXXXAtEnd()
These functions previously passed nil for the location, which always resulted in a crash.

This is a signature breaking change, but I cannot see how they could have been used before.

Patch by Ben Clayton!

Differential Revision: https://reviews.llvm.org/D51970

llvm-svn: 342179
2018-09-13 21:16:39 +00:00
Kristina Brooks
d485c67d9a [Bindings][Go] Fixed go.test failure due to C-API argument type mismatch.
go.test was failing previously with error,
Command Output (stderr):
dibuilder.go:301: cannot use C.uint(t.Encoding) (type C.uint) as type
C.LLVMDWARFTypeEncoding in argument to func literal
This patch fixes the argument type.

Patch by Chirag (Chirag Patel)

Differential Revision: https://reviews.llvm.org/D51721

llvm-svn: 341680
2018-09-07 17:33:43 +00:00
David Green
61ff754920 [AArch64] Add Tiny Code Model for AArch64
This adds the plumbing for the Tiny code model for the AArch64 backend. This,
instead of loading addresses through the normal ADRP;ADD pair used in the Small
model, uses a single ADR. The 21 bit range of an ADR means that the code and
its statically defined symbols need to be within 1MB of each other.

This makes it mostly interesting for embedded applications where we want to fit
as much as we can in as small a space as possible.

Differential Revision: https://reviews.llvm.org/D49673

llvm-svn: 340397
2018-08-22 11:31:39 +00:00
whitequark
54ca0ea307 [bindings/go] Add coroutine passes
Add Go bindings for CoroEarly, CoroSplit, CoroElide and CoroCleanup.

Differential Revision: https://reviews.llvm.org/D50951

llvm-svn: 340148
2018-08-19 23:40:05 +00:00
whitequark
b8bf292fc1 [C-API][DIBuilder] Added DIFlags in LLVMDIBuilderCreateBasicType
Added DIFlags in LLVMDIBuilderCreateBasicType to add optional DWARF
attributes, such as DW_AT_endianity.

Patch by Chirag Patel.

Differential Revision: https://reviews.llvm.org/D50832

llvm-svn: 340146
2018-08-19 23:39:47 +00:00
Robert Widmann
da45726713 [LLVM-C] Consolidate llgo's DIBuilder Bindings
Summary: Move and correct LLVMDIBuilderCreateTypedef.  This is the last API in DIBuilderBindings.h, so it is being removed and the C API will now be re-exported from IRBindings.h.

Reviewers: whitequark, harlanhaskins, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46725

llvm-svn: 332041
2018-05-10 21:10:06 +00:00
Robert Widmann
527415c9d3 [LLVM-C] Move DIBuilder Bindings For Temporary MDNodes
Summary: Move LLVMTemporaryMDNode and LLVMMetadataReplaceAllUsesWith to the C bindings and add LLVMDeleteTemporaryMDNode for deleting non-RAUW'ed temporary nodes.

Reviewers: whitequark, harlanhaskins, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46632

llvm-svn: 332010
2018-05-10 18:09:53 +00:00
Robert Widmann
fcc8db1fcc [LLVM-C] Correct types in Go bindings
Summary: Fixes a test failure introduced in rL331114.

Reviewers: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46631

llvm-svn: 331850
2018-05-09 06:45:28 +00:00
David Bolvansky
985bfa0f77 [bindings/go] Add Go bindings for volatile loads/stores
Reviewers: whitequark

Reviewed By: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46235

llvm-svn: 331530
2018-05-04 15:14:00 +00:00
Benjamin Kramer
80c3f40425 [bindings] Fix dibuilder go bindings after r331114.
llvm-svn: 331171
2018-04-30 12:48:45 +00:00