4007 Commits

Author SHA1 Message Date
Eric Christopher
03d462db72 Move getNumFrameInfos and getDwarfFrameInfos out of line and remove
the MCDwarf.h include.

This removes 50 transitive dependencies for a modification of
MCDwarf.h in a build of llc for a pair of out of line functions
and reduces the build overhead of 'touch MCDwarf.h" by 15% without
impacting test time of check-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358264 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 07:42:35 +00:00
Eric Christopher
5594c48b1c Move addInitialFrameState out of line and remove the MCDwarf.h include.
This removes 50 transitive dependencies for a modification of
MCDwarf.h in a build of llc for a single out of line function
and reduces the build overhead by 20% without impacting test
time of check-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358258 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 06:57:45 +00:00
Fangrui Song
77dd066466 MCDwarfLineTableheader::tryGetFile : replace a loop with llvm::find
Note, `DirIndex++` below is incorrect for DWARF 5, but it can be fixed
later after the file index is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358251 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 04:55:10 +00:00
Eric Christopher
a588917c3b Move a couple of optional references to just optional to make the
forwarding APIs look similar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358250 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 03:49:13 +00:00
Fangrui Song
c77c306949 [MC] Fix typo: .symtab_shndxr -> .symtab_shndx
This special section is named .symtab_shndx, according to gABI Chapter 4
Sections, and the name is used by some other tools. Though the section
type SHT_SYMTAB_SHNDX is what really matters, let's fix the typo
introduced in rL204769 :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358247 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 02:16:15 +00:00
Eric Christopher
2ff866e5e8 Remove a parameter that was being passed around that we had at the
local callsite.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358244 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 01:02:02 +00:00
Ali Tamur
b7bce147ad [llvm] Non-functional change: declared a local variable as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358120 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 18:30:03 +00:00
Fangrui Song
6871d0a330 MCSymbolicELF: simplify. (Flags & (x << s)) >> s is equivalent to Flags >> s & x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358067 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 10:30:22 +00:00
Fangrui Song
1d88b25399 MCDwarf: use write_zeroes for MCDwarfLineAddr::FixedEncode
This is more efficient than allocating a std::vector<uint8_t>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358066 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 09:41:48 +00:00
Fangrui Song
8d84ad6695 [llvm-objdump] Don't print trailing space in dumpBytes
In disassembly output, dumpBytes prints a space, followed by a tab
printed by printInstr. Remove the extra space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358045 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 05:31:21 +00:00
Eric Christopher
7cc761f09b NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.
Differential Revision: https://reviews.llvm.org/D60290

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357736 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 23:34:38 +00:00
Sam Clegg
c1819f5966 [WebAssembly] Add new explicit relocation types for PIC relocations
See https://github.com/WebAssembly/tool-conventions/pull/106

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357710 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 17:43:50 +00:00
Eli Friedman
589b088809 [MC] Fix floating-point literal lexing.
This patch has three related fixes to improve float literal lexing:

1. Make AsmLexer::LexDigit handle floats without a decimal point more
   consistently.
2. Make AsmLexer::LexFloatLiteral print an error for floats which are
   apparently missing an "e".
3. Make APFloat::convertFromString use binutils-compatible exponent
   parsing.

Together, this fixes some cases where a float would be incorrectly
rejected, fixes some cases where the compiler would crash, and improves
diagnostics in some cases.

Patch by Brandon Jones.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357214 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 21:12:28 +00:00
Sam Clegg
0c6b3a0db8 [WebAssembly] Rename wasm fixup kinds
These fixup kinds are not explicitly related to the code section.  They
are there to signal how to apply the fixup.

Also, a couple of other minor wasm cleanups.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357145 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-28 02:07:28 +00:00
Francis Visoiu Mistrih
0c810b46bd [Remarks] Emit a section containing remark diagnostics metadata
A section containing metadata on remark diagnostics will be emitted if
the flag (-mllvm) -remarks-section is present.

For now, the metadata is:

* a magic number for remarks: "REMARKS\0"
* the version number: a little-endian uint64_t
* the absolute file path to the serialized remark diagnostics: a
  null-terminated string.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-27 01:13:59 +00:00
Ali Tamur
02bbadc923 Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5.""
This reverts commit rL357020.

