File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 2020#include " llvm/ADT/PointerIntPair.h"
2121#include " llvm/IR/Constants.h"
2222#include " llvm/IR/DerivedTypes.h"
23+ #include " llvm/Support/Casting.h"
2324#include " llvm/Support/MathExtras.h"
2425
2526namespace clang {
@@ -198,9 +199,7 @@ class Address {
198199
199200 // / Return the type of the pointer value.
200201 llvm::PointerType *getType () const {
201- auto AS = llvm::cast<llvm::PointerType>(Pointer.getPointer ()->getType ())
202- ->getAddressSpace ();
203- return llvm::PointerType::get (ElementType->getContext (), AS);
202+ return llvm::cast<llvm::PointerType>(Pointer.getPointer ()->getType ());
204203 }
205204
206205 // / Return the type of the values stored in this address.
Original file line number Diff line number Diff line change @@ -345,10 +345,7 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD,
345345
346346void CodeGenFunction::registerGlobalDtorWithAtExit (llvm::Constant *dtorStub) {
347347 // extern "C" int atexit(void (*f)(void));
348- assert (dtorStub->getType () ==
349- llvm::PointerType::get (
350- CGM.getLLVMContext (),
351- dtorStub->getType ()->getPointerAddressSpace ()) &&
348+ assert (dtorStub->getType ()->isPointerTy () &&
352349 " Argument to atexit has a wrong type." );
353350
354351 llvm::FunctionType *atexitTy =
@@ -372,10 +369,7 @@ CodeGenFunction::unregisterGlobalDtorWithUnAtExit(llvm::Constant *dtorStub) {
372369 // value is returned.
373370 //
374371 // extern "C" int unatexit(void (*f)(void));
375- assert (dtorStub->getType () ==
376- llvm::PointerType::get (
377- CGM.getLLVMContext (),
378- dtorStub->getType ()->getPointerAddressSpace ()) &&
372+ assert (dtorStub->getType ()->isPointerTy () &&
379373 " Argument to unatexit has a wrong type." );
380374
381375 llvm::FunctionType *unatexitTy =
You can’t perform that action at this time.
0 commit comments