summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Untabify.NAKAMURA Takumi2015-09-221-3/+2
| | | | llvm-svn: 248264
* Remove roundingMode argument in APFloat::modStephen Canon2015-09-211-3/+3
| | | | | | Because mod is always exact, this function should have never taken a rounding mode argument. The actual implementation still has issues, which I'll look at resolving in a subsequent patch. llvm-svn: 248195
* Revert "[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def"James Molloy2015-09-211-3/+0
| | | | | | | | This was committed without the code review (http://reviews.llvm.org/D12937) being approved. This reverts commit r248152. llvm-svn: 248174
* [ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.defArtyom Skrobov2015-09-211-0/+3
| | | | | | | | | | | | | | | | Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in tools/clang/lib/Basic/Targets.cpp, with a FIXME: attached. This patch changes the handling of +t2dsp to be in line with other architecture extensions. Following review comments, also updating the description of FeatureDSPThumb2 in ARM.td. Differential Revision: http://reviews.llvm.org/D12937 llvm-svn: 248152
* Remove temporary file on signal.Rafael Espindola2015-09-181-1/+6
| | | | | | Without this lld leaves temporary files behind when it crashes. llvm-svn: 247994
* [Support] Reapply r245289 "Always wait for GraphViz before opening the viewer"Michael Kruse2015-09-181-1/+1
| | | | | | | | | | | | | The change was accidentally undone by r245290. Original log message: When calling DisplayGraph and a PS viewer is chosen, two programs are executed: The GraphViz generator and the PostScript viewer. Always wait for the generator to finish to ensure that the .ps file is written before opening the viewer for that file. DisplayGraph's wait parameter refers to whether to wait until the user closes the viewer. This happened on Windows and if none of the options to open the .dot file directly applies, also on Linux. Differential Revision: http://reviews.llvm.org/D11876 llvm-svn: 247980
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-152-316/+0
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
* Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders2015-09-152-0/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and related. NFC. Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Thanks go to Pavel Labath for fixing LLDB for me. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247692
* Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders2015-09-152-316/+0
| | | | | | LLDB needs to be updated in the same commit. llvm-svn: 247686
* Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders2015-09-152-0/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
* Add #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.Yaron Keren2015-09-111-0/+1
| | | | | | | | | | Source code was assuming that llvm-config.h would be included somehow but up to r247253 that added #include "llvm/Support/Compiler.h" to StringRef.h the config file was not actually included. The inclusion of llvm-config.h caused a change of behaviour in tools/clang/test/Frontend/source-col-map.c: previously it would output the original UTF-8 but now it outputs <U+03B1>. llvm-svn: 247409
* Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.Cong Hou2015-09-111-1/+0
| | | | llvm-svn: 247376
* Add .exe check to Execute to fix clang-modernize tests broken in r247358Reid Kleckner2015-09-101-0/+8
| | | | llvm-svn: 247361
* ScanDirForExecutable on Windows fails to find executables with the "exe" ↵Reid Kleckner2015-09-102-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | extension in name When the driver tries to locate a program by its name, e.g. a linker, it scans the paths provided by the toolchain using the ScanDirForExecutable function. If the lookup fails, the driver uses llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName, ScanDirForExecutable is not aware of file extensions. If the program has the "exe" extension in its name, which is very common on Windows, ScanDirForExecutable won't find it under the toolchain-provided paths. This patch changes the Windows version of the "`can_execute`" function called by ScanDirForExecutable to respect file extensions, similarly to llvm::sys::findProgramByName. Patch by Oleg Ranevskyy Reviewers: rnk Differential Revision: http://reviews.llvm.org/D12711 llvm-svn: 247358
* Pass BranchProbability/BlockMass by value instead of const& as they are ↵Cong Hou2015-09-101-4/+4
| | | | | | small. NFC. llvm-svn: 247357
* [ADT] Rewrite the StringRef::find implementation to be simpler, clearer,Chandler Carruth2015-09-101-16/+23
| | | | | | | | | | | | | | | | and tremendously less reliant on the optimizer to fix things. The code is always necessarily looking for the entire length of the string when doing the equality tests in this find implementation, but it previously was needlessly re-checking the size each time among other annoyances. By writing this so simply an ddirectly in terms of memcmp, it also is about 8x faster in a debug build, which in turn makes FileCheck about 2x faster in 'ninja check-llvm'. This saves about 8% of the time for FileCheck-heavy parts of the test suite like the x86 backend tests. llvm-svn: 247269
* [ADT] Micro-optimize the Triple constructor by doing a single split andChandler Carruth2015-09-101-8/+21
| | | | | | | | | | | | re-using the resulting components rather than repeatedly splitting and re-splitting to compute each component as part of the initializer list. This is more work on PR23676. Sadly, it doesn't help much. It removes the constructor from my profile, but doesn't make a sufficient dent in the total time. But it should play together nicely with subsequent changes. llvm-svn: 247250
* [ADT] Fix a confusing interface spec and some annoying peculiaritiesChandler Carruth2015-09-101-31/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | with the StringRef::split method when used with a MaxSplit argument other than '-1' (which nobody really does today, but which should actually work). The spec claimed both to split up to MaxSplit times, but also to append <= MaxSplit strings to the vector. One of these doesn't make sense. Given the name "MaxSplit", let's go with it being a max over how many *splits* occur, which means the max on how many strings get appended is MaxSplit+1. I'm not actually sure the implementation correctly provided this logic either, as it used a really opaque loop structure. The implementation was also playing weird games with nullptr in the data field to try to rely on a totally opaque hidden property of the split method that returns a pair. Nasty IMO. Replace all of this with what is (IMO) simpler code that doesn't use the pair returning split method, and instead just finds each separator and appends directly. I think this is a lot easier to read, and it most definitely matches the spec. Added some tests that exercise the corner cases around StringRef() and StringRef("") that all now pass. I'll start using this in code in the next commit. llvm-svn: 247249
* [ADT] Switch a bunch of places in LLVM that were doing single-characterChandler Carruth2015-09-102-3/+3
| | | | | | | splits to actually use the single character split routine which does less work, and in a debug build is *substantially* faster. llvm-svn: 247245
* [ADT] Add a single-character version of the small vector split routineChandler Carruth2015-09-102-1/+21
| | | | | | | | | | | on StringRef. Finding and splitting on a single character is substantially faster than doing it on even a single character StringRef -- we immediately get to a *very* tuned memchr call this way. Even nicer, we get to this even in a debug build, shaving 18% off the runtime of TripleTest.Normalization, helping PR23676 some more. llvm-svn: 247244
* Added arch extensions and default target features in TargetParser.Alexandros Lamprineas2015-09-051-5/+30
| | | | | Differential: http://reviews.llvm.org/D11590 llvm-svn: 246930
* Add Myriad into enum VendorTypeDouglas Katzman2015-09-021-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D12540 llvm-svn: 246732
* Move twice-repeated clang path operation into a new function.Douglas Katzman2015-09-021-2/+10
| | | | | | And make it more robust in the edge case of exactly "./" as input. llvm-svn: 246711
* [MC] Add support for generating COFF CRCsDavid Majnemer2015-09-012-0/+97
| | | | | | | | | | | | | | | | | | COFF sections are accompanied with an auxiliary symbol which includes a checksum. This checksum used to be filled with just zero but this seems to upset LINK.exe when it is processing a /INCREMENTAL link job. Instead, fill the CheckSum field with the JamCRC of the section contents. This matches MSVC's behavior. This fixes PR19666. N.B. A rather simple implementation of JamCRC is given. It implements a byte-wise calculation using the method given by Sarwate. There are implementations with higher throughput like slice-by-eight and making use of PCLMULQDQ. We can switch to one of those techniques if it turns out to be a significant use of time. llvm-svn: 246590
* Stop calling the flat out insane ARM target parsing code unless theChandler Carruth2015-08-301-8/+20
| | | | | | | | | | | | | | | | | | | | | | | architecture string is something quite weird. Similarly delay calling the BPF parsing code, although that is more reasonable. To understand why I was motivated to make this change, it cuts the time for running the ADT TripleTest unittests by a factor of two in non-optimized builds (the developer default) and reduces my 'check-llvm' time by a full 15 seconds. The implementation of parseARMArch is *that* slow. I tried to fix it in the prior series of commits, but frankly, I have no idea how to finish fixing it. The entire premise of the function (to allow 'v7a-unknown-linux' or some such to parse as an 'arm-unknown-linux' triple) seems completely insane to me, but I'll let the ARM folks sort that out. At least it is now out of the critical path of every developer working on LLVM. It also will likely make some other folks' code significantly faster as I've heard reports of 2% of time spent in triple parsing even in optimized builds! I'm not done making this code faster, but I am done trying to improve the ARM target parsing code. llvm-svn: 246378
* Remove a linear walk to find the default FPU for a given CPU by directlyChandler Carruth2015-08-301-7/+6
| | | | | | expanding the .def file within a StringSwitch. llvm-svn: 246377
* Teach the target parsing framework to directly compute the length of allChandler Carruth2015-08-302-45/+72
| | | | | | | | | | of its strings when expanding the string literals from the macros, and push all of the APIs to be StringRef instead of C-string APIs. This (remarkably) removes a very non-trivial number of strlen calls. It even deletes code and complexity from one of the primary users -- Clang. llvm-svn: 246374
* Refactor the ARM target parsing to use a def file with macros to expandChandler Carruth2015-08-301-164/+14
| | | | | | | | | | | | | | the necessary tables. This will allow me to restructure the code and structures using this to be significantly more efficient. It also removes the duplication of the list of several enumerators. It also enshrines that the order of enumerators match the order of the entries in the tables, something the implementation code actually uses. No functionality changed (yet). llvm-svn: 246370
* [Triple] Use clang-format to normalize the formatting of the ARM targetChandler Carruth2015-08-301-36/+35
| | | | | | | | | | | | | parsing logic prior to making substantial changes to it. This parsing logic is incredibly wasteful, so I'm planning to rewrite it. Just unittesting the triple parsing logic spends well over 80% of its time in the ARM parsing logic, and others have measured significant time spent here in real production compiles. Stay tuned... llvm-svn: 246369
* [Triple] Stop abusing a class to have only static methods and just useChandler Carruth2015-08-302-36/+36
| | | | | | | the namespace that we are already using for the enums that are produced by the parsing. llvm-svn: 246367
* Expose more properties of llvm::fltSemanticsJF Bastien2015-08-261-0/+15
| | | | | | | | | | | Summary: Adds accessor functions for all the fields in llvm::fltSemantics. This will be used in MergeFunctions to order two APFloats with different semanatics. Author: jrkoenig Reviewers: jfb Subscribers: dschuff, llvm-commits Differential revision: http://reviews.llvm.org/D12253 llvm-svn: 245999
* [ARM] Fix MachO CPU Subtype selectionVedant Kumar2015-08-211-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12040 llvm-svn: 245744
* [APFloat] Remove else after return and replace loop with std::equal. NFC.Benjamin Kramer2015-08-211-11/+5
| | | | llvm-svn: 245707
* Support: Clean up TSan annotations.Peter Collingbourne2015-08-183-20/+2
| | | | | | | | | | | Remove support for Valgrind-based TSan, which hasn't been maintained for a few years. We now use the TSan annotations only if LLVM is compiled with -fsanitize=thread. We no longer need the weak function definitions as we are guaranteed that our program is linked directly with the TSan runtime. Differential Revision: http://reviews.llvm.org/D12121 llvm-svn: 245374
* [Support] On Windows, generate PDF files for graphs and open with associated ↵Michael Kruse2015-08-181-23/+49
| | | | | | | | | | | | | | viewer Summary: Windows system rarely have good PostScript viewers installed, but PDF viewers are common. So for viewing graphs, generate PDF files and open with the associated PDF viewer using cmd.exe's start command. Reviewers: Bigcheese, aaron.ballman Subscribers: aaron.ballman, JakeVanAdrighem, dwiberg, llvm-commits Differential Revision: http://reviews.llvm.org/D11877 llvm-svn: 245290
* [Support] Always wait for GraphViz before opening the viewerMichael Kruse2015-08-181-1/+1
| | | | | | | | | | | | | | | Summary: When calling DisplayGraph and a PS viewer is chosen, two programs are executed: The GraphViz generator and the PostScript viewer. Always for the generator to finish to ensure that the .ps file is written before opening the viewer for that file. DisplayGraph's wait parameter refers to whether to wait until the user closes the viewer. This happened on Windows and if none of the options to open the .dot file directly applies, also on Linux. Reviewers: Bigcheese, chandlerc, aaron.ballman Subscribers: dwiberg, aaron.ballman, llvm-commits Differential Revision: http://reviews.llvm.org/D11876 llvm-svn: 245289
* [WebAssembly] Don't default to ELF in the triple.Dan Gohman2015-08-171-0/+5
| | | | | | | | WebAssembly doesn't yet have a specified binary format, and it may not end up being ELF, so we don't want the Triple class defaulting to ELF for it at this time. llvm-svn: 245254
* [WebAssembly] Make getArchTypePrefix return "wasm".Dan Gohman2015-08-171-2/+2
| | | | | | | | The arch prefix string isn't currently being used for anything on WebAssembly, but if it were to be used, it makes sense to use the same arch prefix string for wasm32 and wasm64. llvm-svn: 245252
* [ADT] Teach FoldingSet to be movable.Chandler Carruth2015-08-161-0/+20
| | | | | | | | | | This is a very minimal move support - it leaves the moved-from object in a zombie state that is only valid for destruction and move assignment. This seems fine to me, and leaving it in the default constructed state would require adding more state to the object and potentially allocating memory (!!!) and so seems like a Bad Idea. llvm-svn: 245192
* Add a target environment for CoreCLR.Pat Gavlin2015-08-141-0/+2
| | | | | | | | | | Although targeting CoreCLR is similar to targeting MSVC, there are certain important differences that the backend must be aware of (e.g. differences in stack probes, EH, and library calls). Differential Revision: http://reviews.llvm.org/D11012 llvm-svn: 245115
* Revert "[ARM] Fix MachO CPU Subtype selection"Renato Golin2015-08-141-2/+0
| | | | | | This reverts commit r245081, as it breaks many builds. llvm-svn: 245086
* [ARM] Fix MachO CPU Subtype selectionVedant Kumar2015-08-141-0/+2
| | | | | | | | | | This patch makes the Darwin ARM backend take advantage of TargetParser. It also teaches TargetParser about ARMV7K for the first time. This makes target triple parsing more consistent across llvm. Differential Revision: http://reviews.llvm.org/D11996 llvm-svn: 245081
* Fix GCC warning: extra `;' [-Wpedantic].Nick Lewycky2015-08-131-1/+1
| | | | llvm-svn: 244924
* Modify raw_svector_ostream to use its SmallString without additional buffering.Yaron Keren2015-08-131-62/+5
| | | | | | | | | This is faster and avoids the stream and SmallString state synchronization issue. resync() is a no-op and may be safely deleted. I'll do so in a follow-up commit. Reviewed by Rafael Espindola. llvm-svn: 244870
* There is only one saver of strings.Rafael Espindola2015-08-132-3/+3
| | | | llvm-svn: 244854
* Return ErrorOr from FileOutputBuffer::create. NFC.Rafael Espindola2015-08-131-7/+4
| | | | llvm-svn: 244848
* Add model numbers for Skylake CPUs and an additional Broadwell model.Craig Topper2015-08-081-0/+6
| | | | llvm-svn: 244385
* Add Intel family 6 model 93 as Silvermont.Craig Topper2015-08-081-0/+1
| | | | llvm-svn: 244384
* Add Intel family 6 model 90 as Silvermont. Fixes PR24392.Craig Topper2015-08-071-0/+1
| | | | llvm-svn: 244352
* Add functions to save and restore the PrettyStackTrace state.Nico Weber2015-08-071-0/+14
| | | | | | | | | | | | | | | | PrettyStackTraceHead is a LLVM_THREAD_LOCAL, which means it's just a global in LLVM_ENABLE_THREADS=NO builds. If a CrashRecoveryContext is used with code that uses PrettyStackEntries, and a crash happens, PrettyStackTraceHead is currently not reset to its pre-crash value. These functions make it possible to add a cleanup to such code that does this. (Not reseting the value then causes the assert in ~PrettyStackTraceEntry() to fire if the code outside of the CrashRecoveryContext also uses PrettyStackEntries -- for example, clang when building a module.) Part of PR11974. llvm-svn: 244338
OpenPOWER on IntegriCloud