From 0dfb889575a64478b86ca1633fd10a4ca42a7648 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 6 Oct 2011 23:00:33 +0000 Subject: Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x , but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330 --- clang/lib/CodeGen/CodeGenFunction.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 12def67..2c6e7b0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -87,6 +87,10 @@ bool CodeGenFunction::hasAggregateLLVMType(QualType type) { case Type::ObjCObject: case Type::ObjCInterface: return true; + + // In IRGen, atomic types are just the underlying type + case Type::Atomic: + return hasAggregateLLVMType(type->getAs()->getValueType()); } llvm_unreachable("unknown type kind!"); } @@ -983,6 +987,10 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) { case Type::FunctionNoProto: type = cast(ty)->getResultType(); break; + + case Type::Atomic: + type = cast(ty)->getValueType(); + break; } } while (type->isVariablyModifiedType()); } -- cgit v1.1