The commit broke the test llvm/test/tools/llvm-objdump/embedded-source.test
on some builds including clang-ppc64be-linux-multistage,
clang-s390x-linux, clang-with-lto-ubuntu, clang-x64-windows-msvc,
llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast (and others).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357026 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 20:05:27 +00:00
Sam Clegg
23fe8db89f [WebAssembly] Initial implementation of PIC code generation
This change implements lowering of references global symbols in PIC
mode.

This change implements lowering of global references in PIC mode using a
new @GOT reference type. @GOT references can be used with function or
data symbol names combined with the get_global instruction. In this case
the linker will insert the wasm global that stores the address of the
symbol (either in memory for data symbols or in the wasm table for
function symbols).

For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation
type for this type of reference which means that this relocation type
can refer to either a global or a function or data symbol. We could
choose to introduce specific relocation types for GOT entries in the
future.  See the current dynamic linking proposal:

https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357022 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 19:46:15 +00:00
Ali Tamur
d42f155408 [llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."
Reapply rL356941 after regenerating the object file in the failing test
llvm/test/tools/llvm-objdump/embedded-source.test from source.

Original commit message:

[llvm] Prevent duplicate files in debug line header in dwarf 5.

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Tags: #llvm, #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357018 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 18:53:23 +00:00
Ali Tamur
a81909135b Revert "[llvm] Prevent duplicate files in debug line header in dwarf 5."
This reverts commit 312ab05887d0e2caa29aaf843cefe39379a98d36.

My commit broke the build; I will revert and find out what happened.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356951 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 21:09:07 +00:00
Ali Tamur
428cbbbec8 [llvm] Prevent duplicate files in debug line header in dwarf 5.
Summary:

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Reviewers: dblaikie, probinson, aprantl, espindola

Reviewed By: probinson

Subscribers: emaste, jvesely, nhaehnle, aprantl, javed.absar, arichardson, hiraditya, MaskRay, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356941 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 20:08:00 +00:00
George Rimar
3cf84d2ef2 [llvm-objcopy] - Fix a st_name of the first symbol table entry.
Spec says about the first symbol table entry that index 0 both designates the first entry in the table
and serves as the undefined symbol index. It should have zero value.
Hence the first symbol table entry has no name. And so has to have a st_name == 0.
(http://refspecs.linuxbase.org/elf/gabi4+/ch4.symtab.html)

Currently, we do not emit zero value for the first symbol table entry.
That happens because we add empty strings to the string builder, which
for each such case adds a zero byte:
(https://github.com/llvm-mirror/llvm/blob/master/lib/MC/StringTableBuilder.cpp#L185)
After the string optimization performed it might return non zero indexes for the
empty string requested.

The patch fixes this issue for the case above and other sections with no names.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356739 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 10:28:56 +00:00
Thomas Lively
39812314f7 [WebAssembly] Target features section
Summary:
Implements a new target features section in assembly and object files
that records what features are used, required, and disallowed in
WebAssembly objects. The linker uses this information to ensure that
all objects participating in a link are feature-compatible and records
the set of used features in the output binary for use by optimizers
and other tools later in the toolchain.

The "atomics" feature is always required or disallowed to prevent
linking code with stripped atomics into multithreaded binaries. Other
features are marked used if they are enabled globally or on any
function in a module.

Future CLs will add linker flags for ignoring feature compatibility
checks and for specifying the set of allowed features, implement using
the presence of the "atomics" feature to control the type of memory
and segments in the linked binary, and add front-end flags for
relaxing the linkage policy for atomics.

Reviewers: aheejin, sbc100, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, mgrang, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356610 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 20:26:45 +00:00
Markus Lavin
6ce55cd841 [DebugInfo] Introduce DW_OP_LLVM_convert
Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

This is a recommit of r356442 with trivial fixes for the failing tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356451 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 13:16:28 +00:00
Markus Lavin
58648f0890 Revert "[DebugInfo] Introduce DW_OP_LLVM_convert"
This reverts commit 1cf4b593a7ebd666fc6775f3bd38196e8e65fafe.

Build bots found failing tests not detected locally.

Failing Tests (3):
  LLVM :: DebugInfo/Generic/convert-debugloc.ll
  LLVM :: DebugInfo/Generic/convert-inlined.ll
  LLVM :: DebugInfo/Generic/convert-linked.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356444 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 09:17:28 +00:00
Markus Lavin
1cf4b593a7 [DebugInfo] Introduce DW_OP_LLVM_convert
Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356442 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 08:48:19 +00:00
Eli Friedman
a092a834c4 [MC] Sort FDEs by the associated CIE before emitting them.
This isn't necessary according to the DWARF standard, but it matches the
.eh_frame sections emitted by other tools in practice, and the Android
libunwindstack rejects .eh_frame sections where an FDE refers to a CIE
other than the closest previous CIE. So match the other tools and also
sort accordingly.

I consider this a bug in libunwindstack, but it's easy enough to emit
a compatible .eh_frame section for compatibility with installed
operating systems.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356216 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 23:08:19 +00:00
Jason Liu
e98bc0b63e Add XCOFF triple object format type for AIX
This patch adds an XCOFF triple object format type into LLVM.
This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355989 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 22:01:10 +00:00
Evgeniy Stepanov
cc5a8c21af Remove ASan asm instrumentation.
Summary: It is incomplete and has no users AFAIK.

Reviewers: pcc, vitalybuka

Subscribers: srhines, kubamracek, mgorny, krytarowski, eraman, hiraditya, jdoerfert, #sanitizers, llvm-commits, thakis

Tags: #sanitizers, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355870 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 21:50:10 +00:00
Francis Visoiu Mistrih
bbe4f9c7c5 [MC][MachO] Emit an error for emitting relocations of the form -SYM + cst
Emit an error for an unsupported relocation. mach-o relocations can't
encode the form -SYM + cst.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355527 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 18:10:41 +00:00
Craig Topper
99a4c92625 [Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single array.
These arrays are both keyed by CPU name and go into the same tablegenerated file. Merge them so we only need to store keys once.

This also removes a weird space saving quirk where we used the ProcDesc.size() to create to build an ArrayRef for ProcSched.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355431 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:54:38 +00:00
Craig Topper
8bc601fd43 [Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove fields from the stack tables that aren't needed for CPUs
The description for CPUs was just the CPU name wrapped with "Select the " and " processor". We can just do that directly in the help printer instead of making a separate version in the binary for each CPU.

Also remove the Value field that isn't needed and was always 0.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355429 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:54:34 +00:00
Craig Topper
cd52d11df4 [Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.
The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355428 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:54:30 +00:00
Nirav Dave
1e15b24cc4 [MC] Teach ELFObjectWriter that parse-time variables do not appear in
symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355325 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 19:12:56 +00:00
Wouter van Oortmerssen
328c033552 [WebAssembly] Add support for data sections in the assembler.
Summary:
This is quite minimal so far, introduce them with .section,
fill them with .int8 or .asciz, end with .size

Reviewers: dschuff, sbc100, aheejin

Subscribers: jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355321 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 17:18:04 +00:00
Craig Topper
38ebbb2cf9 [SubtargetFeatures] Add operator< for comparing SubtargetInfoKV objects. NFCI
Use instead of passing a lambda to std::is_sorted. This is more consistent with SubtargetFeatureKV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355300 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 04:26:31 +00:00
Craig Topper
f45a7a3b4f [SubtargetFeatures] Don't call ApplyFeatureFlag if the feature name is '+help'
Just print the help and stop. Otherwise we'll print a message about it not being a real feature name after printing the help text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355299 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 02:02:24 +00:00
Craig Topper
c302fe2d33 [SubtargetFeatuers] Simplify the code used to imply features from CPU name.
If we make SetImpliedBits OR features outside of its loop, we can reuse it for the first round of implying features for CPUs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355298 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 02:02:22 +00:00
Paul Robinson
8ee60b0a80 Try to fix Windows bots after r355226.
Windows has two path separator characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355235 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 22:28:13 +00:00
Paul Robinson
f3284d8600 [DWARF] Make -g with empty assembler source work better.
This was sometimes causing clang or llvm-mc to crash, and in other
cases could emit a bogus DWARF line-table header. I did an interim
patch in r352541; this patch should be a cleaner and more complete
fix, and retains the test.

Addresses PR40538.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355226 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 20:58:04 +00:00
Craig Topper
78b4cefc3c [Subtarget] Remove static global constructor call from the tablegened subtarget feature tables
Subtarget features are stored in a std::bitset that has been subclassed. There is a special constructor to allow the tablegen files to provide a list of bits to initialize the std::bitset to. This constructor isn't constexpr and std::bitset doesn't support many constexpr operations either. This results in a static global constructor being used to initialize the feature bitsets in these files at startup.

To fix this I've introduced a new FeatureBitArray class that holds three 64-bit values representing the initial bit values and taught tablegen to emit hex constants for them based on the feature enum values. This makes the tablegen files less readable than they were before. I can add the list of features back as a comment if we think that's important.

I've added a method to convert from this class into the std::bitset subclass we had before. I considered making the new FeatureBitArray class just implement the std::bitset interface we need instead, but thought I'd see how others felts about that first.

I've simplified the interfaces to SetImpliedBits and ClearImpliedBits a little minimize the number of times we need to convert to the bitset.

This removes about 27K from my local release+asserts build of llc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355167 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 02:19:26 +00:00
Simon Pilgrim
524310b8b5 Fix "enumeral and non-enumeral type in conditional expression" gcc7 warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354745 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-24 13:31:52 +00:00
Jordan Rupprecht
19a56211e1 [NFC] Fix typos: preceeding -> preceding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354715 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-23 01:28:32 +00:00
Sam Clegg
da1eaa6241 [WebAssembly] Remove unneeded MCSymbolRefExpr variants
We record the type of the symbol (event/function/data/global) in the
MCWasmSymbol and so it should always be clear how to handle a relocation
based on the symbol itself.

The exception is a function which still needs the special @TYPEINDEX
then the relocation contains the signature rather than the address
of the functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354697 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 22:29:34 +00:00
Sam Clegg
26b697c4fe [WebAssembly] MC: Handle aliases of aliases
Differential Revision: https://reviews.llvm.org/D58417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354694 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 21:41:42 +00:00
Sam Clegg
285da41e22 [WebAssembly] Don't create MSSymbolWasm object for non-symbols
`__linear_memory` and `__indirect_function_table` are both generated
as imports in wasm object files but are actually symbols and don't
appear in any symbols table or relocation entry.  Indeed we
don't have any symbol type to meaningfully represent either of them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354599 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 17:05:19 +00:00
Thomas Lively
fa82617e41 [WebAssembly] Update MC for bulk memory
Summary:
Rename MemoryIndex to InitFlags and implement logic for determining
data segment layout in ObjectYAML and MC. Also adds a "passive" flag
for the .section assembler directive although this cannot be assembled
yet because the assembler does not support data sections.

Reviewers: sbc100, aardappel, aheejin, dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354397 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 22:56:19 +00:00
Craig Topper
e598074374 [MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to hold the value.
This class is used for two difference tablegen generated tables. For one of the tables the Value FeatureBitset only has one bit set. For the other usage the Implies field was unused.

This patch changes the Value field to just be an unsigned. For the usage that put a real vector in bitset, we now use the previously unused Implies field and leave the Value field unused instead.

This is good for a 16K reduction in the size of llc on my local build with all targets enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354243 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-18 06:46:17 +00:00
Konstantin Zhuravlyov
6f8664e9c6 MC/ELF: Allow targets to set ABI version
Tests are in the follow up change

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-14 22:42:09 +00:00
Reid Kleckner
c987e861dd [MC] Make symbol version errors non-fatal
We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.

Fixes PR40712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353907 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 01:39:32 +00:00
Hubert Tong
e128b3821e [MC] Clean up unused inline function and non-anchor defaulted destructors; NFCI
Summary:
Take care of some missing clean-ups that belong with r249548 and some
other copy/paste that had happened. In particular, the destructors are
no longer vtable anchors after r249548; and `setSectionName` in
`MCSectionWasm` is private and unused since r313058 culled its only
caller. The destructors are now implicitly defined, and the unused
function is removed.

Reviewers: nemanjai, jasonliu, grosbach

Reviewed By: nemanjai

Subscribers: sbc100, aheejin, sunfish, llvm-commits

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353597 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 02:11:51 +00:00