summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAge
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-26
| | | | | | Temporarily back out commits r211749, r211752 and r211754. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211814 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-26
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211749 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SourceMgr::getMemoryBuffer() in a couple of placesAlp Toker2014-06-25
| | | | | | Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211656 91177308-0d34-0410-b5e6-96231b3b80d8
* [Emacs] Use spaces rather than tabs for indentation in tablegen-modeAdam Nemet2014-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211564 91177308-0d34-0410-b5e6-96231b3b80d8
* not: Only consider exit code 3 to be a crash with --crashReid Kleckner2014-06-23
| | | | | | | This fixes Clang's test/Index/comment-xml-schema.c with Cygwin's xmllint.exe, which uses exit(3) for XML validation failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211550 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete utils/FileUpdate.Rafael Espindola2014-06-23
| | | | | | It is unused and it looks like it was never used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211508 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove bogus configure checkDavid Greene2014-06-19
| | | | | | | Configure creates makefiles, so it doesn't make sense to check for them to see if we can configure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211301 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option to keep flavor out of the install directoryDavid Greene2014-06-19
| | | | | | | | Sometimes we want to install things in "standard" locations and the flavor directories interfere with that. Add an option to keep them out of the install path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211300 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn of -Werror by defaultDavid Greene2014-06-19
| | | | | | Don't build with -Werror unless asked to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211299 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove OwningPtr.h and associated testsAlp Toker2014-06-19
| | | | | | llvm::OwningPtr is superseded by std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211259 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace some assert(0)'s with llvm_unreachable.Craig Topper2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211141 91177308-0d34-0410-b5e6-96231b3b80d8
* lit: simplify population of the actual_inputs arrayHans Wennborg2014-06-17
| | | | | | | Add all inputs to the array, except those starting with @, which are treated as response files and expanded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211119 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SetTheory from utils/TableGen into lib/TableGen so Clang can use it.James Molloy2014-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211100 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "lit: warn when passed invalid pathname" (r210597)Hans Wennborg2014-06-16
| | | | | | | | | It was pointed out that this breaks the "virtual test discovery" mechanism, which allows for narming tests in the test exec root. Reverting until I can figure out how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211048 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove broken include.Rafael Espindola2014-06-13
| | | | | | Looks like I got some git merge wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210911 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix KillTheDoctor after r210725.Rafael Espindola2014-06-13
| | | | | | | We don't map these windows errors to generic ones since errc::timed_out is not defined on mingw. Just use the raw windows error value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210910 91177308-0d34-0410-b5e6-96231b3b80d8
* [Win32] Let utils/not aware of abort(), aka llvm_unreachable(), in msvcrt.NAKAMURA Takumi2014-06-13
| | | | | | | | It has exit code as 3. abort(), aka unreachable, may be handled as crash. FIXME: Could we move this into Win32/Program.inc? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210895 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last uses of 'using std::error_code'Rafael Espindola2014-06-13
| | | | | | This finishes the transition to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210877 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the build of KillTheDoctor.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210843 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove system_error.h.Rafael Espindola2014-06-12
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210803 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210687 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove windows_error.Rafael Espindola2014-06-11
| | | | | | | | | | MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210631 91177308-0d34-0410-b5e6-96231b3b80d8
* lit: warn when passed invalid pathnameHans Wennborg2014-06-10
| | | | | | | | | | | | | | | It would previously say things like warning: input 'test/Frontend/foo.c' contained no tests and have the user pull their hair trying to figure out what's wrong with that file. This patch changes the message to the much clearer: warning: no such file or directory: 'test/Frontend/foo.c' Differential Revision: http://reviews.llvm.org/D4097 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210597 91177308-0d34-0410-b5e6-96231b3b80d8
* Add detection of OS X relocatable SDK to compiler-rt as a lit.util functionAlexander Potapenko2014-06-10
| | | | | | | | | | | | | Clang's lit cfg already detects the currently selected SDK via "xcrun --show-sdk-path". The same thing should be done for compiler-rt tests, to make them work on recent OS X versions. Instead of duplicating the detection code, this patch extracts the detection function into a lit.util method. Patch by Kuba Brecka (kuba.brecka@gmail.com), reviewed at http://reviews.llvm.org/D4072 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210534 91177308-0d34-0410-b5e6-96231b3b80d8
* Condition codes AL and NV are invalid in the aliases that useArtyom Skrobov2014-06-10
| | | | | | | | | | | | | | | | inverted condition codes (CINC, CINV, CNEG, CSET, and CSETM). Matching aliases based on "immediate classes", when disassembling, wasn't previously supported, hence adding MCOperandPredicate into class Operand, and implementing the support for it in AsmWriterEmitter. The parsing for those aliases was already custom, so just adding the missing condition into AArch64AsmParser::parseCondCode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210528 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactoring in AsmWriterEmitter::EmitPrintAliasInstruction()Artyom Skrobov2014-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210527 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210442 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperandDavid Blaikie2014-06-08
| | | | | | | | | | | | I saw at least a memory leak or two from inspection (on probably untested error paths) and r206991, which was the original inspiration for this change. I ran this idea by Jim Grosbach a few weeks ago & he was OK with it. Since it's a basically mechanical patch that seemed sufficient - usual post-commit review, revert, etc, as needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210427 91177308-0d34-0410-b5e6-96231b3b80d8
* really fix the windows build.Rafael Espindola2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209964 91177308-0d34-0410-b5e6-96231b3b80d8
* utils: Teach lldbDataFormatters to load automaticallyJustin Bogner2014-05-28
| | | | | | | Add an __lldb_init_module function so that importing the lldbDataFormatters script automatically adds the formatters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209712 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the table generated emitPseudoExpansionLowering function to not emit a ↵Aaron Ballman2014-05-23
| | | | | | switch statement containing only a default statement (and no cases). Updated some of the code to use range-based for loops as well. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209521 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: separate load/store operands to simplify assemblerTim Northover2014-05-22
| | | | | | | | | | | | | | | | | | | This changes ARM64 to use separate operands for each component of an address, and look for separate '[', '$Rn, ..., ']' tokens when parsing. This allows us to do away with quite a bit of special C++ code to handle monolithic "addressing modes" in the MC components. The more incremental matching of the assembler operands also allows for better diagnostics when LLVM is presented with invalid input. Most of the complexity here is with the register-offset instructions, which were extremely dodgy beforehand: even when the instruction used wM, LLVM's model had xM as an operand. We papered over this discrepancy before, but that approach doesn't work now so I split them into separate X and W variants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209425 91177308-0d34-0410-b5e6-96231b3b80d8
* [asm matcher] Fix incorrect assertion when there are exactly 32 ↵Daniel Sanders2014-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | SubtargetFeatures Summary: The minimal type needs to hold a value of '1ULL << 31' but getMinimalTypeForRange() is called with a value of '1ULL << 32'. This patch will also reduce the size of the matcher table when there are 8 or 16 SubtargetFeatures. Also added a dump of the SubtargetFeatures to the -debug output and corrected getMinimalTypeInRange() to consider 0xffffffffull to be a 32-bit value. The testcase is that no existing code is broken and that LLVM still successfully compiles after adding MIPS64r6 CodeGen support. Reviewers: rafael Reviewed By: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3787 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209288 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Add module maps for LLVM. These are not quite ready for prime-timeRichard Smith2014-05-21
| | | | | | | | yet, but only a few more Clang patches need to land. (I have 'ninja check' passing locally.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209269 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up language and grammar.Eric Christopher2014-05-20
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209216 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: permit non-leaf ComplexPattern usesTim Northover2014-05-20
| | | | | | | | | | | | | | | | | | This allows the results of a ComplexPattern check to be distributed to separate named Operands, instead of the current system where all results must apply (and match perfectly) with a single Operand. For example, if "some_addrmode" is a ComplexPattern producing two results, you can write: def : Pat<(load (some_addrmode GPR64:$base, imm:$offset)), (INST GPR64:$base, imm:$offset)>; This should allow neater instruction definitions in TableGen that don't put all possible aspects of addressing into a single operand, but are still usable with relatively simple C++ CodeGen idioms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209206 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: convert InstAlias's Emit bit to an int.Tim Northover2014-05-20
| | | | | | | | | | | | | When multiple aliases overlap, the correct string to print can often be determined purely by considering the InstAlias declarations in some particular order. This allows the user to specify that order manually when desired, without resorting to hacking around with the default lexicographical order on Record instantiation, which is error-prone and ugly. I was also mistaken about "add w2, w3, w4" being the same as "add w2, w3, w4, uxtw". That's only true if Rn is the stack pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209199 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos.Eric Christopher2014-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209164 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: fix operand counting for aliasesTim Northover2014-05-16
| | | | | | | | | | | | | | | | | | | | | TableGen has a fairly dubious heuristic to decide whether an alias should be printed: does the alias have lest operands than the real instruction. This is bad enough (particularly with no way to override it), but it should at least be calculated consistently for both strings. This patch implements that logic: first get the *correct* string for the variant, in the same way as the Matcher, without guessing; then count the number of whitespace chars. There are basically 4 changes this brings about after the previous commits; all of these appear to be good, so I have changed the tests: + ARM64: we print "neg X, Y" instead of "sub X, xzr, Y". + ARM64: we skip implicit "uxtx" and "uxtw" modifiers. + Sparc: we print "mov A, B" instead of "or %g0, A, B". + Sparc: we print "fcmpX A, B" instead of "fcmpX %fcc0, A, B" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208969 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: use correct MIOperand when printing aliasesTim Northover2014-05-15
| | | | | | | | | | | | | | Previously, TableGen assumed that every aliased operand consumed precisely 1 MachineInstr slot (this was reasonable because until a couple of days ago, nothing more complicated was eligible for printing). This allows a couple more ARM64 aliases to print so we can remove the special code. On the X86 side, I've gone for explicit AT&T size specifiers as the default, so turned off a few of the aliases that would have just started printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208880 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen/ARM64: print aliases even if they have syntax variants.Tim Northover2014-05-15
| | | | | | | To get at least one use of the change (and some actual tests) in with its commit, I've enabled the AArch64 & ARM64 NEON mov aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208867 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typosAlp Toker2014-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208839 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the table generator to not generate switch statements containing only ↵Aaron Ballman2014-05-13
| | | | | | | | a default label with no cases. This solves some warnings with MSVC. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208694 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: strengthen assertTim Northover2014-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208679 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix gcc -Wparentheses warning.Jay Foad2014-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208675 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: use PrintMethods to print more aliasesTim Northover2014-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208607 91177308-0d34-0410-b5e6-96231b3b80d8
* Move late partial-unrolling thresholds into the processor definitionsHal Finkel2014-05-08
| | | | | | | | | | | | | | | | | | | | | | The old method used by X86TTI to determine partial-unrolling thresholds was messy (because it worked by testing target features), and also would not correctly identify the target CPU if certain target features were disabled. After some discussions on IRC with Chandler et al., it was decided that the processor scheduling models were the right containers for this information (because it is often tied to special uop dispatch-buffer sizes). This does represent a small functionality change: - For generic x86-64 (which uses the SB model and, thus, will get some unrolling). - For AMD cores (because they still currently use the SB scheduling model) - For Haswell (based on benchmarking by Louis Gerbarg, it was decided to bump the default threshold to 50; we're working on a test case for this). Otherwise, nothing has changed for any other targets. The logic, however, has been moved into BasicTTI, so other targets may now also opt-in to this functionality simply by setting LoopMicroOpBufferSize in their processor model definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208289 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug.h already includes raw_ostream.h, no need to include it again.Eric Christopher2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208235 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Add build rules for llvm-PerfectShuffle utilityAlexey Samsonov2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208225 91177308-0d34-0410-b5e6-96231b3b80d8