summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Update discriminator assignment algorithm in clang assembler.Dehao Chen2016-04-221-1/+6
| | | | | | | | | | | | Summary: The clang assembler assumes that the discriminator remains the same when there is source line change. The correct behavior is that when there is line change, discriminator will automatically reset to 0. Reviewers: dnovillo, davidxl, echristo Subscribers: echristo, llvm-commits Differential Revision: http://reviews.llvm.org/D19436 llvm-svn: 267226
* MachO: enable .data_region directives everywhereTim Northover2016-04-212-5/+1
| | | | | | | | | | We'd disabled them on x86 because back in the early days some host tools couldn't handle the new load commands. This no longer holds: anyone capable of deploying Clang should be able to deploy its copies of ar/ranlib/etc. rdar://25254790 llvm-svn: 267075
* Zero-initialize members of the CpuHashInfoTy structure for AsmParserAndrew Kaylor2016-04-211-2/+2
| | | | llvm-svn: 267042
* [NFC] Header cleanupMehdi Amini2016-04-185-8/+3
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* AsmParser: record "# line file" context to calculate location for diagTim Northover2016-04-131-30/+40
| | | | | | | | | | | Since we can't emit diagnostics for missing "jmp 1f" labels until the end of the file, we need to be able to restore the context used to calculate file/line. This is basically the "# line file" directive that's being used at the time the expression is seen. rdar://25706972 llvm-svn: 266238
* [MC/ELFObjectWriter] Fix indentation of class body.David Blaikie2016-04-121-131/+130
| | | | llvm-svn: 266136
* MCParser: diagnose missing directional labels more clearly.Tim Northover2016-04-111-13/+27
| | | | | | | | Before, ELF at least managed a diagnostic but it was a completely untraceable "undefined symbol" error. MachO had a variety of even worse behaviours: crash, emit corrupt file, or an equally bad message. llvm-svn: 265984
* [Object] Make .alt_entry directive parsing MachO specific.Lang Hames2016-04-114-6/+25
| | | | | | ELF and COFF will now treat .alt_entry like any other unrecognized directive. llvm-svn: 265975
* [Object] Report an error if .alt_entry is used with ELF or COFF.Lang Hames2016-04-082-1/+3
| | | | | | | I'm looking into a better way to do this long-term, but for now at least don't crash. llvm-svn: 265815
* Handle section vs global name conflict.Evgeniy Stepanov2016-03-282-15/+23
| | | | | | | | | | | | | This is a fix for PR26941. When there is both a section and a global definition with the same name, the global wins. Section symbols are not added to the symbol table; section references are left undefined and fixed up in the object writer unless they've been satisfied by some other definition. llvm-svn: 264649
* MC: Don't access the filesystem in MCContext's constructorJustin Bogner2016-03-221-5/+0
| | | | | | | | | | | | | | MCContext shouldn't be accessing the filesystem - that's a gross layering violation and makes it awkward to use as a library or in a daemon where it may not even be allowed filesystem access. The CWD lookup here is normally redundant anyway, since the calling context either also looks up the CWD or sets this to something more specific. Here, we fix up the one caller that doesn't already set up a debug compilation dir and make it clear that the responsibility for such set up is in the users of MCContext. llvm-svn: 264109
* [ELF][gcc compatibility]: support section names with special characters ↵Marina Yatsina2016-03-221-8/+9
| | | | | | | | | | | | (e.g. "/") Adding support for section names with special characters in them (e.g. "/"). GCC successfully compiles such section names. This also fixes PR24520. Differential Revision: http://reviews.llvm.org/D15678 llvm-svn: 264038
* [MCParser] Accept uppercase radix variants 0X and 0BColin LeMahieu2016-03-181-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D14781 llvm-svn: 263802
* [MC] Rename TLSDESC as it's not ARM specific.Davide Italiano2016-03-151-2/+2
| | | | | | Similarly to what was done for TLSCALL in r263515. llvm-svn: 263564
* [MachO] Extend the alt_entry support for aliases added in r263521 toLang Hames2016-03-151-4/+7
| | | | | | expressions of the form 'a = .' and 'a = Ltmp'. llvm-svn: 263528
* [MachO] Add MachO alt-entry directive support.Lang Hames2016-03-157-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MachO .alt_entry assembly directive, and uses it for global aliases with non-zero GEP offsets. The alt_entry flag indicates that a symbol should be layed out immediately after the preceding symbol. Conceptually it introduces an alternate entry point for a function or data structure. E.g.: safe_foo: // check preconditions for foo .alt_entry fast_foo fast_foo: // body of foo, can assume preconditions. The .alt_entry flag is also implicitly set on assembly aliases of the form: a = b + C where C is a non-zero constant, since these have the same effect as an alt_entry symbol: they introduce a label that cannot be moved relative to the preceding one. Setting the alt_entry flag on aliases of this form fixes http://llvm.org/PR25381. llvm-svn: 263521
* [MC] Rename TLSCALL as it's not ARM specific.Davide Italiano2016-03-151-2/+2
| | | | | | | | | | | | | | `MCSymbolRefExpr` variant kind for TLSCALL is prefixed with _ARM_ since this is how it was originally implemented. The X86_64 version is exactly the same so there's no reason to create a new variant, we can just rename the existing one to be machine-independent. This generalization is the first step to implement support for GNU2 TLS dialect in MC. Differential Revision: http://reviews.llvm.org/D18160 llvm-svn: 263515
* Don't crash when compiling inline assembler containing .file directives.Adrian Prantl2016-03-091-3/+3
| | | | | | | | | | Removing the assertion is safe to do because any module level inline assembly is always emitted first via AsmPrinter::doInitialization(). http://reviews.llvm.org/D16101 rdar://22690666 llvm-svn: 263033
* [ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + ↵Marina Yatsina2016-03-071-0/+26
| | | | | | | | | | | | | | | | | | | | | | fix bag with curly braces Until now curly braces could only be used in MS inline assembly to mark block start/end. All curly braces were removed completely at a very early stage. This approach caused bugs like: "m{o}v eax, ebx" turned into "mov eax, ebx" without any error. In addition, AVX-512 added special operands (e.g., k registers), which are also surrounded by curly braces that mark them as such. Now, we need to keep the curly braces and identify at a later stage if they are marking block start/end (if so, ignore them), or surrounding special AVX-512 operands (if so, parse them as such). This patch fixes the bug described above and enables the use of AVX-512 special operands. This commit is the the llvm part of the patch. The clang part of the review is: http://reviews.llvm.org/D17766 The llvm part of the review is: http://reviews.llvm.org/D17767 Differential Revision: http://reviews.llvm.org/D17767 llvm-svn: 262843
* [lanai] Add ELF enum value and relocations.Jacques Pienaar2016-03-011-0/+5
| | | | | | | | | | Add ELF enum value and relocations for Lanai backed. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html). Differential Revision: http://reviews.llvm.org/D17008 llvm-svn: 262394
* Move ObjectYAML code to a new library.Rafael Espindola2016-03-012-62/+0
| | | | | | | It is only ever used by obj2yaml and yaml2obj. No point in linking it everywhere. llvm-svn: 262368
* [MC][YAML] Rangify the loop. NFCSimon Atanasyan2016-03-011-6/+2
| | | | llvm-svn: 262317
* AsmParser: Fix nested .irp/.irpcNikolay Haustov2016-03-011-1/+3
| | | | | | | | Count .irp/.irpc in parseMacroLikeBody similar to .rept Update tests. Review: http://reviews.llvm.org/D17707 llvm-svn: 262313
* Add capability to push/pop DFI in MCStreamer. NFCAmaury Sechet2016-02-241-2/+6
| | | | | | | | | | | | Summary: This is extracted from D17555 Reviewers: davidxl, reames, sanjoy, MatzeB, pete Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17579 llvm-svn: 261796
* [X86] Create mergeable constant pool entries for AVXDavid Majnemer2016-02-221-0/+4
| | | | | | | We supported creating mergeable constant pool entries for smaller constants but not for 32-byte AVX constants. llvm-svn: 261584
* [codeview] Fix emission of file changes in inline line tablesReid Kleckner2016-02-191-1/+4
| | | | | | These are supposed to be file checksum table offsets, not file ids. llvm-svn: 261379
* Add support for merging strings with alignment larger than one char.Rafael Espindola2016-02-191-8/+16
| | | | | | This will be used in a lld patch. llvm-svn: 261326
* Remove uses of builtin comma operator.Richard Trieu2016-02-181-23/+42
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261270
* [codeview] Bail on a DBG_VALUE register operand with no registerReid Kleckner2016-02-161-1/+3
| | | | | | | | | | This apparently comes up when the register allocator decides that a variable will become undef along a certain path. Also improve the error message we emit when we can't map from LLVM register number to CV register number. llvm-svn: 261016
* [MC] Fixed parsing of macro arguments where expressions with spaces are present.Scott Egerton2016-02-111-16/+20
| | | | | | | | | | | | | | | Summary: Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction. The reason that the test case has been changed is so that the expected output matches the output of the GNU assembler. Reviewers: vkalintiris, dsanders Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D13592 llvm-svn: 260521
* [codeview] Describe int local variables using .cv_def_rangeReid Kleckner2016-02-101-0/+7
| | | | | | | | | | | | | | | | Summary: Refactor common value, scope, and label tracking logic out of DwarfDebug into a common base class called DebugHandlerBase. Update an old LLVM IR test case to avoid an assertion in LexicalScopes. Reviewers: dblaikie, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16931 llvm-svn: 260432
* [MC] Merge VK_PPC_TPREL in to generic VK_TPREL.Colin LeMahieu2016-02-102-10/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D17038 llvm-svn: 260401
* [MC] Adding GOTREL expression variant.Colin LeMahieu2016-02-091-0/+2
| | | | llvm-svn: 260258
* [MC] Add support for encoding CodeView variable definition rangesDavid Majnemer2016-02-058-7/+179
| | | | | | | | | | | | | | | | | | | CodeView, like most other debug formats, represents the live range of a variable so that debuggers might print them out. They use a variety of records to represent how a particular variable might be available (in a register, in a frame pointer, etc.) along with a set of ranges where this debug information is relevant. However, the format only allows us to use ranges which are limited to a maximum of 0xF000 in size. This means that we need to split our debug information into chunks of 0xF000. Because the layout of code is not known until *very* late, we must use a new fragment to record the information we need until we can know *exactly* what the range is. llvm-svn: 259868
* [codeview] Don't attempt a cross-section label diffReid Kleckner2016-02-041-5/+11
| | | | | | | | This only comes up when we're trying to find the next .cv_loc label. Fixes PR26467 llvm-svn: 259733
* [codeview] Correctly handle inlining functions post-dominated by unreachableDavid Majnemer2016-02-025-12/+36
| | | | | | | | | | | | | | CodeView requires us to accurately describe the extent of the inlined code. We did this by grabbing the next debug location in source order and using *that* to denote where we stopped inlining. However, this is not sufficient or correct in instances where there is no next debug location or the next debug location belongs to the start of another function. To get this correct, use the end symbol of the function to denote the last possible place the inlining could have stopped at. llvm-svn: 259548
* Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.Eugene Zelenko2016-02-022-4/+2
| | | | | | Differential revision: http://reviews.llvm.org/D16793 llvm-svn: 259539
* [codeview] Wire up the .cv_inline_linetable directiveReid Kleckner2016-02-027-38/+147
| | | | | | | | This directive emits the binary annotations that describe line and code deltas in inlined call sites. Single-stepping through inlined frames in windbg now works. llvm-svn: 259535
* Fix infinite recursion in MCAsmStreamer::EmitValueImpl.Rafael Espindola2016-02-011-7/+5
| | | | | | | | | | | If a target can only emit 8-bits data, we would loop in EmitValueImpl since it will try to split a 32-bits data in 1 chunk of 32-bits. No test since all current targets can emit 32bits at a time. Patch by Alexandru Guduleasa! llvm-svn: 259399
* Improved macro emission in dwarf.Amjad Aboud2016-02-011-4/+4
| | | | | | | | Changed emitting offset of macinfo entry into compiler unit DIE to use "addSectionLabel" method rather than explicitly calculating size/offset of macro entry. Differential Revision: http://reviews.llvm.org/D16292 llvm-svn: 259358
* [MCDwarf] Fix encoding of line tables with weird custom parametersFrederic Riss2016-01-311-2/+5
| | | | | | | | | | | | | | | | With poorly chosen custom parameters, the line table encoding logic would sometimes end up generating a special opcode bigger than 255, which is wrong. The set of default parameters that LLVM uses isn't subject to this bug. When carefully chosing the line table parameters, it's impossible to fall into the corner case that this patch fixes. The standard however doesn't require that these parameters be carefully chosen. And even if it did, we shouldn't generate broken encoding. Add a unittest for this specific encoding bug, and while at it, create some unit tests for the encoding logic using different sets of parameters. llvm-svn: 259334
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-299-11/+11
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* [CodeView] Implement .cv_inline_linetableDavid Majnemer2016-01-295-6/+155
| | | | | | | | | | | This support is _very_ rudimentary, just enough to get some basic data into the CodeView debug section. Left to do is: - Use the combined opcodes to save space. - Do something about code offsets. llvm-svn: 259230
* [codeview] Begin to add support for inlined call sitesReid Kleckner2016-01-291-3/+10
| | | | | | | | | | | | | | | | | | | | | Summary: There are three parts to inlined call frames: 1. The inlinee line subsection 2. The inline site symbol record 3. The function ids referenced by both This change starts by emitting function ids (3) for all subprograms and emitting the base inline site symbol record (2). The actual line numbers in (2) use an encoded format that will come next, along with the inlinee line subsection. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16333 llvm-svn: 259217
* Fix some -Wstring-conversion warningsDavid Blaikie2016-01-291-6/+6
| | | | | | | I don't seem to see these locally, maybe just need to update my compiler, or we haven't turned them on for LLVM's build and we should... llvm-svn: 259146
* Reland "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-298-8/+580
| | | | | | | | This reverts commit r259126 and relands r259117. This time with updated library dependencies. llvm-svn: 259130
* Revert "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-298-580/+8
| | | | | | | | | This reverts commit r259117. The LineInfo constructor is defined in the codeview library and we have to link against it now. Doing that isn't trivial, so reverting for now. llvm-svn: 259126
* Silence gcc warning about ternary and enumerationsReid Kleckner2016-01-281-1/+1
| | | | llvm-svn: 259123
* [CodeView] Use assembler directives for line tablesReid Kleckner2016-01-288-8/+580
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new family of .cv_* directives to LLVM's variant of GAS syntax: - .cv_file: Similar to DWARF .file directives - .cv_loc: Similar to the DWARF .loc directive, but starts with a function id. CodeView line tables are emitted by function instead of by compilation unit, so we needed an extra field to communicate this. Rather than overloading the .loc direction further, we decided it was better to have our own directive. - .cv_stringtable: Emits the codeview string table at the current position. Currently this just contains the filenames as null-terminated strings. - .cv_filechecksums: Emits the file checksum table for all files used with .cv_file so far. There is currently no support for emitting actual checksums, just filenames. This moves the line table emission code down into the assembler. This is in preparation for implementing the inlined call site line table format. The inline line table format encoding algorithm requires knowing the absolute code offsets, so it must run after the assembler has laid out the code. David Majnemer collaborated on this patch. llvm-svn: 259117
* ARMv7k: base ABI decision on v7k Arch rather than watchos OS.Tim Northover2016-01-271-2/+2
| | | | | | | | Various bits we want to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258975
OpenPOWER on IntegriCloud