diff options
author | Kevin Athey <kda@google.com> | 2022-01-12 13:29:55 -0800 |
---|---|---|
committer | Kevin Athey <kda@google.com> | 2022-01-12 17:21:19 -0800 |
commit | a141e47138505f4ba1d3e716c7ce2d59767d8cf7 (patch) | |
tree | eb8388844314b9bcfade8541aa760d9ea48e6141 /clang/lib/CodeGen/CGCall.cpp | |
parent | 71af8068ac1283eb7ede70cc841af95acb11bdeb (diff) | |
download | llvm-a141e47138505f4ba1d3e716c7ce2d59767d8cf7.zip llvm-a141e47138505f4ba1d3e716c7ce2d59767d8cf7.tar.gz llvm-a141e47138505f4ba1d3e716c7ce2d59767d8cf7.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 26f0051..cd05fa7 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 |