summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/Error.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Use noexcept directly now that all compilers support itReid Kleckner2016-10-191-2/+2
| | | | llvm-svn: 284671
* Unpollute the global namespace. lld edition.Benjamin Kramer2016-08-061-0/+2
| | | | llvm-svn: 277926
* Remove unused variants of make_dynamic_error_code. NFC.Pete Cooper2016-03-311-8/+0
| | | | | | | | | | | | | | | | | make_dynamic_error_code was used to create a std::error_code with a std::string message. Now that we are migrating to llvm::Error, there are no calls to these make_dynamic_error_code methods. There is one single call to make_dynamic_error_code remaining, the one inside GenericError::convertToErrorCode(). That method is only called from File::doParse() which should be a temporary situation. We need to work out how to deal with File::parse() caching the error result from doParse(). Caching errors isn't supported in the new scheme, and probably isn't needed here, but we need to work that out. Once thats done, dynamic error and all utilities around it can be deleted. llvm-svn: 264982
* Change getReferenceInfo/getPairReferenceInfo to use new Error handling. NFC.Pete Cooper2016-03-301-0/+8
| | | | | | | | | | | | Adds a GenericError class to lld/Core which can carry a string. This is analygous to the dynamic_error we currently use in lld/Core. Use this GenericError instead of make_dynamic_error_code. Also, provide an implemention of GenericError::convertToErrorCode which for now converts it in to the dynamic_error_code we used to have. This will go away once all the APIs are converted. llvm-svn: 264910
* Remove dead code. This error type is for the old linker script reader.Rui Ueyama2016-02-281-36/+0
| | | | llvm-svn: 262166
* Fix Clang-tidy misc-use-override warnings, other minor fixes.Rui Ueyama2015-09-101-3/+2
| | | | | | Patch from Eugene Zelenko! llvm-svn: 247323
* [LinkerScript] Process program header in PHDRS commandDenis Protivensky2015-08-121-0/+6
| | | | | | | | | | Add PT_PHDR segment depending on its availability in linker script's PHDRS command, fallback if no linker script is given. Handle FILEHDR, PHDRS and FLAGS attributes of program header. Differential Revision: http://reviews.llvm.org/D11589 llvm-svn: 244743
* [LinkerScript] Add matching of output sections to segmentsDenis Protivensky2015-06-151-0/+2
| | | | | | | | | | | Add method to query segments for specified output section name. Return error if the section is assigned to unknown segment. Check matching of sections to segments during layout on the subject of correctness. NOTE: no actual functionality of using custom segments is implemented. Differential Revision: http://reviews.llvm.org/D10359 llvm-svn: 239719
* Remove unused enum value. NFC.Rafael Espindola2015-04-241-2/+0
| | | | llvm-svn: 235742
* Define make_dynamic_error_code(const char *).Rui Ueyama2015-04-141-0/+4
| | | | | | | | | | | | The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
* Remove the Native file format.Rui Ueyama2015-04-101-33/+0
| | | | | | | | | | | | | The Native file format was designed to be the fastest on-memory or on-disk file format for object files. The problem is that no one is working on that. No LLVM tools can produce object files in the Native, thus the feature of supporting the format is useless in the linker. This patch removes the Native file support. We can add it back if we really want it in future. llvm-svn: 234641
* [LinkerScript] Implement linker script expression evaluationRafael Auler2015-03-091-0/+5
| | | | | | | | | | | The expression evaluation is needed when interpreting linker scripts, in order to calculate the value for new symbols or to determine a new position to load sections in memory. This commit extends Expression nodes from the linker script AST with evaluation functions, and also contains a unit test. http://reviews.llvm.org/D8156 llvm-svn: 231707
* [Core,MachO,Test] Remove trailing whitespace.Shankar Easwaran2015-02-221-1/+1
| | | | llvm-svn: 230192
* Use std::recursive_mutex instead of llvm's SmartMutex.Rui Ueyama2015-01-161-6/+5
| | | | llvm-svn: 226236
* Replace ReaderError with DynamicError.Rui Ueyama2014-12-151-26/+0
| | | | | | | | | ReaderErrorCategory was used only at one place. We now have a DynamicErrorCategory for this kind of one-time error, so use it. The calling function doesn't really care the type of an error, so ReaderErrorCategory was actually dead code. llvm-svn: 224245
* Simplify InputGraph API.Rui Ueyama2014-12-141-27/+0
| | | | | | | | | These member functions returns either no_more_files error or a File object. We could simply return a nullptr instead of a no_more_files. This function will be removed soon as a part of InputGraph cleanup. I had to do that step by step. llvm-svn: 224208
* Sort include files according to convention.Shankar Easwaran2014-10-181-2/+0
| | | | llvm-svn: 220131
* lld/lib/Core/Error.cpp: Appease g++-4.7, corresponding to LLVM r210687.NAKAMURA Takumi2014-10-171-0/+2
| | | | llvm-svn: 220039
* PE/COFF: add a check to ensure that we dont mix up architecturesSaleem Abdulrasool2014-10-051-0/+2
| | | | | | | | | | | | | | | | Previously, we would not check the target machine type and the module (object) machine type. Add a check to ensure that we do not attempt to use an object file with a different target architecture. This change identified a couple of tests which were incorrectly mixing up architecture types, using x86 input for a x64 target. Adjust the tests appropriately. The renaming of the input and the architectures covers the changes to the existing tests. One significant change to the existing tests is that the newly added test input for x64 uses the correct user label prefix for X64. llvm-svn: 219093
* Core: switch error mapping to switchesSaleem Abdulrasool2014-10-051-19/+32
| | | | | | | | | | Rather than a series of cascading ifs, use a switch statement to convert the error code to a string. This has the benefit of allowing the compiler to inform us if we ever add a new error code but fail to update the string representation. Add in stringified versions for a couple of missing InputGraphErrors. llvm-svn: 219089
* Remove unused and odd code.Rafael Espindola2014-06-131-36/+0
| | | | | | | | This code was never being used and any use of it would look fairly strange. For example, it would try to map a NativeReaderError::file_malformed to std::errc::invalid_argument. llvm-svn: 210913
* replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-5/+4
| | | | llvm-svn: 210781
* Use error_category from the std namespace.Rafael Espindola2014-06-121-11/+11
| | | | llvm-svn: 210732
* Use error_condition from the std namespace.Rafael Espindola2014-06-121-10/+10
| | | | llvm-svn: 210730
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-5/+5
| | | | | | This is an update for a llvm api change. llvm-svn: 210689
* Missed these from the previous commit.Rafael Espindola2014-06-111-2/+2
| | | | llvm-svn: 210629
* Inherit from error_category instead of _do_message.Rafael Espindola2014-06-111-4/+4
| | | | | | There is no std::_do_message and these classes override message anyway. llvm-svn: 210626
* Mark a few functions noexcept.Rafael Espindola2014-06-101-11/+24
| | | | llvm-svn: 210590
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-311-5/+5
| | | | llvm-svn: 209958
* Add make_dynamic_error_code().Nick Kledzik2014-05-271-0/+54
| | | | | | | | | | | This is a short-term fix to allow lld Readers to return error messages with dynamic content. The long term fix will be to enhance ErrorOr<> to work with errors other than error_code. Or to change the interface to Readers to pass down a diagnostics object through which all error messages are written. llvm-svn: 209681
* Add "override" and remove "virtual" where appropriate.Rui Ueyama2014-03-061-15/+15
| | | | | | | For the record, I used clang-modernize to add "override" and perl to remove "virtual". llvm-svn: 203164
* [InputGraph][Gnu] Add LinkerScript support.Shankar Easwaran2013-11-241-0/+26
| | | | | | | | | | | | | | | | This adds LinkerScript support by creating a type Script which is of type FileNode in the InputGraph. Once the LinkerScript Parser converts the LinkerScript into a sequence of command, the commands are handled by the equivalent LinkerScript node for the current Flavor/Target. For ELF, a ELFGNULdScript gets created which converts the commands to ELF nodes and ELF control nodes(ELFGroup for handling Group nodes). Since the Inputfile type has to be determined in the Driver, the Driver needs to determine the complete path of the file that needs to be processed by the Linker. Due to this, few tests have been removed since the Driver uses paths that doesnot exist. llvm-svn: 195583
* Update error classes from all lowercase to camel case.Rui Ueyama2013-10-091-33/+33
| | | | llvm-svn: 192261
* Convert error code structs to scoped enums.Rui Ueyama2013-10-081-37/+27
| | | | | | | | | | | | | | Summary: The original code with enum "_" is intended to emulate scoped enums. Now we have real scoped enums, so use it. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1852 llvm-svn: 192148
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-0/+25
| | | | | | | | | | | | Changes :- a) Functionality in InputGraph to insert Input elements at any position b) Functionality in the Resolver to use nextFile c) Move the functionality of assigning file ordinals to InputGraph d) Changes all inputs to MemoryBuffers e) Remove LinkerInput, InputFiles, ReaderArchive llvm-svn: 192081
* fix typo in error stringNick Kledzik2013-07-231-1/+1
| | | | llvm-svn: 186996
* Add basic linker script parsing.Michael J. Spencer2013-03-011-6/+28
| | | | llvm-svn: 176309
* Cleanup system_error extensions.Michael J. Spencer2012-01-311-0/+92
llvm-svn: 149432
OpenPOWER on IntegriCloud