Commit Graph

33 Commits

Author SHA1 Message Date
Chandler Carruth
1b279144ec [cleanup] Re-sort all the #include lines in LLVM using
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 11:23:27 +00:00
Frederic Riss
0c36e97b78 Make DIE.h a public CodeGen header.
dsymutil would like to use all the AsmPrinter/MCStreamer infrastructure
to stream out the DWARF. In order to do so, it will reuse the DIE object
and so this header needs to be public.

The interface exposed here has some corners that cannot be used without a
DwarfDebug object, but clients that want to stream Dwarf can just avoid
these.

Differential Revision: http://reviews.llvm.org/D6695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-05 21:29:41 +00:00
David Blaikie
12d5224df6 DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.
This should reduce the chance of memory leaks like those fixed in
r207240.

There's still some unclear ownership of DIEs happening in DwarfDebug.
Pushing unique_ptr and references through more APIs should help expose
the cases where ownership is a bit fuzzy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207263 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 20:00:34 +00:00
David Blaikie
172515f0be DIEEntry: Refer to the specified DIE via reference rather than pointer.
Makes some more cases (the unit tests, specifically), lexically
compatible with a change to unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 19:33:43 +00:00
David Blaikie
5d71d87bff PR19554: Fix some memory leaks in DIEHashTest.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 17:07:55 +00:00
Eric Christopher
31dd38ed2f Add support for hashing attributes with DW_FORM_block. This required
passing down an AsmPrinter instance so we could compute the size of
the block which could be target specific. All of the test cases in
the unittest don't have any target specific data so we can use a NULL
AsmPrinter there. This also depends upon block data being added as
integers.

We can now hash the entire fission-cu.ll compile unit so turn the
flag on there with the hash value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201752 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 02:50:45 +00:00
Eric Christopher
644dd976b2 This tests DW_FORM_sdata, not DW_FORM_block. Make the test say so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201749 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 01:27:51 +00:00
Eric Christopher
d613f18158 Fix commit thinkos from splitting out patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201748 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 00:59:17 +00:00
Eric Christopher
f5334f2421 Add support for hashing DW_FORM_sdata and a small testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201747 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 00:54:40 +00:00
Eric Christopher
79069f9b50 Format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 00:54:38 +00:00
Eric Christopher
5ff4b203e6 Add support for DW_FORM_flag and DW_FORM_flag_present to the DIE hashing
algorithm. Sink the 'A' + Attribute hash into each form so we don't
have to check valid forms before deciding whether or not we're going
to hash which will let the default be to return without doing anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200571 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 20:02:58 +00:00
Eric Christopher
5ce9d65a28 Fix name of nested type in comment to match code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200570 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 20:02:55 +00:00
Chandler Carruth
974a445bd9 Re-sort all of the includes with ./utils/sort_includes.py so that
subsequent changes are easier to review. About to fix some layering
issues, and wanted to separate out the necessary churn.

Also comment and sink the include of "Windows.h" in three .inc files to
match the usage in Memory.inc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 11:48:04 +00:00
NAKAMURA Takumi
3aabdebde2 [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 11:13:32 +00:00
David Blaikie
7c0c2e56b0 DIEHash: Summary hashing of member functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25 20:04:25 +00:00
David Blaikie
a954618c6e DIEHash: Summary hashing of nested types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25 18:38:43 +00:00
David Blaikie
377e83202c DIEHash: Const correct and use references where non-null/non-rebound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193363 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:29:03 +00:00
David Blaikie
1d7d8da4cb DIEHash: Do not use shallow type hashing for unnamed types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 17:53:58 +00:00
David Blaikie
f196208900 DWARF type hashing: pointers to members
Includes a test case/FIXME demonstrating a bug/limitation in pointer to
member hashing. To be honest I'm not sure why we don't just always use
summary hashing for referenced types... but perhaps I'm missing
something.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193175 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-22 18:14:41 +00:00
David Blaikie
449f036a81 DWARF Type Hashing: Include reference and rvalue reference type in the declarable summary hashing path
More support for 7.25 Part 5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193129 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 23:06:19 +00:00
David Blaikie
f1545a2197 DWARF type hashing: begin implementing Step 5, summary hashing in declarable contexts
There are several other tag types that need similar handling but to
ensure test coverage they'll be coming incrementally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193126 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 22:36:50 +00:00
David Blaikie
e46be7838a DIEHashTest: Correct the order of operands to the TEST macro
And add the 'Test' suffix so the test case name matches the file name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193119 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 20:28:30 +00:00
David Blaikie
3baa3c37ce DWARF type hashing: Handle multiple (including recursive) references to the same type
This uses a map, keeping the type DIE numbering separate from the DIEs
themselves - alternatively we could do things the way GCC does if we
want to add an integer to the DIE type to record the numbering there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193105 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 18:59:40 +00:00
David Blaikie
47f66d5a75 DIEHash: Support for simple (non-recursive, non-reused) type references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 22:07:09 +00:00
David Blaikie
88a68cbbb5 DIEHash: Include the type's context in the type hash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192856 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 00:10:34 +00:00
David Blaikie
c098708220 DIEHash: Use DW_FORM_sdata for integers, per spec.
This allows us to produce the same hash as GCC for at least some simple
examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192855 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 23:36:20 +00:00
David Blaikie
a85ad23a1f Invert arguments to ASSERT_EQ to match gtest diagnostic printing
GTest assumes the left hand side of the assert is the expectation and
the right hand side is the test result. It's easier to read gtest
failures when these things are ordered correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192854 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 22:43:10 +00:00
David Blaikie
75ee00021d DIEHash: Include the trailing zero byte after the children of a DIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 20:29:06 +00:00
David Blaikie
e4df43e36d Use ASSERT_EQ rather than ASSERT_TRUE for better unit test failures.
Also minor using namespace move so it's not hard-up against the function
definition and outside the namespace as is usual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15 23:00:17 +00:00
Benjamin Kramer
449a88e9a6 Plug a memory leak in a unit test. Stack allocation is sufficient here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-29 11:29:20 +00:00
Eric Christopher
df69c9c8e3 It's a very large constant. Say so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 00:58:10 +00:00
Eric Christopher
4bc23f0980 Fix copy and pasto with CMake files for unittest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 22:08:28 +00:00
Eric Christopher
800a876128 Add a hashing routine that handles hashing types. Add a test for
hashing the contents of DW_FORM_data1 on top of a type with attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189862 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 21:57:57 +00:00