summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Supress MSVC padding warning in alignment testAndrew Kaylor2015-03-261-0/+6
| | | | llvm-svn: 233305
* Don't treat .foo as two path components in path::iteratorsBen Langmuir2015-03-101-0/+43
| | | | | | | We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'], which lead to insanity. Same for '..'. llvm-svn: 231727
* Detect malformed YAML sequence in yaml::Input::beginSequence()Justin Bogner2015-03-021-0/+86
| | | | | | | | | | | | | | | | | | | | | When reading a yaml::SequenceTraits object, YAMLIO does not report an error if the yaml item is not a sequence. Instead, YAMLIO reads an empty sequence. For example: --- seq: foo: 1 bar: 2 ... If `seq` is a SequenceTraits object, then reading the above yaml will yield `seq` as an empty sequence. Fix this to report an error for the above mapping ("not a sequence") Patch by William Fisher. Thanks! llvm-svn: 230976
* Silence some Win64 clang-cl warnings about unused stuff due to ifdefsReid Kleckner2015-02-261-0/+2
| | | | llvm-svn: 230685
* Object: Handle Mach-O kext bundle filesJustin Bogner2015-02-251-0/+2
| | | | | | This particular subtype of Mach-O was missing. Add it. llvm-svn: 230567
* Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the ↵Aaron Ballman2015-02-151-1/+1
| | | | | | macro. NFC; LLVM edition. llvm-svn: 229335
* Support: Add dwarf::getOperationEncoding()Duncan P. N. Exon Smith2015-02-131-0/+14
| | | | llvm-svn: 229001
* Try to fix the MSVC build.Benjamin Kramer2015-02-121-1/+1
| | | | | | | 0xFFFFFFFFFFFFFFFFLL doesn't fit in a long long so it should have type 'unsigned long long'. MSVC thinks it's a (signed) __int64. llvm-svn: 228950
* MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line ↵Benjamin Kramer2015-02-121-7/+4
| | | | | | | | with countTrailingZeros Update all callers. llvm-svn: 228930
* Support: Fix tests for VirtualityStringDuncan P. N. Exon Smith2015-02-071-4/+7
| | | | | | | | | Since these `dwarf` functions return `const char *`, the tests need to use `StringRef` for checks. Should fix, e.g., hexagon [1]. [1]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/22435 llvm-svn: 228478
* Support: Add dwarf::getVirtuality()Duncan P. N. Exon Smith2015-02-071-0/+12
| | | | llvm-svn: 228474
* Support: Use Dwarf.def for DW_VIRTUALITY, NFCDuncan P. N. Exon Smith2015-02-071-0/+14
| | | | | | | Use definition file for `DW_VIRTUALITY_*`. Add a `DW_VIRTUALITY_max` both for ease of testing and for future use by the `LLParser`. llvm-svn: 228473
* Support: Add dwarf::getAttributeEncoding()Duncan P. N. Exon Smith2015-02-061-0/+16
| | | | llvm-svn: 228470
* Support: Stop stringifying DW_ATE_{lo,hi}_userDuncan P. N. Exon Smith2015-02-061-0/+10
| | | | llvm-svn: 228468
* Support: Add dwarf::getLanguage()Duncan P. N. Exon Smith2015-02-061-0/+17
| | | | llvm-svn: 228458
* Support: Stop stringifying DW_LANG_{lo,hi}_userDuncan P. N. Exon Smith2015-02-061-0/+10
| | | | llvm-svn: 228451
* Add support for double / float to EndianStreamMatt Arsenault2015-02-052-0/+158
| | | | | | Also add new unit tests for endian::Writer llvm-svn: 228269
* SpecialCaseList: Add support for parsing multiple input files.Alexey Samsonov2015-02-041-6/+32
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows users to create SpecialCaseList objects from multiple local files. This is needed to implement a proper support for -fsanitize-blacklist flag (allow users to specify multiple blacklists, in addition to default blacklist, see PR22431). DFSan can also benefit from this change, as DFSan instrumentation pass now accepts ABI-lists both from -fsanitize-blacklist= and -mllvm -dfsan-abilist flags. Go bindings are fixed accordingly. Test Plan: regression test suite Reviewers: pcc Subscribers: llvm-commits, axw, kcc Differential Revision: http://reviews.llvm.org/D7367 llvm-svn: 228155
* Support: Add string => unsigned mapping for DW_TAGDuncan P. N. Exon Smith2015-02-031-0/+16
| | | | | | Add `dwarf::getTag()` to translate from `StringRef` to `unsigned`. llvm-svn: 228031
* Support: Stop stringifying DW_TAG_{lo,hi}_userDuncan P. N. Exon Smith2015-02-032-0/+30
| | | | | | | | `dwarf::TagString()` shouldn't stringify `DW_TAG_lo_user` or `DW_TAG_hi_user`. These aren't actual tags; they're markers for the edge of vendor-specific tag regions. llvm-svn: 228029
* Support: Add missing header to BlockFrequencyTest.cpp, NFCDuncan P. N. Exon Smith2015-02-021-0/+9
| | | | llvm-svn: 227825
* Refactoring llvm command line parsing and option registration.Chris Bieneman2015-01-281-7/+5
| | | | | | | | | | | | | | | | | | | | | Summary: The primary goal of this patch is to remove the need for MarkOptionsChanged(). That goal is accomplished by having addOption and removeOption properly sort the options. This patch puts the new add and remove functionality on a CommandLineParser class that is a placeholder. Some of the functionality in this class will need to be merged into the OptionRegistry, and other bits can hopefully be in a better abstraction. This patch also removes the RegisteredOptionList global, and the need for cl::Option objects to be linked list nodes. The changes in CommandLineTest.cpp are required because these changes shift when we validate that options are not duplicated. Before this change duplicate options were only found during certain cl API calls (like cl::ParseCommandLine). With this change duplicate options are found during option construction. Reviewers: dexonsmith, chandlerc, pete Reviewed By: pete Subscribers: pete, majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D7132 llvm-svn: 227345
* Re-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.Chris Bieneman2015-01-271-3/+28
| | | | | | This contains the changes from r227148 & r227154, and also fixes to the test case to properly clean up the stack options. llvm-svn: 227255
* Revert r227148 & r227154 which added a test which infinitely loops.Richard Trieu2015-01-271-25/+0
| | | | | | | | | | | | r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly outputs two following lines: -tool: CommandLine Error: Option 'test-option-1' registered more than once! -tool: CommandLine Error: Option 'test-option-2' registered more than once! r227154 depends on changes from r227148 llvm-svn: 227167
* Fix unsigned/signed comparison warning.Eric Christopher2015-01-271-1/+1
| | | | llvm-svn: 227158
* One more fix to the new API to fix const-correctness.Chris Bieneman2015-01-271-1/+2
| | | | llvm-svn: 227154
* Pete Cooper suggested the new API should use ArrayRef instead of ↵Chris Bieneman2015-01-261-0/+24
| | | | | | SmallVectorImpl. Also adding a test case. llvm-svn: 227148
* Add a UTF8 to UTF16 conversion wrapper for use in the pdb dumperReid Kleckner2015-01-261-0/+14
| | | | | | | | | This can also be used instead of the WindowsSupport.h ConvertUTF8ToUTF16 helpers, but that will require massaging some character types. The Windows support routines want wchar_t output, but wchar_t is often 32 bits on non-Windows OSs. llvm-svn: 227122
* Teach raw_ostream to support hex formatting without a prefix '0x'.Zachary Turner2015-01-261-0/+2
| | | | | | | | | | Previously using format_hex() would always print a 0x prior to the hex characters. This allows this to be optional, so that one can choose to print (e.g.) 255 as either 0xFF or just FF. Differential Revision: http://reviews.llvm.org/D7151 llvm-svn: 227108
* Putting all the standard tool options into a "Generic" category.Chris Bieneman2015-01-261-0/+5
| | | | | | | | | | | | | | | Summary: This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings. This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API. Reviewers: dexonsmith, chandlerc, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7150 llvm-svn: 227093
* Adding a new cl::HideUnrelatedOptions API to allow clang to migrate off ↵Chris Bieneman2015-01-211-0/+11
| | | | | | | | | | | | | | | | cl::getRegisteredOptions. Summary: cl::getRegisteredOptions really exposes some of the innards of how command line parsing is implemented. Exposing new APIs that allow us to disentangle client code from implementation details will allow us to make more extensive changes to command line parsing. Reviewers: chandlerc, dexonsmith, beanz Reviewed By: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7100 llvm-svn: 226729
* Suppress the newly added Clang warning for the inaccessible base in thisChandler Carruth2015-01-191-4/+4
| | | | | | | | test. Do that after we suppress the warnings for unknown pragmas as this warning flag is quite new in Clang and so old Clang's would warn all the time on this file. llvm-svn: 226444
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-145-5/+3
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* ConvertUTFTest: fix misleading empty lineDmitri Gribenko2015-01-101-1/+1
| | | | llvm-svn: 225580
* StringPool: Cleanup typos in unittest commentsDavid Majnemer2014-12-151-2/+2
| | | | | | No functional change intended. llvm-svn: 224226
* ThreadLocal: Return a mutable pointer if templated with a non-const typeDavid Majnemer2014-12-151-2/+21
| | | | | | | It makes more sense for ThreadLocal<const T>::get to return a const T* and ThreadLocal<T>::get to return a T*. llvm-svn: 224225
* Move the resize file feature from mapped_file_region to the only user.Rafael Espindola2014-12-121-3/+6
| | | | | | This removes a duplicated stat on every file that llvm-ar looks at. llvm-svn: 224138
* Pass a FD to resise_file and add a testcase.Rafael Espindola2014-12-121-0/+10
| | | | | | I will add a real use in another commit. llvm-svn: 224136
* Remove unused feature. NFC.Rafael Espindola2014-12-121-3/+2
| | | | llvm-svn: 224135
* Remove a convoluted way of calling close by moving the call to the only caller.Rafael Espindola2014-12-111-12/+3
| | | | | | As a bonus we can actually check the return value. llvm-svn: 224046
* Remove dead code. NFC.Rafael Espindola2014-12-111-10/+7
| | | | llvm-svn: 224029
* Remove dead code. NFC.Rafael Espindola2014-12-042-21/+1
| | | | | | This interface was added 2 years ago but users never developed. llvm-svn: 223368
* More long path name support on Windows, this time in program execution.Paul Robinson2014-11-241-0/+50
| | | | | | | Allows long paths for the executable and redirected stdin/stdout/stderr. Addresses PR21563. llvm-svn: 222671
* Support: Add *cast_or_null<> for pointer wrappersDuncan P. N. Exon Smith2014-11-241-0/+96
| | | | | | | | | | | | | | | | | | | | Fill in omission of `cast_or_null<>` and `dyn_cast_or_null<>` for types that wrap pointers (e.g., smart pointers). Type traits need to be slightly stricter than for `cast<>` and `dyn_cast<>` to resolve ambiguities with simple types. There didn't seem to be any unit tests for pointer wrappers, so I tested `isa<>`, `cast<>`, and `dyn_cast<>` while I was in there. This only supports pointer wrappers with a conversion to `bool` to check for null. If in the future it's useful to support wrappers without such a conversion, it should be a straightforward incremental step to use the `simplify_type` machinery for the null check. In that case, the unit tests should be updated to remove the `operator bool()` from the `pointer_wrappers::PTy`. llvm-svn: 222644
* Fix a silly bug in StreamingMemoryObject.cpp.Rafael Espindola2014-11-212-0/+31
| | | | | | | The logic for detecting EOF was wrong and would fail if we ever requested more than 16k past the last read position. llvm-svn: 222505
* Remove support for undocumented SpecialCaseList entries.Alexey Samsonov2014-11-201-19/+1
| | | | | | | | | | | | | "global-init", "global-init-src" and "global-init-type" were originally used to blacklist entities in ASan init-order checker. However, they were never documented, and later were replaced by "=init" category. Old blacklist entries should be converted as follows: * global-init:foo -> global:foo=init * global-init-src:bar -> src:bar=init * global-init-type:baz -> type:baz=init llvm-svn: 222401
* Fixing some sign comparison warnings from MSVC; NFC.Aaron Ballman2014-11-131-3/+3
| | | | llvm-svn: 221887
* Drop a few unneeded ctor calls (missed code review comment).Paul Robinson2014-11-131-4/+4
| | | | llvm-svn: 221845
* Improve long path name support on Windows.Paul Robinson2014-11-131-2/+59
| | | | | | | | | | Windows normally limits the length of an absolute path name to 260 characters; directories can have lower limits. These limits increase to about 32K if you use absolute paths with the special '\\?\' prefix. Teach Support\Windows\Path.inc to use that prefix as needed. TODO: Other parts of Support could also learn to use this prefix. llvm-svn: 221841
* [CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is ↵NAKAMURA Takumi2014-11-071-0/+5
| | | | | | | | built as SHARED. Users of LLVMSupport won't inherit ${system_libs}. unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly. llvm-svn: 221531
OpenPOWER on IntegriCloud