3876 Commits

Author SHA1 Message Date
Luke Cheeseman
4c6cb9f427 Revert r343317
- asan buildbots are breaking and I need to investigate the issue



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343341 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 17:01:50 +00:00
Luke Cheeseman
96f82d5c18 Reapply changes reverted by r343235
- Add fix so that all code paths that create DWARFContext
  with an ObjectFile initialise the target architecture in the context
- Add an assert that the Arch is known in the Dwarf CallFrameString method



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 13:37:27 +00:00
Luke Cheeseman
4d42c19cd1 Revert r343192 as an ubsan build is currently failing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343235 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 16:47:30 +00:00
Luke Cheeseman
a26da93994 Reapply changes reverted in r343114, lldb patch to follow shortly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 10:39:20 +00:00
Fangrui Song
3b35e17b21 llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
Summary: The convenience wrapper in STLExtras is available since rL342102.

Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb

Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 02:13:45 +00:00
Luke Cheeseman
9f0b248da5 Revert r343112 as CallFrameString API change has broken lldb builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343114 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-26 14:48:03 +00:00
Luke Cheeseman
538d8c7d85 [AArch64] - Return address signing dwarf support
- Reapply r343089 with a fix for DebugInfo/Sparc/gnu-window-save.ll



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343112 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-26 14:30:29 +00:00
Hans Wennborg
21491992cf Revert r343089 "[AArch64] - Return address signing dwarf support"
This caused the DebugInfo/Sparc/gnu-window-save.ll test to fail.

> Functions that have signed return addresses need additional dwarf support:
> - After signing the LR, and before authenticating it, the LR register is in a
>   state the is unusable by a debugger or unwinder
> - To account for this a new directive, .cfi_negate_ra_state, is added
> - This directive says the signed state of the LR register has now changed,
>   i.e. unsigned -> signed or signed -> unsigned
> - This directive has the same CFA code as the SPARC directive GNU_window_save
>   (0x2d), adding a macro to account for multiply defined codes
> - This patch matches the gcc implementation of this support:
>   https://patchwork.ozlabs.org/patch/800271/
>
> Differential Revision: https://reviews.llvm.org/D50136

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343103 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-26 12:57:45 +00:00
Luke Cheeseman
e99f0eb61e [AArch64] - Return address signing dwarf support
Functions that have signed return addresses need additional dwarf support:
- After signing the LR, and before authenticating it, the LR register is in a
  state the is unusable by a debugger or unwinder
- To account for this a new directive, .cfi_negate_ra_state, is added
- This directive says the signed state of the LR register has now changed,
  i.e. unsigned -> signed or signed -> unsigned
- This directive has the same CFA code as the SPARC directive GNU_window_save
  (0x2d), adding a macro to account for multiply defined codes
