[clang] b11decc - [clang codegen][opaque pointers] Remove use of deprecated constructor

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 18:01:36 PDT 2020


Author: Eli Friedman
Date: 2020-04-03T18:00:33-07:00
New Revision: b11decc221a65d2c7290b93a4662a607a63b6d86

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

LOG: [clang codegen][opaque pointers] Remove use of deprecated constructor

(See also D76269.)

Added: 
    

Modified: 
    clang/lib/CodeGen/CGCleanup.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index c117dd5c25c1..5e01100db163 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -309,7 +309,8 @@ static void createStoreInstBefore(llvm::Value *value, Address addr,
 
 static llvm::LoadInst *createLoadInstBefore(Address addr, const Twine &name,
                                             llvm::Instruction *beforeInst) {
-  auto load = new llvm::LoadInst(addr.getPointer(), name, beforeInst);
+  auto load = new llvm::LoadInst(addr.getElementType(), addr.getPointer(), name,
+                                 beforeInst);
   load->setAlignment(addr.getAlignment().getAsAlign());
   return load;
 }


        


More information about the cfe-commits mailing list