From: Victor Leschuk Date: Mon, 31 Oct 2016 19:09:47 +0000 (+0000) Subject: DebugInfo: support for DW_TAG_atomic_type X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70d2cb224ca4719df591c4165412d69ef51cdd4c;p=clang DebugInfo: support for DW_TAG_atomic_type Mark C11 _Atomic variables with DW_TAG_atomic_type tag. Differential Revision: https://reviews.llvm.org/D26145 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285625 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 6a6b83e331..c1396bde4a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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, diff --git a/test/CodeGen/debug-info-atomic.c b/test/CodeGen/debug-info-atomic.c new file mode 100644 index 0000000000..06b9546908 --- /dev/null +++ b/test/CodeGen/debug-info-atomic.c @@ -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;