Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/CGDebugInfo.cpp
Show First 20 Lines • Show All 2,968 Lines • ▼ Show 20 Lines | return DBuilder.createStructType(Unit, "", Unit, 0, FieldOffset, 0, Flags, | ||||
nullptr, Elements); | nullptr, Elements); | ||||
} | } | ||||
void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::Value *Storage, | void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::Value *Storage, | ||||
llvm::Optional<unsigned> ArgNo, | llvm::Optional<unsigned> ArgNo, | ||||
CGBuilderTy &Builder) { | CGBuilderTy &Builder) { | ||||
assert(DebugKind >= codegenoptions::LimitedDebugInfo); | assert(DebugKind >= codegenoptions::LimitedDebugInfo); | ||||
assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); | assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); | ||||
if (VD->hasAttr<NoDebugAttr>()) | |||||
return; | |||||
bool Unwritten = | bool Unwritten = | ||||
VD->isImplicit() || (isa<Decl>(VD->getDeclContext()) && | VD->isImplicit() || (isa<Decl>(VD->getDeclContext()) && | ||||
cast<Decl>(VD->getDeclContext())->isImplicit()); | cast<Decl>(VD->getDeclContext())->isImplicit()); | ||||
llvm::DIFile *Unit = nullptr; | llvm::DIFile *Unit = nullptr; | ||||
if (!Unwritten) | if (!Unwritten) | ||||
Unit = getOrCreateFile(VD->getLocation()); | Unit = getOrCreateFile(VD->getLocation()); | ||||
llvm::DIType *Ty; | llvm::DIType *Ty; | ||||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( | void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( | ||||
const VarDecl *VD, llvm::Value *Storage, CGBuilderTy &Builder, | const VarDecl *VD, llvm::Value *Storage, CGBuilderTy &Builder, | ||||
const CGBlockInfo &blockInfo, llvm::Instruction *InsertPoint) { | const CGBlockInfo &blockInfo, llvm::Instruction *InsertPoint) { | ||||
assert(DebugKind >= codegenoptions::LimitedDebugInfo); | assert(DebugKind >= codegenoptions::LimitedDebugInfo); | ||||
assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); | assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); | ||||
if (Builder.GetInsertBlock() == nullptr) | if (Builder.GetInsertBlock() == nullptr) | ||||
return; | return; | ||||
if (VD->hasAttr<NoDebugAttr>()) | |||||
return; | |||||
bool isByRef = VD->hasAttr<BlocksAttr>(); | bool isByRef = VD->hasAttr<BlocksAttr>(); | ||||
uint64_t XOffset = 0; | uint64_t XOffset = 0; | ||||
llvm::DIFile *Unit = getOrCreateFile(VD->getLocation()); | llvm::DIFile *Unit = getOrCreateFile(VD->getLocation()); | ||||
llvm::DIType *Ty; | llvm::DIType *Ty; | ||||
if (isByRef) | if (isByRef) | ||||
Ty = EmitTypeForVarWithBlocksAttr(VD, &XOffset); | Ty = EmitTypeForVarWithBlocksAttr(VD, &XOffset); | ||||
▲ Show 20 Lines • Show All 492 Lines • Show Last 20 Lines |