DebugInfo: support for DW_TAG_atomic_type

Mark C11 _Atomic variables with DW_TAG_atomic_type tag.

Differential Revision: https://reviews.llvm.org/D26145

llvm-svn: 285625
This commit is contained in:
Victor Leschuk 2016-10-31 19:09:47 +00:00
parent e1156c2eb0
commit 0df19037c4
2 changed files with 9 additions and 3 deletions

View File

@ -2287,9 +2287,8 @@ llvm::DIType *CGDebugInfo::CreateType(const MemberPointerType *Ty,
}
llvm::DIType *CGDebugInfo::CreateType(const AtomicType *Ty, llvm::DIFile *U) {
// Ignore the atomic wrapping
// FIXME: What is the correct representation?
return getOrCreateType(Ty->getValueType(), U);
auto *FromTy = getOrCreateType(Ty->getValueType(), U);
return DBuilder.createQualifiedType(llvm::dwarf::DW_TAG_atomic_type, FromTy);
}
llvm::DIType* CGDebugInfo::CreateType(const PipeType *Ty,

View File

@ -0,0 +1,7 @@
// RUN: %clang -g -c -std=c11 -S -emit-llvm -o - %s | FileCheck %s
// CHECK: !DIGlobalVariable(name: "i"{{.*}}type: !5, isLocal: false, isDefinition: true)
// CHECK: !5 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)
// CHECK: !6 = !DIDerivedType(tag: DW_TAG_atomic_type, baseType: !7)
// CHECK: !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
_Atomic const int i;