summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [LLVM-C] Move DIBuilder Bindings For Temporary MDNodesRobert Widmann2018-05-101-3/+12
| | | | | | | | | | | | | | 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
* [DWARF] Rework debug line parsing to use llvm::Error and callbacksJames Henderson2018-05-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: dblaikie, JDevlieghere, espindola Differential Revision: https://reviews.llvm.org/D44560 Summary: The .debug_line parser previously reported errors by printing to stderr and return false. This is not particularly helpful for clients of the library code, as it prevents them from handling the errors in a manner based on the calling context. This change switches to using llvm::Error and callbacks to indicate what problems were detected during parsing, and has updated clients to handle the errors in a location-specific manner. In general, this means that they continue to do the same thing to external users. Below, I have outlined what the known behaviour changes are, relating to this change. There are two levels of "errors" in the new error mechanism, to broadly distinguish between different fail states of the parser, since not every failure will prevent parsing of the unit, or of subsequent unit. Malformed table errors that prevent reading the remainder of the table (reported by returning them) and other minor issues representing problems with parsing that do not prevent attempting to continue reading the table (reported by calling a specified callback funciton). The only example of this currently is when the last sequence of a unit is unterminated. However, I think it would be good to change the handling of unrecognised opcodes to report as minor issues as well, rather than just printing to the stream if --verbose is used (this would be a subsequent change however). I have substantially extended the DwarfGenerator to be able to handle custom-crafted .debug_line sections, allowing for comprehensive unit-testing of the parser code. For now, I am just adding unit tests to cover the basic error reporting, and positive cases, and do not currently intend to test every part of the parser, although the framework should be sufficient to do so at a later point. Known behaviour changes: - The dump function in DWARFContext now does not attempt to read subsequent tables when searching for a specific offset, if the unit length field of a table before the specified offset is a reserved value. - getOrParseLineTable now returns a useful Error if an invalid offset is encountered, rather than simply a nullptr. - The parse functions no longer use `WithColor::warning` directly to report errors, allowing LLD to call its own warning function. - The existing parse error messages have been updated to not specifically include "warning" in their message, allowing consumers to determine what severity the problem is. - If the line table version field appears to have a value less than 2, an informative error is returned, instead of just false. - If the line table unit length field uses a reserved value, an informative error is returned, instead of just false. - Dumping of .debug_line.dwo sections is now implemented the same as regular .debug_line sections. - Verbose dumping of .debug_line[.dwo] sections now prints the prologue, if there is a prologue error, just like non-verbose dumping. As a helper for the generator code, I have re-added emitInt64 to the AsmPrinter code. This previously existed, but was removed way back in r100296, presumably because it was dead at the time. This change also requires a change to LLD, which will be committed separately. llvm-svn: 331971
* [llvm-objcopy] Add --strip-symbol (-N) optionPaul Semel2018-05-094-3/+49
| | | | llvm-svn: 331924
* [llvm-rc] Handle C preprocessor outputMartin Storsjo2018-05-094-1/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | When preprocessing resource scripts (which can easily be done outside of llvm-rc), included headers can leave behind C declarations (despite preprocessing with -DRC_INVOKED), that can't be parsed by a resource compiler. This is handled in all of rc.exe, by parsing the preprocessor output line markers and ignoring content from files named *.h and *.c, documented at [1]. In addition to this filtering, strip out any other preprocessor directive that is left behind (like pragmas) which also can't be handled by the tokenizer. The added test uses both standard #line markers (supported by rc.exe) and GNU style extended line markers, thus this test doesn't pass with rc.exe, but passes with GNU windres. (Windres on the other hand doesn't filter out files named *.c, only *.h.) Differential Revision: https://reviews.llvm.org/D46579 [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa381033(v=vs.85).aspx llvm-svn: 331903
* [llvm-rc] Add support for the RCDATA resource typeMartin Storsjo2018-05-092-0/+3
| | | | | | | | | This is the same as any other user defined resource, but with a specific allocated resource type number. Differential Revision: https://reviews.llvm.org/D46636 llvm-svn: 331902
* [llvm-rc] Allow -1 for control IDs in old style dialogs with 16 bit fieldsMartin Storsjo2018-05-091-2/+5
| | | | | | | | | | | -1 is commonly used as ID for controls that one don't want to refer to later. For DIALOG resources, the IDs are 16 bit numbers, and -1 gets interpreted as UINT32_MAX earlier, which then later is too large to write into a uint16_t. Differential Revision: https://reviews.llvm.org/D46506 llvm-svn: 331901
* llvm-mca: Add missing includesDavid Blaikie2018-05-092-1/+5
| | | | | | | Move the header include in the primary source file to the top to validate that it doesn't depend on any other inclusions. llvm-svn: 331897
* Make llvm-cfi-verify CMakeLists.txt formatting more consistent with the rest ↵Nico Weber2018-05-092-4/+7
| | | | | | of LLVM. llvm-svn: 331835
* Inline contents of LLVM_XRAY_TOOLS variable into its only use.Nico Weber2018-05-091-8/+4
| | | | | | | No behavior change. https://reviews.llvm.org/D46402 llvm-svn: 331830
* [llvm-rc] Add support for all missing dialog controlsMartin Storsjo2018-05-084-10/+55
| | | | | | Differential Revision: https://reviews.llvm.org/D46507 llvm-svn: 331808
* [llvm-objcopy] Fix exit codeAlexander Shaposhnikov2018-05-081-3/+13
| | | | | | | | | | Set the exit code to 1 if no arguments are specified. Test plan: make check-all Differential revision: https://reviews.llvm.org/D46547 llvm-svn: 331776
* [llvm-rc] Update a stale comment. NFC.Martin Storsjo2018-05-081-3/+2
| | | | | | The tokenizer handles comments since SVN r315207. llvm-svn: 331761
* [llvm-rc] Don't strictly require quotes around external file namesMartin Storsjo2018-05-083-7/+20
| | | | | | | | | | | | Regardless of what docs may say, existing resource files in the wild can use this syntax. Rename a file used in an existing test, to make it usable for unquoted paths. Differential Revision: https://reviews.llvm.org/D46511 llvm-svn: 331747
* [DebugInfo] Accept `S` in augmentation strings in CIE.Fangrui Song2018-05-081-1/+1
| | | | | | glibc libc.a(sigaction.o) compiled from sysdeps/unix/sysv/linux/x86_64/sigaction.c uses "zRS". llvm-svn: 331738
* [llvm-rc] Fix build: missing 'override'.Roman Lebedev2018-05-071-1/+1
| | | | llvm-svn: 331675
* [llvm-rc] Implement the BITMAP resource typeMartin Storsjo2018-05-077-0/+68
| | | | | | Differential Revision: https://reviews.llvm.org/D46509 llvm-svn: 331670
* [llvm-rc] Allow optional commas between the string table index and valueMartin Storsjo2018-05-071-0/+1
| | | | | | | | | This form is even used in one of the examples at https://msdn.microsoft.com/en-us/library/windows/desktop/aa381050(v=vs.85).aspx. Differential Revision: https://reviews.llvm.org/D46508 llvm-svn: 331669
* [llvm-rc] Exclude padding from sizes in versioninfo resourcesMartin Storsjo2018-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | Normally when writing something that requires padding, we first measure the length of the written payload data, then write padding if necessary. For a recursive structure like versioninfo, this means that the padding is excluded from the size of the inner element, but included in the size of the enclosing block. Rc.exe excludes the final padding (but not the padding of earlier children) from all levels of the hierarchy. To achieve this, don't pad after each block or value, but only before starting the next one. We still pad after completing the toplevel versioninfo resource, so this won't affect other resource types. Differential Revision: https://reviews.llvm.org/D46510 llvm-svn: 331668
* [llvm-rc] Fix alphabetical order of cases. NFC.Martin Storsjo2018-05-071-2/+2
| | | | llvm-svn: 331667
* [tools] Introduce llvm-stripAlexander Shaposhnikov2018-05-074-20/+105
| | | | | | | | | | | | llvm-strip is supposed to be a drop-in replacement for binutils strip. To start the ball rolling this diff adds the initial bits for llvm-strip, more features will be added incrementally over time. Test plan: make check-all Differential revision: https://reviews.llvm.org/D46407 llvm-svn: 331663
* [llvm-mca] Avoid exposing index values in the MCA interfaces.Matt Davis2018-05-0716-173/+204
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch eliminates many places where we originally needed to pass index values to represent an instruction. The index is still used as a key, in various parts of MCA. I'm not comfortable eliminating the index just yet. By burying the index in the instruction, we can avoid exposing that value in many places. Eventually, we should consider removing the Instructions list in the Backend all together, it's only used to hold and reclaim the memory for the allocated Instruction instances. Instead we could pass around a smart pointer. But that's a separate discussion/patch. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: javed.absar, tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D46367 llvm-svn: 331660
* Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."Clement Courbet2018-05-073-0/+274
| | | | | | Add missing move. llvm-svn: 331624
* Revert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."Clement Courbet2018-05-073-274/+0
| | | | | | Breaks build over llvm::Error copy construction. llvm-svn: 331623
* [llvm-exegesis] Add a library to cluster benchmark results.Clement Courbet2018-05-073-0/+274
| | | | | | | | | | Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D46432 llvm-svn: 331622
* [llvm-dwp] Define InitLLVM.Fangrui Song2018-05-061-0/+2
| | | | llvm-svn: 331610
* [llvm-mca] removes flag -instruction-tables from the "View Options" category.Andrea Di Biagio2018-05-051-25/+15
| | | | | | | | This patch also improves the description of a couple of flags in the view options. With this change, the -help now specifies which views are enabled by default. llvm-svn: 331594
* [llvm-mca] minor tweak to the resource pressure printing functionality. NFC.Andrea Di Biagio2018-05-051-1/+1
| | | | llvm-svn: 331590
* [LTO] Allow pass remarks with hotness to be set when emitting to stderrTeresa Johnson2018-05-041-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Set setDiagnosticsHotnessRequested before the early exit check for a diagnostic output file, so that pass remarks with hotness works when emitting pass remarks to stderr (e.g. via -pass-remarks=.). Also fix the llvm-lto2 diagnistic handler so that it only calls exit(1) when the diagnistic is an error type. Otherwise the new test invocation of llvm-lto2 with -pass-remarks causes it to fail. The new code is consistent with the diagnostic handler elsewhere (e.g. on the LLVMContext). Reviewers: pcc, davide Subscribers: fhahn, mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D46387 llvm-svn: 331569
* [llvm-mc-assemble-fuzzer] Catch up with API changes.Davide Italiano2018-05-041-7/+6
| | | | llvm-svn: 331568
* [llvm-mca] Add descriptive names for the TimelineView report characters. NFC.Matt Davis2018-05-042-8/+18
| | | | | | | | | | | | | | | | Summary: This change makes the TimelineView source simpler to read and easier to modify in the future. This patch introduces a class of static chars used as the display values in the TimelineView report, this change just eliminates a few magic characters. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D46409 llvm-svn: 331540
* obj2yaml: Correctly round-trip default alignment.Peter Collingbourne2018-05-041-1/+2
| | | | | | | | | Previously we were emitting the "cooked" alignment, which made it hard to distinguish between that and the default alignment. Differential Revision: https://reviews.llvm.org/D46418 llvm-svn: 331537
* [llvm-mca] use colors for warnings and notes generated by InstrBuilder.Andrea Di Biagio2018-05-042-10/+10
| | | | llvm-svn: 331517
* [llvm-mca] remove unused argument from method InstrBuilder::createInstrDescImpl.Andrea Di Biagio2018-05-044-11/+13
| | | | | | | | | We don't need to pass the instruction index to the method that constructs new instruction descriptors. No functional change intended. llvm-svn: 331516
* use LLVM's standard CMakeLists.txt layout for llvm-xrayNico Weber2018-05-031-3/+8
| | | | llvm-svn: 331455
* [llvm-rc] Default to writing the output next to the input, if no output is ↵Martin Storsjo2018-05-021-1/+8
| | | | | | | | | | specified This matches what rc.exe does if no output is specified. Differential Revision: https://reviews.llvm.org/D46239 llvm-svn: 331403
* [llvm-cvtres] Allow parameters preceded by '-' in addition to '/'Martin Storsjo2018-05-021-9/+11
| | | | | | | | The real cvtres.exe also allows parameters in either form. Differential Revision: https://reviews.llvm.org/D46358 llvm-svn: 331402
* [llvm-objcopy] Add --discard-all (-x) optionPaul Semel2018-05-024-6/+25
| | | | llvm-svn: 331400
* [llvm-objcopy] Add --weaken optionPaul Semel2018-05-022-0/+8
| | | | llvm-svn: 331397
* [llvm-rc] Add rudimentary support for codepagesMartin Storsjo2018-05-024-21/+93
| | | | | | | | | | | | | | | | | | | | | | Only support UTF-8 (since LLVM contains UTF-8 parsing support already, and the code even does that already) and Windows-1252 (where most code points has the same value in unicode). Keep the existing default as only allowing ASCII input. Using the option type JoinedOrSeparate, since the real rc.exe handles options in this form, even if llvm-rc uses Separate for other similar existing options. Rename the struct SearchParams to WriterParams since it's now used for more than just include paths. Add a missing getResourceTypeName method to the BundleResource class, to fix error printing from within STRINGTABLE resources (used in tests). Differential Revision: https://reviews.llvm.org/D46238 llvm-svn: 331391
* [XRay][tools] Rename llvm-xray filenames from .cc -> .cpp (NFC)Dean Michael Berris2018-05-0211-19/+19
| | | | | | | | | | | | | | | | Summary: This brings the filenames in accordance to the style guide and LLVM conventions for C++ filenames. As suggested by rnk@ in D46068. Reviewers: rnk Subscribers: mgorny, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D46301 llvm-svn: 331321
* [llvm-mca] Lift the logic of the RetireControlUnit from the Dispatch ↵Matt Davis2018-05-015-132/+175
| | | | | | | | | | translation unit into its own translation unit. NFC The logic remains the same. Eventually, I see the RCU acting as its own separate stage in the instruction pipeline. Differential Revision: https://reviews.llvm.org/D46331 llvm-svn: 331316
* [WebAssembly] llvm-readobj: display symbols names in relocationsSam Clegg2018-05-011-3/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D46296 llvm-svn: 331279
* Remove @brief commands from doxygen comments, too.Adrian Prantl2018-05-013-10/+10
| | | | | | | | | | | | | | | | | This is a follow-up to r331272. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done https://reviews.llvm.org/D46290 llvm-svn: 331275
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-0149-190/+190
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [MC] Change AsmParser to leverage Assembler during evaluationNirav Dave2018-04-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Teach AsmParser to check with Assembler for when evaluating constant expressions. This improves the handing of preprocessor expressions that must be resolved at parse time. This idiom can be found as assembling-time assertion checks in source-level assemblers. Note that this relies on the MCStreamer to keep sufficient tabs on Section / Fragment information which the MCAsmStreamer does not. As a result the textual output may fail where the equivalent object generation would pass. This can most easily be resolved by folding the MCAsmStreamer and MCObjectStreamer together which is planned for in a separate patch. Currently, this feature is only enabled for assembly input, keeping IR compilation consistent between assembly and object generation. Reviewers: echristo, rnk, probinson, espindola, peter.smith Reviewed By: peter.smith Subscribers: eraman, peter.smith, arichardson, jyknight, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45164 llvm-svn: 331218
* AMDGPU: Add Vega12 and Vega20Matt Arsenault2018-04-301-0/+2
| | | | | | | | Changes by Matt Arsenault Konstantin Zhuravlyov llvm-svn: 331215
* [llvm-mca] Correctly handle zero-latency stores that consume pipeline resources.Andrea Di Biagio2018-04-302-2/+4
| | | | | | | | | | | | | | | | This fixes PR37293. We can have scheduling classes with no write latency entries, that still consume processor resources. We don't want to treat those instructions as zero-latency instructions; they still have to be issued to the underlying pipelines, so they still consume resource cycles. This is likely to be a regression which I have accidentally introduced at revision 330807. Now, if an instruction has a non-empty set of write processor resources, we conservatively treat it as a normal (i.e. non zero-latency) instruction. llvm-svn: 331193
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-304-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* [llvm-mca] Support for in-order CPU for -instruction-tables testing.Andrea Di Biagio2018-04-301-1/+1
| | | | | | | | | Added Intel Atom tests to verify that the tool correctly generates instruction tables even if the CPU is in-order. Fixes PR37282. llvm-svn: 331169
* [LLVM-C] Eliminate an unused variable in a test.whitequark2018-04-291-3/+2
| | | | | | This was introduced in r331123 and broke -Werror bots. llvm-svn: 331132
OpenPOWER on IntegriCloud