return llvm::DIDescriptor(Ty);
}
}
+
+ if (!LexicalBlockStack.empty())
+ return llvm::DIDescriptor(LexicalBlockStack.back());
return TheCU;
}
getStaticDataMemberDeclaration(VD));
}
+void CGDebugInfo::EmitUsingDirectiveDecl(const UsingDirectiveDecl &UD) {
+ SourceLocation Loc = UD.getNamespaceKeyLocation();
+ llvm::DIFile Unit = getOrCreateFile(Loc);
+ DBuilder.createUsingDirective(getContextDescriptor(&UD), Unit, getLineNumber(Loc), getOrCreateNameSpace(UD.getNominatedNamespace()));
+}
+
/// getOrCreateNamesSpace - Return namespace descriptor for the given
/// namespace decl.
llvm::DINameSpace
class ObjCInterfaceDecl;
class ClassTemplateSpecializationDecl;
class GlobalDecl;
+ class UsingDirectiveDecl;
namespace CodeGen {
class CodeGenModule;
/// EmitGlobalVariable - Emit global variable's debug info.
void EmitGlobalVariable(const ValueDecl *VD, llvm::Constant *Init);
+ /// \brief Emit a C++ using directive.
+ void EmitUsingDirectiveDecl(const UsingDirectiveDecl &UD);
+
/// getOrCreateRecordType - Emit record type's standalone debug info.
llvm::DIType getOrCreateRecordType(QualType Ty, SourceLocation L);
case Decl::CXXRecord: // struct/union/class X; [C++]
case Decl::Using: // using X; [C++]
case Decl::UsingShadow:
- case Decl::UsingDirective: // using namespace X; [C++]
case Decl::NamespaceAlias:
case Decl::StaticAssert: // static_assert(X, ""); [C++0x]
case Decl::Label: // __label__ x;
case Decl::Import:
// None of these decls require codegen support.
return;
-
+ case Decl::UsingDirective: { // using namespace X; [C++]
+ if (CGDebugInfo *DI = getDebugInfo()) {
+ DI->EmitUsingDirectiveDecl(cast<UsingDirectiveDecl>(D));
+ }
+ return;
+ }
case Decl::Var: {
const VarDecl &VD = cast<VarDecl>(D);
assert(VD.isLocalVarDecl() &&
// Emit debug descriptor for function end.
if (CGDebugInfo *DI = getDebugInfo()) {
DI->EmitFunctionEnd(Builder);
+ DI->setLocation(EndLoc);
}
EmitFunctionEpilog(*CurFnInfo);