[llvm] e6e9319 - [LLVM][TextAPI] Refactor Redundant Condition (#86542)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 09:36:13 PDT 2024


Author: Troy Butler
Date: 2024-04-19T09:36:08-07:00
New Revision: e6e931960b917e3a37f059a75d476966f572f787

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

LOG: [LLVM][TextAPI] Refactor Redundant Condition (#86542)

Fixes #83241

---------

Signed-off-by: Troy-Butler <squintik at outlook.com>
Co-authored-by: Troy-Butler <squintik at outlook.com>

Added: 
    

Modified: 
    llvm/lib/TextAPI/TextStub.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TextAPI/TextStub.cpp b/llvm/lib/TextAPI/TextStub.cpp
index 0f742523f8207c..d903ba409360d6 100644
--- a/llvm/lib/TextAPI/TextStub.cpp
+++ b/llvm/lib/TextAPI/TextStub.cpp
@@ -276,7 +276,7 @@ namespace yaml {
 template <> struct MappingTraits<ExportSection> {
   static void mapping(IO &IO, ExportSection &Section) {
     const auto *Ctx = reinterpret_cast<TextAPIContext *>(IO.getContext());
-    assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+    assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
            "File type is not set in YAML context");
 
     IO.mapRequired("archs", Section.Architectures);
@@ -298,7 +298,7 @@ template <> struct MappingTraits<ExportSection> {
 template <> struct MappingTraits<UndefinedSection> {
   static void mapping(IO &IO, UndefinedSection &Section) {
     const auto *Ctx = reinterpret_cast<TextAPIContext *>(IO.getContext());
-    assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
+    assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
            "File type is not set in YAML context");
 
     IO.mapRequired("archs", Section.Architectures);


        


More information about the llvm-commits mailing list