diff options
author | Leny Kholodov <lkholodov@accesssoftek.com> | 2016-09-06 10:46:28 +0000 |
---|---|---|
committer | Leny Kholodov <lkholodov@accesssoftek.com> | 2016-09-06 10:46:28 +0000 |
commit | d9478f860586f5b390a868fedb8bfc1d0ae2c16c (patch) | |
tree | f8a511aa8cea9c7080d37a1ba6060ad7f1e45678 /unittests/IR/DebugTypeODRUniquingTest.cpp | |
parent | 4b1b5a450d676b7fa65cfd013ef4243226aa7481 (diff) |
DebugInfo: use strongly typed enum for debug info flags
Use ADT/BitmaskEnum for DINode::DIFlags for the following purposes:
Get rid of unsigned int for flags to avoid problems on platforms with sizeof(int) < 4
Flags are now strongly typed
Patch by: Victor Leschuk <vleschuk@gmail.com>
Differential Revision: https://reviews.llvm.org/D23766
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/IR/DebugTypeODRUniquingTest.cpp')
-rw-r--r-- | unittests/IR/DebugTypeODRUniquingTest.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/unittests/IR/DebugTypeODRUniquingTest.cpp b/unittests/IR/DebugTypeODRUniquingTest.cpp index 2c899d85d1f..2133d8236ad 100644 --- a/unittests/IR/DebugTypeODRUniquingTest.cpp +++ b/unittests/IR/DebugTypeODRUniquingTest.cpp @@ -30,7 +30,7 @@ TEST(DebugTypeODRUniquingTest, getODRType) { // Without a type map, this should return null. EXPECT_FALSE(DICompositeType::getODRType( Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr, - nullptr, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr)); + nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr)); // Enable the mapping. There still shouldn't be a type. Context.enableDebugTypeODRUniquing(); @@ -39,7 +39,7 @@ TEST(DebugTypeODRUniquingTest, getODRType) { // Create some ODR-uniqued type. auto &CT = *DICompositeType::getODRType( Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr, - nullptr, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr); + nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr); EXPECT_EQ(UUID.getString(), CT.getIdentifier()); // Check that we get it back, even if we change a field. @@ -47,11 +47,13 @@ TEST(DebugTypeODRUniquingTest, getODRType) { EXPECT_EQ( &CT, DICompositeType::getODRType(Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr, nullptr, 0, - 0, 0, 0, nullptr, 0, nullptr, nullptr)); + 0, 0, DINode::FlagZero, nullptr, 0, + nullptr, nullptr)); EXPECT_EQ(&CT, DICompositeType::getODRType( Context, UUID, dwarf::DW_TAG_class_type, MDString::get(Context, "name"), nullptr, 0, nullptr, - nullptr, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr)); + nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, + nullptr, nullptr)); // Check that it's discarded with the type map. Context.disableDebugTypeODRUniquing(); @@ -83,7 +85,7 @@ TEST(DebugTypeODRUniquingTest, buildODRType) { // Update with a definition. This time we should see a change. EXPECT_EQ(&CT, DICompositeType::buildODRType( Context, UUID, dwarf::DW_TAG_structure_type, nullptr, nullptr, 0, nullptr, - nullptr, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr)); + nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr)); EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag()); // Further updates should be ignored. @@ -93,7 +95,7 @@ TEST(DebugTypeODRUniquingTest, buildODRType) { EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag()); EXPECT_EQ(&CT, DICompositeType::buildODRType( Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr, - nullptr, 0, 0, 0, 0, nullptr, 0, nullptr, nullptr)); + nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr)); EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag()); } |