summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Introduce bitset metadata format and bitset lowering pass.Peter Collingbourne2015-02-205-1/+90
| | | | | | | | | | | | | | | | | | | | This patch introduces a new mechanism that allows IR modules to co-operatively build pointer sets corresponding to addresses within a given set of globals. One particular use case for this is to allow a C++ program to efficiently verify (at each call site) that a vtable pointer is in the set of valid vtable pointers for the class or its derived classes. One way of doing this is for a toolchain component to build, for each class, a bit set that maps to the memory region allocated for the vtables, such that each 1 bit in the bit set maps to a valid vtable for that class, and lay out the vtables next to each other, to minimize the total size of the bit sets. The patch introduces a metadata format for representing pointer sets, an '@llvm.bitset.test' intrinsic and an LTO lowering pass that lays out the globals and builds the bitsets, and documents the new feature. Differential Revision: http://reviews.llvm.org/D7288 llvm-svn: 230054
* IR: Fix MDType fields from unsigned to uint64_tDuncan P. N. Exon Smith2015-02-191-6/+53
| | | | | | | | | When trying to match the current schema with the new debug info hierarchy, I downgraded `SizeInBits`, `AlignInBits` and `OffsetInBits` to 32-bits (oops!). Caught this while testing my upgrade script to move the hierarchy into place. Bump it back up to 64-bits and update tests. llvm-svn: 229933
* IR: Add missing null operand to MDSubroutineTypeDuncan P. N. Exon Smith2015-02-191-0/+9
| | | | | | | | | Add missing `nullptr` from `MDSubroutineType`'s operands for `MDCompositeTypeBase::getIdentifier()` (and add tests for all the other unused fields). This highlights just how crazy it is that `MDSubroutineType` inherits from `MDCompositeTypeBase`. llvm-svn: 229926
* IR: Drop scope from MDTemplateParameterDuncan P. N. Exon Smith2015-02-191-21/+13
| | | | | | | | | | Follow-up to r229740, which removed `DITemplate*::getContext()` after my upgrade script revealed that scopes are always `nullptr` for template parameters. This is the other shoe: drop `scope:` from `MDTemplateParameter` and its two subclasses. (Note: a bitcode upgrade would be pointless, since the hierarchy hasn't been moved into place.) llvm-svn: 229791
* IR: Allow MDSubrange to have 'count: -1'Duncan P. N. Exon Smith2015-02-181-0/+8
| | | | | | | | | | | | | | It turns out that `count: -1` is a special value indicating an empty array, such as `Values` in: struct T { unsigned Count; int Values[]; }; Handle it. llvm-svn: 229769
* IR: Add MDCompositeTypeBase::replace*()Duncan P. N. Exon Smith2015-02-181-0/+41
| | | | | | | | | Add `replaceElements()`, `replaceVTableHolder()`, and `replaceTemplateParams()` to `MDCompositeTypeBase`. Included an assertion in `replaceElements()` to match the one in `DICompositeType::replaceArrays()`. llvm-svn: 229744
* IR: Add MDCompileUnit::replace*()Duncan P. N. Exon Smith2015-02-181-0/+32
| | | | | | | Add `MDCompileUnit::replaceGlobalVariables()` and `MDCompileUnit::replaceSubprograms()`. llvm-svn: 229743
* IR: Add MDSubprogram::replaceFunction()Duncan P. N. Exon Smith2015-02-181-0/+37
| | | | llvm-svn: 229742
* InstrProf: Don't combine expansion regions with code regionsJustin Bogner2015-02-181-0/+37
| | | | | | | | This was leading to duplicate counts when a code region happened to overlap exactly with an expansion. The combining behaviour only makes sense for code regions. llvm-svn: 229723
* InstrProf: Handle unknown functions if they consist only of zero-regionsJustin Bogner2015-02-181-0/+13
| | | | | | | | | | This comes up when we generate coverage for a function but don't end up emitting the function at all - dead static functions or inline functions that aren't referenced in a particular TU, for example. In these cases we'd like to show that the function was never called, which is trivially true. llvm-svn: 229717
* InstrProf: Make CoverageMapping testable and add a basic unit testJustin Bogner2015-02-181-0/+82
| | | | | | | | Make CoverageMapping easier to create, so that we can write targeted unit tests for its internals, and add a some infrastructure to write these tests. Finally, add a simple unit test for basic functionality. llvm-svn: 229709
* Re-apply "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-182-0/+99
| | | | | | | | | | | | | | Have the InstrProfWriter return a MemoryBuffer instead of a std::string. This fixes the alignment issues the reader would hit, and it's a more appropriate type for this anyway. I've also removed an ugly helper function that's not needed since we're allowing initializer lists now, and updated some error code checks based on MSVC's issues with r229473. This reverts r229483, reapplying r229478. llvm-svn: 229602
* IR: Add missing clone() overloadsDuncan P. N. Exon Smith2015-02-171-0/+60
| | | | | | | | | | Add missing specialized node overloads for `MDNode::clone()` (they were on most of the node types already, but missing from the others). `MDNode::clone()` returns `TempMDNode` (`std::unique_ptr<MDNode,...>`), while `TempMDSubrange::clone()` (for example) returns the more convenient `TempMDSubrange` (`std::unique_ptr<TempMDSubrange,...>`). llvm-svn: 229579
* Re-apply "InstrProf: Use a test fixture in the coverage mapping tests"Justin Bogner2015-02-171-67/+81
| | | | | | | | | | This time we use a helper to format the assertion so we can just use ASSERT_TRUE instead of relying on ASSERT_EQ being able to deal with conversions between enum types. This reverts r229496, re-applying r229473. llvm-svn: 229547
* Correcting the ArrayRef test to not cause use-after-free bugs with ↵Aaron Ballman2015-02-171-3/+5
| | | | | | initializer lists. Should also silence a -Wsign-compare warning accidentally introduced. llvm-svn: 229515
* Adding additional tests to ensure that initializer lists created from return ↵Aaron Ballman2015-02-171-0/+13
| | | | | | values and as function arguments also work as expected. llvm-svn: 229513
* Addressing a post-commit review comment suggesting to avoid using direct ↵Aaron Ballman2015-02-171-1/+1
| | | | | | initialization. llvm-svn: 229512
* I believe we no longer require LLVM_HAS_INITIALIZER_LISTS; it's supported in ↵Aaron Ballman2015-02-171-0/+6
| | | | | | | | MSVC 2013 and GCC. Added a trivial test to ensure the ArrayRef initializer list constructor is called and behaves as expected. If any of the bots complain (perhaps due to an antiquated version of an STL implementation), I will revert. llvm-svn: 229502
* ADT/PointerIntPairTest.cpp: Prune obsolete #if. We don't support msc17 anymore.NAKAMURA Takumi2015-02-171-2/+0
| | | | llvm-svn: 229501
* Reverting r229473; it does not compile with MSVC 2013, and I suspect it was ↵Aaron Ballman2015-02-171-77/+69
| | | | | | meant to be reverted in r229483. llvm-svn: 229496
* Revert "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-172-98/+0
| | | | | | | | | | This added API to the InstrProfWriter to write to a string so I could write unittests without using temp files. This doesn't really work, since the format has tighter alignment requirements than a char. This reverts r229478 and its follow-up, r229481. llvm-svn: 229483
* InstrProf: Add missing header from r229478Justin Bogner2015-02-171-0/+2
| | | | llvm-svn: 229481
* Re-apply "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-172-0/+96
| | | | | | | | Add these tests again, but use va_list instead of initializer lists. This reverts r229456, reapplying r229455. llvm-svn: 229478
* InstrProf: Use a test fixture in the coverage mapping testsJustin Bogner2015-02-171-69/+77
| | | | llvm-svn: 229473
* Revert "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-162-89/+0
| | | | | | | | Looks like the bots don't like my initializer lists. This reverts r229455 llvm-svn: 229456
* InstrProf: Add unit tests for the profile reader and writerJustin Bogner2015-02-162-0/+89
| | | | | | | | | | This required some minor API to be added to these types to avoid needing temp files. Also, I've used initializer lists in the tests, as MSVC 2013 claims to support them. I'll redo this without them if the bots complain. llvm-svn: 229455
* [CMake] Add RuntimeDyld to libdeps corresponding to r229343.NAKAMURA Takumi2015-02-162-0/+2
| | | | llvm-svn: 229351
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-153-15/+15
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Format: Modernize using variadic templates.Benjamin Kramer2015-02-151-4/+4
| | | | | | | | | | | Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed. Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack. llvm-svn: 229337
* 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
* [PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth2015-02-135-17/+16
| | | | | | | | | | | | | | | | | | | | LLVM's include tree and the use of using declarations to hide the 'legacy' namespace for the old pass manager. This undoes the primary modules-hostile change I made to keep out-of-tree targets building. I sent an email inquiring about whether this would be reasonable to do at this phase and people seemed fine with it, so making it a reality. This should allow us to start bootstrapping with modules to a certain extent along with making it easier to mix and match headers in general. The updates to any code for users of LLVM are very mechanical. Switch from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h". Qualify the types which now produce compile errors with "legacy::". The most common ones are "PassManager", "PassManagerBase", and "FunctionPassManager". llvm-svn: 229094
* Fix the build, I forgot to check that UnitTests still built.Zachary Turner2015-02-131-0/+3
| | | | llvm-svn: 229021
* IR: Add MDExpression::ExprOperandDuncan P. N. Exon Smith2015-02-131-0/+36
| | | | | | | | Port `DIExpression::Operand` over to `MDExpression::ExprOperand`. The logic is needed directly in `MDExpression` to support printing in assembly. llvm-svn: 229002
* 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
* Fix warning due to unused private member variable.Zachary Turner2015-02-111-4/+3
| | | | llvm-svn: 228774
* Convert std::make_unique<> to llvm::make_unique<>.Zachary Turner2015-02-101-2/+2
| | | | llvm-svn: 228768
* Add missing function and header include.Zachary Turner2015-02-101-0/+5
| | | | llvm-svn: 228758
* Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.Zachary Turner2015-02-101-15/+15
| | | | | | | | | | | | | This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
* Fix build due to mismatched function signatures.Zachary Turner2015-02-101-2/+5
| | | | llvm-svn: 228752
* IR: Add MDNode::replaceWithPermanent()Duncan P. N. Exon Smith2015-02-101-0/+38
| | | | | | | | | | | | | | | | Add new API for converting temporaries that may self-reference. Self-referencing nodes are not allowed to be uniqued, so sending them into `replaceWithUniqued()` is dangerous (and this commit adds assertions that prevent it). `replaceWithPermanent()` has similar semantics to `get()` followed by calls to `replaceOperandWith()`. In particular, if there's a self-reference, it returns a distinct node; otherwise, it returns a uniqued one. Like `replaceWithUniqued()` and `replaceWithDistinct()` (well, it calls out to them) it mutates the temporary node in place if possible, only calling `replaceAllUsesWith()` on a uniquing collision. llvm-svn: 228726
* IR: Remove unnecessary fields from MDTemplateParameterDuncan P. N. Exon Smith2015-02-101-46/+17
| | | | | | | | I noticed this fields were never used in r228607, but I neglected to propagate that into `MDTemplateParameter` until now. This really should have been done before commit in r228640; sorry for the churn. llvm-svn: 228652
* IR: Add accessors to MDExpressionDuncan P. N. Exon Smith2015-02-101-0/+7
| | | | | | Add some accessors to `MDExpression`. llvm-svn: 228648
* IR: Add specialized debug info metadata nodesDuncan P. N. Exon Smith2015-02-101-0/+847
| | | | | | | | | | | | | | | Add specialized debug info metadata nodes that match the `DIDescriptor` wrappers (used by `DIBuilder`) closely. Assembly and bitcode support to follow soon (it'll mostly just be obvious), but this sketches in today's schema. This is the first big commit (well, the only *big* one aside from the testcase changes that'll come when I move this into place) for PR22464. I've marked a bunch of obvious changes as `TODO`s in the source; I plan to make those changes promptly after this hierarchy is moved underneath `DIDescriptor`, but for now I'm aiming mostly to match the status quo. llvm-svn: 228640
* ADT: Allow up to 18 arguments in hash_combine()Duncan P. N. Exon Smith2015-02-091-0/+25
| | | | | | | | | I just realized that the specialized metadata node patch I'm about to commit won't compile on old compilers. Bump `hash_combine()`'s support for non-variadic templates to 18 (I tested this by reversing the logic in the #ifdef). llvm-svn: 228629
* DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.Zachary Turner2015-02-081-8/+29
| | | | | | | | | Dumping a symbol often requires access to data that isn't inside the symbol hierarchy, but which is only accessible through the top-level session. This patch is a pure interface change to give symbols a reference to the session. llvm-svn: 228542
* Some cleanup for libpdb.Zachary Turner2015-02-081-6/+2
| | | | | | | | | | | This patch implements a few of the optional suggestions from the initial patch comitting libpdb. In particular, it implements a virtual function out of line for each of the concrete classes. A few other minor cleanups exist as well, such as using override instead of virtual, etc. llvm-svn: 228516
* SmallVector: Move emplace_back to SmallVectorImpl.Benjamin Kramer2015-02-071-0/+8
| | | | | | | This resolves the strange effect that emplace_back is only available when the type contained in the vector is not trivially copyable. llvm-svn: 228496
* Consistently use override rather than virtual.Chandler Carruth2015-02-071-8/+8
| | | | | | This fixes -Winconsistent-missing-override warnings. llvm-svn: 228489
OpenPOWER on IntegriCloud