- This patch matches the gcc implementation of this support:
  https://patchwork.ozlabs.org/patch/800271/

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343089 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-26 10:14:15 +00:00
Craig Topper
e6b3ca85df [MCAsmParser] Move AltMacroMode tracking out of MCAsmLexer
The Lexer doesn't use this state itself. It is only set and used by AsmParser so it seems like it should just be part of AsmParser.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343027 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-25 20:55:55 +00:00
Craig Topper
a7f65b7aff [MC] Return a std::string instead of taking it as an out parameter. Make two parser methods into static functions at file scope. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343020 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-25 20:13:55 +00:00
Craig Topper
b0c4f7e14e [MC] Fix bad indentation and 80 column violations. Use StringRef::front instead of dereferencing StringRef::begin. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343010 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-25 19:37:35 +00:00
Craig Topper
6718480e69 [MC] Replace NULL constant in code with nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343003 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-25 18:33:00 +00:00
George Rimar
09becbaba1 [lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.
DWARF5 spec says about single file split case:

"The sections that do not require relocation, however, can be written
to the relocatable object (.o) file but ignored by the
the linker or they can be written to a separate DWARF object (.dwo) file
that need not be accessed by the linker."

Nice way to make linker to ignore them is to set SHF_EXCLUDE flag.
It seems to be not harmful to always set it for .dwo sections.
That is what this patch does.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342800 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-22 07:36:20 +00:00
Maya Madhavan
f68a67ad96 Fix for bug 34002 - label generated before it block is finalized. Differential Revision: https://reviews.llvm.org/D52258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342615 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 05:11:42 +00:00
Andrea Di Biagio
a9c15c18d5 [TableGen][SubtargetEmitter] Add the ability for processor models to describe dependency breaking instructions.
This patch adds the ability for processor models to describe dependency breaking
instructions.

Different processors may specify a different set of dependency-breaking
instructions.
That means, we cannot assume that all processors of the same target would use
the same rules to classify dependency breaking instructions.

The main goal of this patch is to provide the means to describe dependency
breaking instructions directly via tablegen, and have the following
TargetSubtargetInfo hooks redefined in overrides by tabegen'd
XXXGenSubtargetInfo classes (here, XXX is a Target name).

```
virtual bool isZeroIdiom(const MachineInstr *MI, APInt &Mask) const {
  return false;
}

virtual bool isDependencyBreaking(const MachineInstr *MI, APInt &Mask) const {
  return isZeroIdiom(MI);
}
```

An instruction MI is a dependency-breaking instruction if a call to method
isDependencyBreaking(MI) on the STI (TargetSubtargetInfo object) evaluates to
true. Similarly, an instruction MI is a special case of zero-idiom dependency
breaking instruction if a call to STI.isZeroIdiom(MI) returns true.
The extra APInt is used for those targets that may want to select which machine
operands have their dependency broken (see comments in code).
Note that by default, subtargets don't know about the existence of
dependency-breaking. In the absence of external information, those method calls
would always return false.

A new tablegen class named STIPredicate has been added by this patch to let
processor models classify instructions that have properties in common. The idea
is that, a MCInstrPredicate definition can be used to "generate" an instruction
equivalence class, with the idea that instructions of a same class all have a
property in common.

STIPredicate definitions are essentially a collection of instruction equivalence
classes.
Also, different processor models can specify a different variant of the same
STIPredicate with different rules (i.e. predicates) to classify instructions.
Tablegen backends (in this particular case, the SubtargetEmitter) will be able
to process STIPredicate definitions, and automatically generate functions in
XXXGenSubtargetInfo.

This patch introduces two special kind of STIPredicate classes named
IsZeroIdiomFunction and IsDepBreakingFunction in tablegen. It also adds a
definition for those in the BtVer2 scheduling model only.

This patch supersedes the one committed at r338372 (phabricator review: D49310).

The main advantages are:
 - We can describe subtarget predicates via tablegen using STIPredicates.
 - We can describe zero-idioms / dep-breaking instructions directly via
   tablegen in the scheduling models.

In future, the STIPredicates framework can be used for solving other problems.
Examples of future developments are:
 - Teach how to identify optimizable register-register moves
 - Teach how to identify slow LEA instructions (each subtarget defining its own
   concept of "slow" LEA).
 - Teach how to identify instructions that have undocumented false dependencies
   on the output registers on some processors only.

It is also (in my opinion) an elegant way to expose knowledge to both external
tools like llvm-mca, and codegen passes.
For example, machine schedulers in LLVM could reuse that information when
internally constructing the data dependency graph for a code region.

This new design feature is also an "opt-in" feature. Processor models don't have
to use the new STIPredicates. It has all been designed to be as unintrusive as
possible.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342555 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 15:57:45 +00:00
Nirav Dave
1ad653993a [MC] Avoid inlining constant symbols with variants.
Summary:
Defer unnecessary early inlining of constants to symbol
variants. Fixes PR38945.

Reviewers: nickdesaulniers, rnk

Subscribers: nemanjai, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342412 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 20:34:26 +00:00
Jonas Devlieghere
d76926a9ba [MC/Dwarf] Unclamp DWARF linetables format on Darwin.
In r319995, we fixed the line table format to version 2 on Darwin
because dsymutil didn't yet understand the new format which caused test
failures for the LLDB bots. This has been resolved in the meantime so
there's no reason to keep this limitation.

rdar://problem/35968332

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342136 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-13 13:13:50 +00:00
Fangrui Song
35bfd59001 Fix typos. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341740 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-08 02:04:20 +00:00
Reid Kleckner
1de79cc654 [codeview] Add .cv_string directive for testing purposes
The main use case for this directive is to allow assembly writers to
write their own FPO data strings without going through the .cv_fpo*
directive family.

I'm experimenting with different RPN programs to fix PR38857, and I
figured I should go ahead and make this directive permanent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341712 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 21:30:52 +00:00
Eric Christopher
42eb082d63 The initial .text section generated in object files was missing the
SHF_ARM_PURECODE flag when being built with the -mexecute-only flag.
All code sections of an ELF must have the flag set for the final .text
section to be execute-only, otherwise the flag gets removed.

A HasData flag is added to MCSection to aid in the determination that
the section is empty. A virtual setTargetSectionFlags is added to
MCELFObjectTargetWriter to allow subclasses to set target specific
section flags to be added to sections which we then use in the ARM
backend to set SHF_ARM_PURECODE.

Patch by Ivan Lozano!

Reviewed By: echristo

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 22:09:31 +00:00
Heejin Ahn
581d231e61 [WebAssembly] clang-format (NFC)
Summary: This patch runs clang-format on all wasm-only files.

Reviewers: aardappel, dschuff, sunfish, tlively

Subscribers: MatzeB, sbc100, jgravelle-google, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341439 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 01:27:38 +00:00
Kristina Brooks
de01dd1407 [MC] - ConstantPools.cpp: Style consistency, remove redundant braces. NFC.
Remove braces around two, single statement "if" blocks in line with rest 
of the file and the general LLVM code style. NFC, testing commit access.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341294 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-03 03:48:39 +00:00
Krasimir Georgiev
40552436a1 [MC] fix a clang-tidy warning, NFC
Summary:
Per clang-tidy:
function 'llvm::MCStreamer::checkCVLocSection' has a definition with different parameter names

.../llvm/lib/MC/MCStreamer.cpp:275:18: the definition seen here

.../llvm/include/llvm/MC/MCStreamer.h:235:8: differing parameters are named here: ('FuncId'), in definition: ('FunctionId')

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340912 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 10:40:51 +00:00
George Rimar
2a751e18fd Revert r340904 "[llvm-mc] - Allow to set custom flags for debug sections."
It broke PPC64 BB:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/23252

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340906 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 09:04:52 +00:00
George Rimar
3c4edb8fcc [llvm-mc] - Allow to set custom flags for debug sections.
I am experimenting with a single split dwarf (.dwo sections in .o files).
I want to make linker to ignore .dwo sections in .o, for that I am trying to add
SHF_EXCLUDE flag ("E") for them in my asm sample.

I found that currently, it is impossible to add any flag for debug sections using llvm-mc.

That happens because we have a set of predefined unique sections created early with default flags:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L391

This patch allows a user to add any flags he wants.

I had to edit TargetLoweringObjectFileImpl.cpp to set MetaData type for debug sections.
Their kind was Data by default (so they were allocatable) and so after changes introduced by
this patch the SHF_ALLOC flag was applied for them, what does not make sense for debug sections.
One of OrcJITTests tests failed because of that.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 08:42:02 +00:00
Reid Kleckner
aea52742ef [codeview] Clean up machinery for deferring .cv_loc emission
Now that we create the label at the point of the directive, we don't
need to set the "current CV location", and then later when we emit the
next instruction, create a label for it and emit it.

DWARF still defers the labels used in .debug_loc until the next
instruction or value, for reasons unknown.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 23:25:59 +00:00
Reid Kleckner
d895f5db4d [codeview] Emit labels for .cv_loc immediately
Previously we followed the DWARF implementation, which waits until the
next instruction or data to emit the label to use in the .debug_loc
section. We might want to consider re-evaluating that design choice as
well, since it means the .loc skips alignment padding, for better or
worse.

This was the most minimal fix I could come up with, but we should be
able to do a lot of cleanups now that we don't need to save a pending CV
location on the CodeViewContext. I plan to do those next, but this
immediately fixes an assertion for some of our users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340878 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 22:29:12 +00:00
Brian Cain
3b38b07fc6 [debuginfo] generate debug info with asm+.file
Summary:
For assembly input files, generate debug info even when the .file
directive is present, provided it does not include a file-number
argument.  Fixes PR38695.

Reviewers: probinson, sidneym

Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340839 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 16:23:39 +00:00
Ana Pazos
98b23f06ba [MC, RISCV] Fixed StringRef Assertion `Index < Length && "Invalid index!"'
Summary:
Handle the case IDVal is an empty string.

This bug was uncovered by a LLVM MC Assembler Protocol Buffer
Fuzzer  for the RISC-V assembly language.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, niravd, pcc, peter.smith, asb, grosbach, llvm-commits, bcain, kito-cheng, shiva0217, rogfer01, PkmX

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340678 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-25 01:34:32 +00:00
Peter Collingbourne
4662b47cbc Initialize the address-significance table fragment's layout order.
This fragment is created after layout, which is where the order
normally gets set.

Should fix a test failure under msan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 06:57:49 +00:00
Peter Collingbourne
1853218e37 MC: Don't align COFF section contents.
Aligning section contents is not required, but only
recommended, by the specification. Microsoft's documentation says
(https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#section-table-section-headers):
"For object files, the value should be aligned on a 4-byte boundary
for best performance."

However, according to my measurements, aligning section contents has
a neutral to negative effect on performance.

I measured the median run time of 100 links of Chromium's
base_unittests on Linux with lld-link and on Windows with link.exe with
both aligned and unaligned sections. On Linux I didn't see a measurable
performance difference, and on Windows the link was slightly faster
with unaligned sections (presumably because on Windows the bottleneck
is I/O).

Also, the sections created by cl.exe are unaligned, so we should expect
tools to broadly accept unaligned sections.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340514 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 05:39:36 +00:00
Peter Collingbourne
38b60af7cb MC: Teach the COFF object writer to write address-significance tables.
The format is the same as in ELF: a sequence of ULEB128-encoded
symbol indexes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 23:58:16 +00:00
Sam Clegg
b4dc85b780 [WebAssembly] Ensure relocation entries are ordered by offset
wasm-lld expects relocation entries to be sorted by offset.  In most
cases llvm produces them in order, but the CODE section (which combines
many MCSections) is an exception because we order the functions in
Symbol order, not in section order.  What is more, its not clear weather
`recordRelocation` is guaranteed to be called in offset order so this
sort of most likely needed in the general case too.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340423 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-22 17:27:31 +00:00
Peter Collingbourne
8efb13000b MC: Remove dead code from WinCOFFObjectWriter.cpp. NFCI.
Remove code for writing auxiliary symbols of type function definition
and begin function. These types of symbols are associated with
pre-CodeView debug info and we never emit them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340113 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-18 00:54:46 +00:00
Reid Kleckner
2661a6cb5c [MC] Improve error message when a codeview register is unknown
This is in MCRegisterInfo, we can print the actual register name easily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340089 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-17 21:35:14 +00:00
Reid Kleckner
a9c1926d01 [MC] Improve COFF associative section lookup
Handle the case when the symbol is private. Private symbols are not in
the COFF object file symbol table, so they aren't inserted into
SymbolMap. We can't look up the section of the symbol that way. Instead,
get the MCSection from the MCSymbol and map that to the object file
section.

Print a better error message when the symbol has no section, like when
the symbol is undefined.

Fixes PR38607

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339942 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 21:34:41 +00:00
Nirav Dave
cd2d2cfae6 [MC] Cleanup noop default case spelling. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339906 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 17:22:31 +00:00
Benjamin Kramer
3c6e3abc6c [MC] Remove unused variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339896 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 16:50:23 +00:00
Nirav Dave
fd8c412454 [MC][X86] Enhance X86 Register expression handling to more closely match GCC.
Allow the comparison of x86 registers in the evaluation of assembler
directives. This generalizes and simplifies the extension from r334022
to catch another case found in the Linux kernel.

Reviewers: rnk, void

Reviewed By: rnk

Subscribers: hiraditya, nickdesaulniers, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339895 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 16:31:14 +00:00
Alex Bradbury
ff51b9f280 [RISCV][MC] Don't fold symbol differences if requiresDiffExpressionRelocations is true
When emitting the difference between two symbols, the standard behavior is 
that the difference will be resolved to an absolute value if both of the 
symbols are offsets from the same data fragment. This is undesirable on 
architectures such as RISC-V where relaxation in the linker may cause the 
computed difference to become invalid. This caused an issue when compiling to 
object code, where the size of a function in the debug information was already 
calculated even though it could change as a consequence of relaxation in the 
subsequent linking stage.

This patch inhibits the resolution of symbol differences to absolute values 
where the target's AsmBackend has declared that it does not want these to be 
folded.

Differential Revision: https://reviews.llvm.org/D45773
Patch by Edward Jones.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339864 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 11:26:37 +00:00
Simon Pilgrim
be12728bc5 Fix -Wimplicit-fallthrough warning introduced in rL339397.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339422 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-10 11:02:44 +00:00
Reid Kleckner
3b9733f095 [MC] Move EH DWARF encodings from MC to CodeGen, NFC
Summary:
The TType encoding, LSDA encoding, and personality encoding are all
passed explicitly by CodeGen to the assembler through .cfi_* directives,
so only the AsmPrinter needs to know about them.

The FDE CFI encoding however, controls the encoding of the label
implicitly created by the .cfi_startproc directive. That directive seems
to be special in that it doesn't take an encoding, so the assembler just
has to know how to encode one DSO-local label reference from .eh_frame
to .text.

As a result, it looks like MC will continue to have to know when the
large code model is in use. Perhaps we could invent a '.cfi_startproc
[large]' flag so that this knowledge doesn't need to pollute the
assembler.

Reviewers: davide, lliu0, JDevlieghere

Subscribers: hiraditya, fedor.sergeev, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339397 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-09 22:24:04 +00:00
Jonas Devlieghere
71299703e4 [DWARF] Unclamp line table version on Darwin for v5 and later.
On Darwin we pin the DWARF line tables to version 2. Stop doing so for
DWARF v5 and later.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339288 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-08 21:16:50 +00:00
Peter Collingbourne
f06afc396f MC: Redirect .addrsig directives referring to private (.L) symbols to the section symbol.
This matches our behaviour for regular (i.e. relocated) references to
private symbols and therefore avoids needing to unnecessarily write
address-significant .L symbols to the object file's symbol table,
which can interfere with stack traces.

Fixes check-cfi after r339050.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339066 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-06 21:59:58 +00:00
Eric Christopher
6dac043f8c Revert "Add a warning if someone attempts to add extra section flags to sections"
There are a bunch of edge cases and inconsistencies in how we're emitting sections
cause this warning to fire and it needs more work.

This reverts commit r335558.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338968 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-05 14:23:37 +00:00
Nicholas Wilson
54c1354d1e [WebAssembly] Cleanup of the way globals and global flags are handled
Differential Revision: https://reviews.llvm.org/D44030

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338894 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 14:33:37 +00:00
Simon Pilgrim
caa9b8f4ab Fix "not all control paths return a value" MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 13:00:11 +00:00
Jonas Devlieghere
6c7ea834f8 [MC] Report fatal error for DWARF types for non-ELF object files
Getting the DWARF types section is only implemented for ELF object
files. We already disabled emitting debug types in clang (r337717), but
now we also report an fatal error (rather than crashing) when trying to
obtain this section in MC. Additionally we ignore the generate debug
types flag for unsupported target triples.

See PR38190 for more information.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338527 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 12:53:06 +00:00
Hsiangkai Wang
c8a8300f9a [DebugInfo] Fix build failed in clang-x86_64-linux-selfhost-modules.
Only generate symbol difference expression if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338484 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 04:17:41 +00:00