[llvm] e61e761 - [llvm][TextAPI] add Default FileType value to InterfaceFile Objects

Cyndy Ishida via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 22:26:55 PST 2023


Author: Cyndy Ishida
Date: 2023-02-22T22:26:13-08:00
New Revision: e61e761643a887fca7ef2dbae14a6b96de67fa5d

URL: https://github.com/llvm/llvm-project/commit/e61e761643a887fca7ef2dbae14a6b96de67fa5d
DIFF: https://github.com/llvm/llvm-project/commit/e61e761643a887fca7ef2dbae14a6b96de67fa5d.diff

LOG: [llvm][TextAPI] add Default FileType value to InterfaceFile Objects

* This silences msan errors

Added: 
    

Modified: 
    llvm/include/llvm/TextAPI/InterfaceFile.h
    llvm/unittests/TextAPI/TextStubV3Tests.cpp
    llvm/unittests/TextAPI/TextStubV4Tests.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/TextAPI/InterfaceFile.h b/llvm/include/llvm/TextAPI/InterfaceFile.h
index 2ee22ee4c8f2d..7d20c6f634860 100644
--- a/llvm/include/llvm/TextAPI/InterfaceFile.h
+++ b/llvm/include/llvm/TextAPI/InterfaceFile.h
@@ -442,7 +442,7 @@ class InterfaceFile {
 
   TargetList Targets;
   std::string Path;
-  FileType FileKind;
+  FileType FileKind{FileType::Invalid};
   std::string InstallName;
   PackedVersion CurrentVersion;
   PackedVersion CompatibilityVersion;

diff  --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
index b97b6a2abe980..65b2f2d1e0b88 100644
--- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -940,6 +940,7 @@ TEST(TBDv3, InterfaceInequality) {
   }));
   EXPECT_TRUE(checkEqualityOnTransform(FileA, FileB, [](InterfaceFile *File) {
     InterfaceFile Document;
+    Document.setFileType(FileType::TBD_V3);
     Document.addTargets(TargetList{Target(AK_armv7, PLATFORM_IOS),
                                    Target(AK_arm64, PLATFORM_IOS)});
     Document.setInstallName("/System/Library/Frameworks/A.framework/A");

diff  --git a/llvm/unittests/TextAPI/TextStubV4Tests.cpp b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
index 39dac0abc8b8f..f4746418df0af 100644
--- a/llvm/unittests/TextAPI/TextStubV4Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
@@ -1166,6 +1166,7 @@ TEST(TBDv4, InterfaceInequality) {
   }));
   EXPECT_TRUE(checkEqualityOnTransform(FileA, FileB, [](InterfaceFile *File) {
     InterfaceFile Document;
+    Document.setFileType(FileType::TBD_V4);
     Document.addTargets(TargetList{Target(AK_i386, PLATFORM_MACOS),
                                    Target(AK_x86_64, PLATFORM_MACOS)});
     Document.setInstallName("/System/Library/Frameworks/A.framework/A");


        


More information about the llvm-commits mailing list