@@ -337,12 +337,14 @@ CodeGenModule::CodeGenModule(ASTContext &C,
337337 IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
338338 const HeaderSearchOptions &HSO,
339339 const PreprocessorOptions &PPO,
340- const CodeGenOptions &CGO, llvm::Module &M,
340+ const CodeGenOptions &CGO,
341+ const TargetInfo &CGTI,
342+ llvm::Module &M,
341343 DiagnosticsEngine &diags,
342344 CoverageSourceInfo *CoverageInfo)
343345 : Context(C), LangOpts(C.getLangOpts()), FS(FS), HeaderSearchOpts(HSO),
344346 PreprocessorOpts(PPO), CodeGenOpts(CGO), TheModule(M), Diags(diags),
345- Target(C.getTargetInfo() ), ABI(createCXXABI(*this )),
347+ Target(CGTI ), ABI(createCXXABI(*this )),
346348 VMContext(M.getContext()), VTables(*this ),
347349 SanitizerMD(new SanitizerMetadata(*this )) {
348350
@@ -358,19 +360,19 @@ CodeGenModule::CodeGenModule(ASTContext &C,
358360 BFloatTy = llvm::Type::getBFloatTy (LLVMContext);
359361 FloatTy = llvm::Type::getFloatTy (LLVMContext);
360362 DoubleTy = llvm::Type::getDoubleTy (LLVMContext);
361- PointerWidthInBits = C. getTargetInfo () .getPointerWidth (LangAS::Default);
363+ PointerWidthInBits = Target .getPointerWidth (LangAS::Default);
362364 PointerAlignInBytes =
363- C.toCharUnitsFromBits (C. getTargetInfo () .getPointerAlign (LangAS::Default))
365+ C.toCharUnitsFromBits (Target .getPointerAlign (LangAS::Default))
364366 .getQuantity ();
365367 SizeSizeInBytes =
366- C.toCharUnitsFromBits (C. getTargetInfo () .getMaxPointerWidth ()).getQuantity ();
368+ C.toCharUnitsFromBits (Target .getMaxPointerWidth ()).getQuantity ();
367369 IntAlignInBytes =
368- C.toCharUnitsFromBits (C. getTargetInfo () .getIntAlign ()).getQuantity ();
370+ C.toCharUnitsFromBits (Target .getIntAlign ()).getQuantity ();
369371 CharTy =
370- llvm::IntegerType::get (LLVMContext, C. getTargetInfo () .getCharWidth ());
371- IntTy = llvm::IntegerType::get (LLVMContext, C. getTargetInfo () .getIntWidth ());
372+ llvm::IntegerType::get (LLVMContext, Target .getCharWidth ());
373+ IntTy = llvm::IntegerType::get (LLVMContext, Target .getIntWidth ());
372374 IntPtrTy = llvm::IntegerType::get (LLVMContext,
373- C. getTargetInfo () .getMaxPointerWidth ());
375+ Target .getMaxPointerWidth ());
374376 Int8PtrTy = llvm::PointerType::get (LLVMContext,
375377 C.getTargetAddressSpace (LangAS::Default));
376378 const llvm::DataLayout &DL = M.getDataLayout ();
0 commit comments