forked from OSchip/llvm-project
Give DiagnosticInfo a real copy constructor, even though it
is destructive. llvm-svn: 59507
This commit is contained in:
parent
ab73bb1494
commit
5d4562ca20
|
@ -207,7 +207,7 @@ private:
|
||||||
/// this reason, we stick state in the Diagnostic class, see the comment there
|
/// this reason, we stick state in the Diagnostic class, see the comment there
|
||||||
/// for more info.
|
/// for more info.
|
||||||
class DiagnosticInfo {
|
class DiagnosticInfo {
|
||||||
Diagnostic *DiagObj;
|
mutable Diagnostic *DiagObj;
|
||||||
FullSourceLoc Loc;
|
FullSourceLoc Loc;
|
||||||
unsigned DiagID;
|
unsigned DiagID;
|
||||||
void operator=(const DiagnosticInfo&); // DO NOT IMPLEMENT
|
void operator=(const DiagnosticInfo&); // DO NOT IMPLEMENT
|
||||||
|
@ -221,7 +221,7 @@ public:
|
||||||
|
|
||||||
/// Copy constructor. When copied, this "takes" the diagnostic info from the
|
/// Copy constructor. When copied, this "takes" the diagnostic info from the
|
||||||
/// input and neuters it.
|
/// input and neuters it.
|
||||||
DiagnosticInfo(DiagnosticInfo &D) {
|
DiagnosticInfo(const DiagnosticInfo &D) {
|
||||||
DiagObj = D.DiagObj;
|
DiagObj = D.DiagObj;
|
||||||
Loc = D.Loc;
|
Loc = D.Loc;
|
||||||
DiagID = D.DiagID;
|
DiagID = D.DiagID;
|
||||||
|
@ -262,7 +262,7 @@ public:
|
||||||
assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!");
|
assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!");
|
||||||
return *DiagObj->DiagRanges[Idx];
|
return *DiagObj->DiagRanges[Idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagnosticInfo &operator<<(const std::string &S) {
|
DiagnosticInfo &operator<<(const std::string &S) {
|
||||||
assert((unsigned)DiagObj->NumDiagArgs <
|
assert((unsigned)DiagObj->NumDiagArgs <
|
||||||
sizeof(DiagObj->DiagArguments)/sizeof(DiagObj->DiagArguments[0]) &&
|
sizeof(DiagObj->DiagArguments)/sizeof(DiagObj->DiagArguments[0]) &&
|
||||||
|
|
Loading…
Reference in New Issue