[clang] a141e47 - [NFC] Minimize noundef analysis when disabled

Kevin Athey via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 12 17:21:25 PST 2022


Author: Kevin Athey
Date: 2022-01-12T17:21:19-08:00
New Revision: a141e47138505f4ba1d3e716c7ce2d59767d8cf7

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

LOG: [NFC] Minimize noundef analysis when disabled

Minor adjustment in order of noundef analysis to be a bit more optimal (when disabled).

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D117078

Added: 
    

Modified: 
    clang/lib/CodeGen/CGCall.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 26f005131c7f4..cd05fa78da134 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2377,9 +2377,10 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
     }
 
     // Decide whether the argument we're handling could be partially undef
-    bool ArgNoUndef = DetermineNoUndef(ParamType, getTypes(), DL, AI);
-    if (CodeGenOpts.EnableNoundefAttrs && ArgNoUndef)
+    if (CodeGenOpts.EnableNoundefAttrs &&
+        DetermineNoUndef(ParamType, getTypes(), DL, AI)) {
       Attrs.addAttribute(llvm::Attribute::NoUndef);
+    }
 
     // 'restrict' -> 'noalias' is done in EmitFunctionProlog when we
     // have the corresponding parameter variable.  It doesn't make


        


More information about the cfe-commits mailing list