diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-02 00:18:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-02 00:18:52 +0000 |
commit | e8bbc121528b08157bf7457dada4bc87315a2c18 (patch) | |
tree | 16dae6b0d269ea7c0246e2cba993af6a3ae6a18b /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 83297dfc7e5a311af23eb686e29bc41d31322a79 (diff) | |
download | bcm5719-llvm-e8bbc121528b08157bf7457dada4bc87315a2c18.tar.gz bcm5719-llvm-e8bbc121528b08157bf7457dada4bc87315a2c18.zip |
Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).
llvm-svn: 138985
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3e30c57f240..dbcb7acfee8 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -45,7 +45,7 @@ using namespace clang; using namespace CodeGen; static CGCXXABI &createCXXABI(CodeGenModule &CGM) { - switch (CGM.getContext().Target.getCXXABI()) { + switch (CGM.getContext().getTargetInfo().getCXXABI()) { case CXXABI_ARM: return *CreateARMCXXABI(CGM); case CXXABI_Itanium: return *CreateItaniumCXXABI(CGM); case CXXABI_Microsoft: return *CreateMicrosoftCXXABI(CGM); @@ -99,10 +99,10 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, Int8Ty = llvm::Type::getInt8Ty(LLVMContext); Int32Ty = llvm::Type::getInt32Ty(LLVMContext); Int64Ty = llvm::Type::getInt64Ty(LLVMContext); - PointerWidthInBits = C.Target.getPointerWidth(0); + PointerWidthInBits = C.getTargetInfo().getPointerWidth(0); PointerAlignInBytes = - C.toCharUnitsFromBits(C.Target.getPointerAlign(0)).getQuantity(); - IntTy = llvm::IntegerType::get(LLVMContext, C.Target.getIntWidth()); + C.toCharUnitsFromBits(C.getTargetInfo().getPointerAlign(0)).getQuantity(); + IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, PointerWidthInBits); Int8PtrTy = Int8Ty->getPointerTo(0); Int8PtrPtrTy = Int8PtrTy->getPointerTo(0); @@ -167,7 +167,7 @@ void CodeGenModule::DecorateInstruction(llvm::Instruction *Inst, } bool CodeGenModule::isTargetDarwin() const { - return getContext().Target.getTriple().isOSDarwin(); + return getContext().getTargetInfo().getTriple().isOSDarwin(); } void CodeGenModule::Error(SourceLocation loc, StringRef error) { @@ -1802,7 +1802,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { GV = new llvm::GlobalVariable(getModule(), C->getType(), true, llvm::GlobalVariable::PrivateLinkage, C, "_unnamed_cfstring_"); - if (const char *Sect = getContext().Target.getCFStringSection()) + if (const char *Sect = getContext().getTargetInfo().getCFStringSection()) GV->setSection(Sect); Entry.setValue(GV); @@ -1925,8 +1925,8 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) { // FIXME. Fix section. if (const char *Sect = Features.ObjCNonFragileABI - ? getContext().Target.getNSStringNonFragileABISection() - : getContext().Target.getNSStringSection()) + ? getContext().getTargetInfo().getNSStringNonFragileABISection() + : getContext().getTargetInfo().getNSStringSection()) GV->setSection(Sect); Entry.setValue(GV); @@ -1984,13 +1984,13 @@ std::string CodeGenModule::GetStringForStringLiteral(const StringLiteral *E) { case StringLiteral::UTF8: break; case StringLiteral::Wide: - RealLen *= Context.Target.getWCharWidth() / Context.getCharWidth(); + RealLen *= Context.getTargetInfo().getWCharWidth() / Context.getCharWidth(); break; case StringLiteral::UTF16: - RealLen *= Context.Target.getChar16Width() / Context.getCharWidth(); + RealLen *= Context.getTargetInfo().getChar16Width() / Context.getCharWidth(); break; case StringLiteral::UTF32: - RealLen *= Context.Target.getChar32Width() / Context.getCharWidth(); + RealLen *= Context.getTargetInfo().getChar32Width() / Context.getCharWidth(); break; } |