1 //===--- DelayedDiagnostic.cpp - Delayed declarator diagnostics -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the DelayedDiagnostic class implementation, which
11 // is used to record diagnostics that are being conditionally produced
12 // during declarator parsing.
14 // This file also defines AccessedEntity.
16 //===----------------------------------------------------------------------===//
17 #include "clang/Sema/DelayedDiagnostic.h"
19 using namespace clang;
22 DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc,
26 DD.Kind = Deprecation;
29 DD.DeprecationData.Decl = D;
30 char *MessageData = 0;
32 MessageData = new char [Msg.size()];
33 memcpy(MessageData, Msg.data(), Msg.size());
36 DD.DeprecationData.Message = MessageData;
37 DD.DeprecationData.MessageLen = Msg.size();
41 void DelayedDiagnostic::Destroy() {
44 getAccessData().~AccessedEntity();
48 delete [] DeprecationData.Message;