[clang] 487edfa - [NFC][CodeGen] Add const to a method

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 4 19:11:00 PST 2022


Author: Vitaly Buka
Date: 2022-12-04T19:10:17-08:00
New Revision: 487edfa4327446d884709263006d3b9108181fce

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

LOG: [NFC][CodeGen] Add const to a method

Added: 
    

Modified: 
    clang/lib/CodeGen/CGCall.cpp
    clang/lib/CodeGen/CodeGenModule.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 103716e6fdf6..836f8095f064 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1785,7 +1785,7 @@ static void AddAttributesFromAssumes(llvm::AttrBuilder &FuncAttrs,
 }
 
 bool CodeGenModule::MayDropFunctionReturn(const ASTContext &Context,
-                                          QualType ReturnType) {
+                                          QualType ReturnType) const {
   // We can't just discard the return value for a record type with a
   // complex destructor or a non-trivially copyable type.
   if (const RecordType *RT =

diff  --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 92ce594aa50b..5289f0cc1355 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1476,7 +1476,8 @@ class CodeGenModule : public CodeGenTypeCache {
 
   /// Whether this function's return type has no side effects, and thus may
   /// be trivially discarded if it is unused.
-  bool MayDropFunctionReturn(const ASTContext &Context, QualType ReturnType);
+  bool MayDropFunctionReturn(const ASTContext &Context,
+                             QualType ReturnType) const;
 
   /// Returns whether this module needs the "all-vtables" type identifier.
   bool NeedAllVtablesTypeId() const;


        


More information about the cfe-commits mailing list