[cfe-commits] r100018 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Checker/BugReporter/ include/clang/Frontend/ lib/Basic/ lib/Checker/ lib/Frontend/ lib/Lex/ lib/Parse/ lib/Sema/ tools/CIndex/
Douglas Gregor
dgregor at apple.com
Wed Mar 31 10:25:36 PDT 2010
Author: dgregor
Date: Wed Mar 31 12:25:35 2010
New Revision: 100018
URL: http://llvm.org/viewvc/llvm-project?rev=100018&view=rev
Log:
Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
Modified:
cfe/trunk/include/clang/AST/Statistics.h
cfe/trunk/include/clang/Basic/Diagnostic.h
cfe/trunk/include/clang/Basic/PartialDiagnostic.h
cfe/trunk/include/clang/Checker/BugReporter/PathDiagnostic.h
cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
cfe/trunk/lib/Basic/Diagnostic.cpp
cfe/trunk/lib/Checker/PathDiagnostic.cpp
cfe/trunk/lib/Frontend/FixItRewriter.cpp
cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp
cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
cfe/trunk/lib/Lex/Lexer.cpp
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Parse/DeclSpec.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Parse/ParseInit.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Parse/Parser.cpp
cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/lib/Sema/SemaExceptionSpec.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/SemaTemplate.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
Modified: cfe/trunk/include/clang/AST/Statistics.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Statistics.h?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Statistics.h (original)
+++ cfe/trunk/include/clang/AST/Statistics.h Wed Mar 31 12:25:35 2010
@@ -14,8 +14,6 @@
#ifndef LLVM_CLANG_AST_STATISTICS_H
#define LLVM_CLANG_AST_STATISTICS_H
-#define CLANG_C_ONLY 1
-
#ifndef NDEBUG
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Casting.h"
@@ -37,16 +35,7 @@
} \
}; \
}
-#elif defined(CLANG_C_ONLY)
-#define CLANG_ISA_STATISTIC(Type,Counter) \
- namespace llvm { \
- template <typename From> \
- struct isa_impl<clang::Type, From> { \
- static inline bool doit(const From &Val) __attribute__((always_inline)) { \
- return false; \
- } \
- }; \
- }
+
#else
#define CLANG_ISA_STATISTIC(Type,Counter)
#endif
Modified: cfe/trunk/include/clang/Basic/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Diagnostic.h?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/Diagnostic.h Wed Mar 31 12:25:35 2010
@@ -95,7 +95,7 @@
/// should also provide full recovery from such errors, such that
/// suppressing the diagnostic output can still result in successful
/// compilation.
-class FixItHint {
+class CodeModificationHint {
public:
/// \brief Tokens that should be removed to correct the error.
SourceRange RemoveRange;
@@ -110,7 +110,7 @@
/// \brief Empty code modification hint, indicating that no code
/// modification is known.
- FixItHint() : RemoveRange(), InsertionLoc() { }
+ CodeModificationHint() : RemoveRange(), InsertionLoc() { }
bool isNull() const {
return !RemoveRange.isValid() && !InsertionLoc.isValid();
@@ -118,9 +118,9 @@
/// \brief Create a code modification hint that inserts the given
/// code string at a specific location.
- static FixItHint CreateInsertion(SourceLocation InsertionLoc,
- llvm::StringRef Code) {
- FixItHint Hint;
+ static CodeModificationHint CreateInsertion(SourceLocation InsertionLoc,
+ llvm::StringRef Code) {
+ CodeModificationHint Hint;
Hint.InsertionLoc = InsertionLoc;
Hint.CodeToInsert = Code;
return Hint;
@@ -128,17 +128,17 @@
/// \brief Create a code modification hint that removes the given
/// source range.
- static FixItHint CreateRemoval(SourceRange RemoveRange) {
- FixItHint Hint;
+ static CodeModificationHint CreateRemoval(SourceRange RemoveRange) {
+ CodeModificationHint Hint;
Hint.RemoveRange = RemoveRange;
return Hint;
}
/// \brief Create a code modification hint that replaces the given
/// source range with the given code string.
- static FixItHint CreateReplacement(SourceRange RemoveRange,
- llvm::StringRef Code) {
- FixItHint Hint;
+ static CodeModificationHint CreateReplacement(SourceRange RemoveRange,
+ llvm::StringRef Code) {
+ CodeModificationHint Hint;
Hint.RemoveRange = RemoveRange;
Hint.InsertionLoc = RemoveRange.getBegin();
Hint.CodeToInsert = Code;
@@ -519,8 +519,8 @@
/// NumRanges - This is the number of ranges in the DiagRanges array.
unsigned char NumDiagRanges;
/// \brief The number of code modifications hints in the
- /// FixItHints array.
- unsigned char NumFixItHints;
+ /// CodeModificationHints array.
+ unsigned char NumCodeModificationHints;
/// DiagArgumentsKind - This is an array of ArgumentKind::ArgumentKind enum
/// values, with one for each argument. This specifies whether the argument
@@ -542,11 +542,11 @@
/// only support 10 ranges, could easily be extended if needed.
SourceRange DiagRanges[10];
- enum { MaxFixItHints = 3 };
+ enum { MaxCodeModificationHints = 3 };
- /// FixItHints - If valid, provides a hint with some code
+ /// CodeModificationHints - If valid, provides a hint with some code
/// to insert, remove, or modify at a particular position.
- FixItHint FixItHints[MaxFixItHints];
+ CodeModificationHint CodeModificationHints[MaxCodeModificationHints];
/// ProcessDiag - This is the method used to report a diagnostic that is
/// finally fully formed.
@@ -573,12 +573,13 @@
/// for example.
class DiagnosticBuilder {
mutable Diagnostic *DiagObj;
- mutable unsigned NumArgs, NumRanges, NumFixItHints;
+ mutable unsigned NumArgs, NumRanges, NumCodeModificationHints;
void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT
friend class Diagnostic;
explicit DiagnosticBuilder(Diagnostic *diagObj)
- : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixItHints(0) {}
+ : DiagObj(diagObj), NumArgs(0), NumRanges(0),
+ NumCodeModificationHints(0) {}
public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the
@@ -588,7 +589,7 @@
D.DiagObj = 0;
NumArgs = D.NumArgs;
NumRanges = D.NumRanges;
- NumFixItHints = D.NumFixItHints;
+ NumCodeModificationHints = D.NumCodeModificationHints;
}
/// \brief Simple enumeration value used to give a name to the
@@ -598,7 +599,7 @@
/// \brief Create an empty DiagnosticBuilder object that represents
/// no actual diagnostic.
explicit DiagnosticBuilder(SuppressKind)
- : DiagObj(0), NumArgs(0), NumRanges(0), NumFixItHints(0) { }
+ : DiagObj(0), NumArgs(0), NumRanges(0), NumCodeModificationHints(0) { }
/// \brief Force the diagnostic builder to emit the diagnostic now.
///
@@ -647,14 +648,14 @@
DiagObj->DiagRanges[NumRanges++] = R;
}
- void AddFixItHint(const FixItHint &Hint) const {
+ void AddCodeModificationHint(const CodeModificationHint &Hint) const {
if (Hint.isNull())
return;
- assert(NumFixItHints < Diagnostic::MaxFixItHints &&
- "Too many fix-it hints!");
+ assert(NumCodeModificationHints < Diagnostic::MaxCodeModificationHints &&
+ "Too many code modification hints!");
if (DiagObj)
- DiagObj->FixItHints[NumFixItHints++] = Hint;
+ DiagObj->CodeModificationHints[NumCodeModificationHints++] = Hint;
}
};
@@ -715,8 +716,8 @@
}
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
- const FixItHint &Hint) {
- DB.AddFixItHint(Hint);
+ const CodeModificationHint &Hint) {
+ DB.AddCodeModificationHint(Hint);
return DB;
}
@@ -812,17 +813,17 @@
return DiagObj->DiagRanges[Idx];
}
- unsigned getNumFixItHints() const {
- return DiagObj->NumFixItHints;
+ unsigned getNumCodeModificationHints() const {
+ return DiagObj->NumCodeModificationHints;
}
- const FixItHint &getFixItHint(unsigned Idx) const {
- return DiagObj->FixItHints[Idx];
+ const CodeModificationHint &getCodeModificationHint(unsigned Idx) const {
+ return DiagObj->CodeModificationHints[Idx];
}
- const FixItHint *getFixItHints() const {
- return DiagObj->NumFixItHints?
- &DiagObj->FixItHints[0] : 0;
+ const CodeModificationHint *getCodeModificationHints() const {
+ return DiagObj->NumCodeModificationHints?
+ &DiagObj->CodeModificationHints[0] : 0;
}
/// FormatDiagnostic - Format this diagnostic into a string, substituting the
@@ -845,7 +846,7 @@
FullSourceLoc Loc;
std::string Message;
std::vector<SourceRange> Ranges;
- std::vector<FixItHint> FixIts;
+ std::vector<CodeModificationHint> FixIts;
public:
StoredDiagnostic();
@@ -865,7 +866,7 @@
range_iterator range_end() const { return Ranges.end(); }
unsigned range_size() const { return Ranges.size(); }
- typedef std::vector<FixItHint>::const_iterator fixit_iterator;
+ typedef std::vector<CodeModificationHint>::const_iterator fixit_iterator;
fixit_iterator fixit_begin() const { return FixIts.begin(); }
fixit_iterator fixit_end() const { return FixIts.end(); }
unsigned fixit_size() const { return FixIts.size(); }
Modified: cfe/trunk/include/clang/Basic/PartialDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/PartialDiagnostic.h?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/PartialDiagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/PartialDiagnostic.h Wed Mar 31 12:25:35 2010
@@ -29,7 +29,8 @@
class PartialDiagnostic {
public:
struct Storage {
- Storage() : NumDiagArgs(0), NumDiagRanges(0), NumFixItHints(0) { }
+ Storage() : NumDiagArgs(0), NumDiagRanges(0), NumCodeModificationHints(0) {
+ }
enum {
/// MaxArguments - The maximum number of arguments we can hold. We
@@ -46,8 +47,8 @@
unsigned char NumDiagRanges;
/// \brief The number of code modifications hints in the
- /// FixItHints array.
- unsigned char NumFixItHints;
+ /// CodeModificationHints array.
+ unsigned char NumCodeModificationHints;
/// DiagArgumentsKind - This is an array of ArgumentKind::ArgumentKind enum
/// values, with one for each argument. This specifies whether the argument
@@ -64,11 +65,11 @@
/// only support 10 ranges, could easily be extended if needed.
SourceRange DiagRanges[10];
- enum { MaxFixItHints = 3 };
+ enum { MaxCodeModificationHints = 3 };
- /// FixItHints - If valid, provides a hint with some code
+ /// CodeModificationHints - If valid, provides a hint with some code
/// to insert, remove, or modify at a particular position.
- FixItHint FixItHints[MaxFixItHints];
+ CodeModificationHint CodeModificationHints[MaxCodeModificationHints];
};
/// \brief An allocator for Storage objects, which uses a small cache to
@@ -91,7 +92,7 @@
Storage *Result = FreeList[--NumFreeListEntries];
Result->NumDiagArgs = 0;
Result->NumDiagRanges = 0;
- Result->NumFixItHints = 0;
+ Result->NumCodeModificationHints = 0;
return Result;
}
@@ -165,16 +166,17 @@
DiagStorage->DiagRanges[DiagStorage->NumDiagRanges++] = R;
}
- void AddFixItHint(const FixItHint &Hint) const {
+ void AddCodeModificationHint(const CodeModificationHint &Hint) const {
if (Hint.isNull())
return;
if (!DiagStorage)
DiagStorage = getStorage();
- assert(DiagStorage->NumFixItHints < Storage::MaxFixItHints &&
+ assert(DiagStorage->NumCodeModificationHints <
+ Storage::MaxCodeModificationHints &&
"Too many code modification hints!");
- DiagStorage->FixItHints[DiagStorage->NumFixItHints++]
+ DiagStorage->CodeModificationHints[DiagStorage->NumCodeModificationHints++]
= Hint;
}
@@ -234,8 +236,8 @@
DB.AddSourceRange(DiagStorage->DiagRanges[i]);
// Add all code modification hints
- for (unsigned i = 0, e = DiagStorage->NumFixItHints; i != e; ++i)
- DB.AddFixItHint(DiagStorage->FixItHints[i]);
+ for (unsigned i = 0, e = DiagStorage->NumCodeModificationHints; i != e; ++i)
+ DB.AddCodeModificationHint(DiagStorage->CodeModificationHints[i]);
}
/// \brief Clear out this partial diagnostic, giving it a new diagnostic ID
@@ -282,8 +284,8 @@
DeclarationName N);
friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
- const FixItHint &Hint) {
- PD.AddFixItHint(Hint);
+ const CodeModificationHint &Hint) {
+ PD.AddCodeModificationHint(Hint);
return PD;
}
Modified: cfe/trunk/include/clang/Checker/BugReporter/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/BugReporter/PathDiagnostic.h?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/BugReporter/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/Checker/BugReporter/PathDiagnostic.h Wed Mar 31 12:25:35 2010
@@ -168,7 +168,7 @@
private:
const std::string str;
- std::vector<FixItHint> FixItHints;
+ std::vector<CodeModificationHint> CodeModificationHints;
const Kind kind;
const DisplayHint Hint;
std::vector<SourceRange> ranges;
@@ -203,8 +203,8 @@
ranges.push_back(SourceRange(B,E));
}
- void addFixItHint(const FixItHint& Hint) {
- FixItHints.push_back(Hint);
+ void addCodeModificationHint(const CodeModificationHint& Hint) {
+ CodeModificationHints.push_back(Hint);
}
typedef const SourceRange* range_iterator;
@@ -217,15 +217,15 @@
return ranges_begin() + ranges.size();
}
- typedef const FixItHint *fixit_iterator;
+ typedef const CodeModificationHint *code_modifications_iterator;
- fixit_iterator fixit_begin() const {
- return FixItHints.empty()? 0 : &FixItHints[0];
+ code_modifications_iterator code_modifications_begin() const {
+ return CodeModificationHints.empty()? 0 : &CodeModificationHints[0];
}
- fixit_iterator fixit_end() const {
- return FixItHints.empty()? 0
- : &FixItHints[0] + FixItHints.size();
+ code_modifications_iterator code_modifications_end() const {
+ return CodeModificationHints.empty()? 0
+ : &CodeModificationHints[0] + CodeModificationHints.size();
}
static inline bool classof(const PathDiagnosticPiece* P) {
Modified: cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h (original)
+++ cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h Wed Mar 31 12:25:35 2010
@@ -69,7 +69,7 @@
void EmitCaretDiagnostic(SourceLocation Loc,
SourceRange *Ranges, unsigned NumRanges,
SourceManager &SM,
- const FixItHint *Hints,
+ const CodeModificationHint *Hints,
unsigned NumHints,
unsigned Columns);
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Wed Mar 31 12:25:35 2010
@@ -571,7 +571,7 @@
// the Diagnostic object.
DiagObj->NumDiagArgs = NumArgs;
DiagObj->NumDiagRanges = NumRanges;
- DiagObj->NumFixItHints = NumFixItHints;
+ DiagObj->NumCodeModificationHints = NumCodeModificationHints;
// Process the diagnostic, sending the accumulated information to the
// DiagnosticClient.
@@ -996,9 +996,9 @@
for (unsigned I = 0, N = Info.getNumRanges(); I != N; ++I)
Ranges.push_back(Info.getRange(I));
- FixIts.reserve(Info.getNumFixItHints());
- for (unsigned I = 0, N = Info.getNumFixItHints(); I != N; ++I)
- FixIts.push_back(Info.getFixItHint(I));
+ FixIts.reserve(Info.getNumCodeModificationHints());
+ for (unsigned I = 0, N = Info.getNumCodeModificationHints(); I != N; ++I)
+ FixIts.push_back(Info.getCodeModificationHint(I));
}
StoredDiagnostic::~StoredDiagnostic() { }
@@ -1231,7 +1231,7 @@
return Diag;
}
- FixItHint Hint;
+ CodeModificationHint Hint;
Hint.RemoveRange = SourceRange(RemoveBegin, RemoveEnd);
Hint.InsertionLoc = InsertionLoc;
Hint.CodeToInsert.assign(Memory, Memory + InsertLen);
Modified: cfe/trunk/lib/Checker/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/PathDiagnostic.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/Checker/PathDiagnostic.cpp Wed Mar 31 12:25:35 2010
@@ -108,8 +108,8 @@
for (unsigned i = 0, e = Info.getNumRanges(); i != e; ++i)
P->addRange(Info.getRange(i));
- for (unsigned i = 0, e = Info.getNumFixItHints(); i != e; ++i)
- P->addFixItHint(Info.getFixItHint(i));
+ for (unsigned i = 0, e = Info.getNumCodeModificationHints(); i != e; ++i)
+ P->addCodeModificationHint(Info.getCodeModificationHint(i));
D->push_front(P);
HandlePathDiagnostic(D);
Modified: cfe/trunk/lib/Frontend/FixItRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FixItRewriter.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FixItRewriter.cpp (original)
+++ cfe/trunk/lib/Frontend/FixItRewriter.cpp Wed Mar 31 12:25:35 2010
@@ -93,7 +93,7 @@
// completely ignore it, even if it's an error: fix-it locations
// are meant to perform specific fix-ups even in the presence of
// other errors.
- if (Info.getNumFixItHints() == 0)
+ if (Info.getNumCodeModificationHints() == 0)
return;
// See if the location of the error is one that matches what the
@@ -122,10 +122,10 @@
// Make sure that we can perform all of the modifications we
// in this diagnostic.
- bool CanRewrite = Info.getNumFixItHints() > 0;
- for (unsigned Idx = 0, Last = Info.getNumFixItHints();
+ bool CanRewrite = Info.getNumCodeModificationHints() > 0;
+ for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints();
Idx < Last; ++Idx) {
- const FixItHint &Hint = Info.getFixItHint(Idx);
+ const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx);
if (Hint.RemoveRange.isValid() &&
Rewrite.getRangeSize(Hint.RemoveRange) == -1) {
CanRewrite = false;
@@ -140,7 +140,7 @@
}
if (!CanRewrite) {
- if (Info.getNumFixItHints() > 0)
+ if (Info.getNumCodeModificationHints() > 0)
Diag(Info.getLocation(), diag::note_fixit_in_macro);
// If this was an error, refuse to perform any rewriting.
@@ -152,9 +152,9 @@
}
bool Failed = false;
- for (unsigned Idx = 0, Last = Info.getNumFixItHints();
+ for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints();
Idx < Last; ++Idx) {
- const FixItHint &Hint = Info.getFixItHint(Idx);
+ const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx);
if (!Hint.RemoveRange.isValid()) {
// We're adding code.
if (Rewrite.InsertTextBefore(Hint.InsertionLoc, Hint.CodeToInsert))
Modified: cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp Wed Mar 31 12:25:35 2010
@@ -484,7 +484,8 @@
// FIXME: This code is disabled because it seems to mangle the HTML
// output. I'm leaving it here because it's generally the right idea,
// but needs some help from someone more familiar with the rewriter.
- for (const FixItHint *Hint = P.fixit_begin(), *HintEnd = P.fixit_end();
+ for (const CodeModificationHint *Hint = P.code_modifications_begin(),
+ *HintEnd = P.code_modifications_end();
Hint != HintEnd; ++Hint) {
if (Hint->RemoveRange.isValid()) {
HighlightRange(R, LPosInfo.first, Hint->RemoveRange,
Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Wed Mar 31 12:25:35 2010
@@ -276,7 +276,7 @@
SourceRange *Ranges,
unsigned NumRanges,
SourceManager &SM,
- const FixItHint *Hints,
+ const CodeModificationHint *Hints,
unsigned NumHints,
unsigned Columns) {
assert(LangOpts && "Unexpected diagnostic outside source file processing");
@@ -409,7 +409,7 @@
std::string FixItInsertionLine;
if (NumHints && DiagOpts->ShowFixits) {
- for (const FixItHint *Hint = Hints, *LastHint = Hints + NumHints;
+ for (const CodeModificationHint *Hint = Hints, *LastHint = Hints + NumHints;
Hint != LastHint; ++Hint) {
if (Hint->InsertionLoc.isValid()) {
// We have an insertion hint. Determine whether the inserted
@@ -833,7 +833,7 @@
if (DiagOpts->ShowCarets && Info.getLocation().isValid() &&
((LastLoc != Info.getLocation()) || Info.getNumRanges() ||
(LastCaretDiagnosticWasNote && Level != Diagnostic::Note) ||
- Info.getNumFixItHints())) {
+ Info.getNumCodeModificationHints())) {
// Cache the LastLoc, it allows us to omit duplicate source/caret spewage.
LastLoc = Info.getLocation();
LastCaretDiagnosticWasNote = (Level == Diagnostic::Note);
@@ -845,9 +845,9 @@
for (unsigned i = 0; i != NumRanges; ++i)
Ranges[i] = Info.getRange(i);
- unsigned NumHints = Info.getNumFixItHints();
+ unsigned NumHints = Info.getNumCodeModificationHints();
for (unsigned idx = 0; idx < NumHints; ++idx) {
- const FixItHint &Hint = Info.getFixItHint(idx);
+ const CodeModificationHint &Hint = Info.getCodeModificationHint(idx);
if (Hint.RemoveRange.isValid()) {
assert(NumRanges < 20 && "Out of space");
Ranges[NumRanges++] = Hint.RemoveRange;
@@ -855,8 +855,8 @@
}
EmitCaretDiagnostic(LastLoc, Ranges, NumRanges, LastLoc.getManager(),
- Info.getFixItHints(),
- Info.getNumFixItHints(),
+ Info.getCodeModificationHints(),
+ Info.getNumCodeModificationHints(),
DiagOpts->MessageLength);
}
Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Wed Mar 31 12:25:35 2010
@@ -1372,7 +1372,8 @@
// a pedwarn.
if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r'))
Diag(BufferEnd, diag::ext_no_newline_eof)
- << FixItHint::CreateInsertion(getSourceLocation(BufferEnd), "\n");
+ << CodeModificationHint::CreateInsertion(getSourceLocation(BufferEnd),
+ "\n");
BufferPtr = CurPtr;
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Mar 31 12:25:35 2010
@@ -127,10 +127,10 @@
// Add a fixit in GNU/C99/C++ mode. Don't offer a fixit for strict-C89,
// because it is more trouble than it is worth to insert /**/ and check that
// there is no /**/ in the range also.
- FixItHint Hint;
+ CodeModificationHint FixItHint;
if (Features.GNUMode || Features.C99 || Features.CPlusPlus)
- Hint = FixItHint::CreateInsertion(Tmp.getLocation(),"//");
- Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << Hint;
+ FixItHint = CodeModificationHint::CreateInsertion(Tmp.getLocation(),"//");
+ Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << FixItHint;
DiscardUntilEndOfDirective();
}
}
Modified: cfe/trunk/lib/Parse/DeclSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/DeclSpec.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/DeclSpec.cpp (original)
+++ cfe/trunk/lib/Parse/DeclSpec.cpp Wed Mar 31 12:25:35 2010
@@ -481,7 +481,7 @@
if (TypeSpecComplex != TSC_unspecified) {
if (TypeSpecType == TST_unspecified) {
Diag(D, TSCLoc, SrcMgr, diag::ext_plain_complex)
- << FixItHint::CreateInsertion(
+ << CodeModificationHint::CreateInsertion(
PP.getLocForEndOfToken(getTypeSpecComplexLoc()),
" double");
TypeSpecType = TST_double; // _Complex -> _Complex double.
@@ -507,7 +507,7 @@
Diag(D, SCLoc, SrcMgr, diag::err_friend_storage_spec)
<< SpecName
- << FixItHint::CreateRemoval(SourceRange(SCLoc, SCEndLoc));
+ << CodeModificationHint::CreateRemoval(SourceRange(SCLoc, SCEndLoc));
ClearStorageClassSpecs();
}
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Wed Mar 31 12:25:35 2010
@@ -734,7 +734,7 @@
if (TagName) {
Diag(Loc, diag::err_use_of_tag_name_without_tag)
<< Tok.getIdentifierInfo() << TagName << getLang().CPlusPlus
- << FixItHint::CreateInsertion(Tok.getLocation(),TagName);
+ << CodeModificationHint::CreateInsertion(Tok.getLocation(),TagName);
// Parse this as a tag as if the missing tag were present.
if (TagKind == tok::kw_enum)
@@ -1360,7 +1360,7 @@
DS.SetRangeEnd(EndProtoLoc);
Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id)
- << FixItHint::CreateInsertion(Loc, "id")
+ << CodeModificationHint::CreateInsertion(Loc, "id")
<< SourceRange(Loc, EndProtoLoc);
// Need to support trailing type qualifiers (e.g. "id<p> const").
// If a type specifier follows, it will be diagnosed elsewhere.
@@ -1756,7 +1756,7 @@
// Check for extraneous top-level semicolon.
if (Tok.is(tok::semi)) {
Diag(Tok, diag::ext_extra_struct_semi)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << CodeModificationHint::CreateRemoval(Tok.getLocation());
ConsumeToken();
continue;
}
@@ -1999,7 +1999,7 @@
!(getLang().C99 || getLang().CPlusPlus0x))
Diag(CommaLoc, diag::ext_enumerator_list_comma)
<< getLang().CPlusPlus
- << FixItHint::CreateRemoval(CommaLoc);
+ << CodeModificationHint::CreateRemoval(CommaLoc);
}
// Eat the }.
@@ -3009,7 +3009,7 @@
// We have ellipsis without a preceding ',', which is ill-formed
// in C. Complain and provide the fix.
Diag(EllipsisLoc, diag::err_missing_comma_before_ellipsis)
- << FixItHint::CreateInsertion(EllipsisLoc, ", ");
+ << CodeModificationHint::CreateInsertion(EllipsisLoc, ", ");
}
}
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Wed Mar 31 12:25:35 2010
@@ -837,7 +837,7 @@
Diag(TemplateId->TemplateNameLoc,
diag::err_explicit_instantiation_with_definition)
<< SourceRange(TemplateInfo.TemplateLoc)
- << FixItHint::CreateInsertion(LAngleLoc, "<>");
+ << CodeModificationHint::CreateInsertion(LAngleLoc, "<>");
// Create a fake template parameter list that contains only
// "template<>", so that we treat this construct as a class
@@ -1079,7 +1079,7 @@
if (IsVirtual) {
// Complain about duplicate 'virtual'
Diag(VirtualLoc, diag::err_dup_virtual)
- << FixItHint::CreateRemoval(VirtualLoc);
+ << CodeModificationHint::CreateRemoval(VirtualLoc);
}
IsVirtual = true;
@@ -1554,7 +1554,7 @@
// Check for extraneous top-level semicolon.
if (Tok.is(tok::semi)) {
Diag(Tok, diag::ext_extra_struct_semi)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << CodeModificationHint::CreateRemoval(Tok.getLocation());
ConsumeToken();
continue;
}
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Wed Mar 31 12:25:35 2010
@@ -246,7 +246,7 @@
// recover like this.
PP.LookAhead(1).is(tok::identifier)) {
Diag(Next, diag::err_unexected_colon_in_nested_name_spec)
- << FixItHint::CreateReplacement(Next.getLocation(), "::");
+ << CodeModificationHint::CreateReplacement(Next.getLocation(), "::");
// Recover as if the user wrote '::'.
Next.setKind(tok::coloncolon);
@@ -1313,7 +1313,7 @@
Diag(TemplateId->TemplateNameLoc,
diag::err_out_of_line_constructor_template_id)
<< TemplateId->Name
- << FixItHint::CreateRemoval(
+ << CodeModificationHint::CreateRemoval(
SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc));
Result.setConstructorName(Actions.getTypeName(*TemplateId->Name,
TemplateId->TemplateNameLoc,
Modified: cfe/trunk/lib/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseInit.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseInit.cpp (original)
+++ cfe/trunk/lib/Parse/ParseInit.cpp Wed Mar 31 12:25:35 2010
@@ -76,8 +76,9 @@
SourceLocation ColonLoc = ConsumeToken();
Diag(Tok, diag::ext_gnu_old_style_field_designator)
- << FixItHint::CreateReplacement(SourceRange(NameLoc, ColonLoc),
- NewSyntax.str());
+ << CodeModificationHint::CreateReplacement(SourceRange(NameLoc,
+ ColonLoc),
+ NewSyntax.str());
Designation D;
D.AddDesignator(Designator::getField(FieldName, SourceLocation(), NameLoc));
@@ -217,7 +218,7 @@
(Desig.getDesignator(0).isArrayDesignator() ||
Desig.getDesignator(0).isArrayRangeDesignator())) {
Diag(Tok, diag::ext_gnu_missing_equal_designator)
- << FixItHint::CreateInsertion(Tok.getLocation(), "= ");
+ << CodeModificationHint::CreateInsertion(Tok.getLocation(), "= ");
return Actions.ActOnDesignatedInitializer(Desig, Tok.getLocation(),
true, ParseInitializer());
}
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Mar 31 12:25:35 2010
@@ -988,7 +988,7 @@
// Check for extraneous top-level semicolon.
if (Tok.is(tok::semi)) {
Diag(Tok, diag::ext_extra_struct_semi)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << CodeModificationHint::CreateRemoval(Tok.getLocation());
ConsumeToken();
continue;
}
@@ -1571,7 +1571,7 @@
if (Tok.is(tok::semi)) {
if (ObjCImpDecl) {
Diag(Tok, diag::warn_semicolon_before_method_body)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << CodeModificationHint::CreateRemoval(Tok.getLocation());
}
ConsumeToken();
}
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Wed Mar 31 12:25:35 2010
@@ -660,7 +660,7 @@
ReplaceStr = "> > ";
Diag(Tok.getLocation(), diag::err_two_right_angle_brackets_need_space)
- << FixItHint::CreateReplacement(
+ << CodeModificationHint::CreateReplacement(
SourceRange(Tok.getLocation()), ReplaceStr);
}
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Wed Mar 31 12:25:35 2010
@@ -95,8 +95,8 @@
}
Diag(Loc, DK)
- << FixItHint::CreateInsertion(ParenRange.getBegin(), "(")
- << FixItHint::CreateInsertion(EndLoc, ")");
+ << CodeModificationHint::CreateInsertion(ParenRange.getBegin(), "(")
+ << CodeModificationHint::CreateInsertion(EndLoc, ")");
}
/// MatchRHSPunctuation - For punctuation with a LHS and RHS (e.g. '['/']'),
@@ -146,7 +146,7 @@
// Show what code to insert to fix this problem.
Diag(EndLoc, DiagID)
<< Msg
- << FixItHint::CreateInsertion(EndLoc, Spelling);
+ << CodeModificationHint::CreateInsertion(EndLoc, Spelling);
} else
Diag(Tok, DiagID) << Msg;
@@ -395,7 +395,7 @@
case tok::semi:
if (!getLang().CPlusPlus0x)
Diag(Tok, diag::ext_top_level_semi)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << CodeModificationHint::CreateRemoval(Tok.getLocation());
ConsumeToken();
// TODO: Invoke action for top-level semicolon.
@@ -829,7 +829,7 @@
PP.getLocForEndOfToken(Tok.getLocation()));
Diag(Tok, diag::warn_file_asm_volatile)
- << FixItHint::CreateRemoval(RemovalRange);
+ << CodeModificationHint::CreateRemoval(RemovalRange);
ConsumeToken();
}
Modified: cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp Wed Mar 31 12:25:35 2010
@@ -486,13 +486,13 @@
if (LookupCtx)
Diag(Found.getNameLoc(), diag::err_no_member_suggest)
<< Name << LookupCtx << Found.getLookupName() << SS.getRange()
- << FixItHint::CreateReplacement(Found.getNameLoc(),
- Found.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(Found.getNameLoc(),
+ Found.getLookupName().getAsString());
else
Diag(Found.getNameLoc(), diag::err_undeclared_var_use_suggest)
<< Name << Found.getLookupName()
- << FixItHint::CreateReplacement(Found.getNameLoc(),
- Found.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(Found.getNameLoc(),
+ Found.getLookupName().getAsString());
if (NamedDecl *ND = Found.getAsSingle<NamedDecl>())
Diag(ND->getLocation(), diag::note_previous_decl)
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Mar 31 12:25:35 2010
@@ -255,13 +255,13 @@
if (!SS || !SS->isSet())
Diag(IILoc, diag::err_unknown_typename_suggest)
<< &II << Lookup.getLookupName()
- << FixItHint::CreateReplacement(SourceRange(IILoc),
- Result->getNameAsString());
+ << CodeModificationHint::CreateReplacement(SourceRange(IILoc),
+ Result->getNameAsString());
else if (DeclContext *DC = computeDeclContext(*SS, false))
Diag(IILoc, diag::err_unknown_nested_typename_suggest)
<< &II << DC << Lookup.getLookupName() << SS->getRange()
- << FixItHint::CreateReplacement(SourceRange(IILoc),
- Result->getNameAsString());
+ << CodeModificationHint::CreateReplacement(SourceRange(IILoc),
+ Result->getNameAsString());
else
llvm_unreachable("could not have corrected a typo here");
@@ -285,7 +285,8 @@
Diag(SS->getRange().getBegin(), diag::err_typename_missing)
<< (NestedNameSpecifier *)SS->getScopeRep() << II.getName()
<< SourceRange(SS->getRange().getBegin(), IILoc)
- << FixItHint::CreateInsertion(SS->getRange().getBegin(), "typename ");
+ << CodeModificationHint::CreateInsertion(SS->getRange().getBegin(),
+ "typename ");
SuggestedType = ActOnTypenameType(SourceLocation(), *SS, II, IILoc).get();
} else {
assert(SS && SS->isInvalid() &&
@@ -589,7 +590,8 @@
(IDecl = R.getAsSingle<ObjCInterfaceDecl>())) {
Diag(RecoverLoc, diag::err_undef_interface_suggest)
<< Id << IDecl->getDeclName()
- << FixItHint::CreateReplacement(RecoverLoc, IDecl->getNameAsString());
+ << CodeModificationHint::CreateReplacement(RecoverLoc,
+ IDecl->getNameAsString());
Diag(IDecl->getLocation(), diag::note_previous_decl)
<< IDecl->getDeclName();
@@ -2343,7 +2345,8 @@
if (SC == VarDecl::Static) {
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
diag::err_static_out_of_line)
- << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
+ << CodeModificationHint::CreateRemoval(
+ D.getDeclSpec().getStorageClassSpecLoc());
} else if (SC == VarDecl::None)
SC = VarDecl::Static;
}
@@ -2951,8 +2954,8 @@
Diag(D.getIdentifierLoc(), diag::err_template_spec_decl_friend)
<< Name << RemoveRange
- << FixItHint::CreateRemoval(RemoveRange)
- << FixItHint::CreateInsertion(InsertLoc, "<>");
+ << CodeModificationHint::CreateRemoval(RemoveRange)
+ << CodeModificationHint::CreateInsertion(InsertLoc, "<>");
}
}
@@ -2972,7 +2975,8 @@
} else if (!CurContext->isRecord()) {
// 'virtual' was specified outside of the class.
Diag(D.getDeclSpec().getVirtualSpecLoc(), diag::err_virtual_out_of_class)
- << FixItHint::CreateRemoval(D.getDeclSpec().getVirtualSpecLoc());
+ << CodeModificationHint::CreateRemoval(
+ D.getDeclSpec().getVirtualSpecLoc());
} else {
// Okay: Add virtual to the method.
CXXRecordDecl *CurClass = cast<CXXRecordDecl>(DC);
@@ -2989,14 +2993,16 @@
// 'explicit' was specified outside of the class.
Diag(D.getDeclSpec().getExplicitSpecLoc(),
diag::err_explicit_out_of_class)
- << FixItHint::CreateRemoval(D.getDeclSpec().getExplicitSpecLoc());
+ << CodeModificationHint::CreateRemoval(
+ D.getDeclSpec().getExplicitSpecLoc());
} else if (!isa<CXXConstructorDecl>(NewFD) &&
!isa<CXXConversionDecl>(NewFD)) {
// 'explicit' was specified on a function that wasn't a constructor
// or conversion function.
Diag(D.getDeclSpec().getExplicitSpecLoc(),
diag::err_explicit_non_ctor_or_conv_function)
- << FixItHint::CreateRemoval(D.getDeclSpec().getExplicitSpecLoc());
+ << CodeModificationHint::CreateRemoval(
+ D.getDeclSpec().getExplicitSpecLoc());
}
}
@@ -3031,7 +3037,8 @@
// member function definition.
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
diag::err_static_out_of_line)
- << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
+ << CodeModificationHint::CreateRemoval(
+ D.getDeclSpec().getStorageClassSpecLoc());
}
// Handle GNU asm-label extension (encoded as an attribute).
@@ -3129,7 +3136,7 @@
// too few of them).
Diag(D.getIdentifierLoc(), diag::err_template_spec_needs_header)
<< SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc)
- << FixItHint::CreateInsertion(
+ << CodeModificationHint::CreateInsertion(
D.getDeclSpec().getSourceRange().getBegin(),
"template<> ");
isFunctionTemplateSpecialization = true;
@@ -4167,7 +4174,7 @@
<< ";\n";
Diag(FTI.ArgInfo[i].IdentLoc, diag::ext_param_not_declared)
<< FTI.ArgInfo[i].Ident
- << FixItHint::CreateInsertion(LocAfterDecls, Code.str());
+ << CodeModificationHint::CreateInsertion(LocAfterDecls, Code.str());
// Implicitly declare the argument as type 'int' for lack of a better
// type.
@@ -4677,7 +4684,7 @@
Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch)
<< (NewTag == TagDecl::TK_class)
<< isTemplate << &Name
- << FixItHint::CreateReplacement(SourceRange(NewTagLoc),
+ << CodeModificationHint::CreateReplacement(SourceRange(NewTagLoc),
OldTag == TagDecl::TK_class? "class" : "struct");
Diag(Previous->getLocation(), diag::note_previous_use);
return true;
@@ -4923,8 +4930,8 @@
if (SafeToContinue)
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< Name
- << FixItHint::CreateReplacement(SourceRange(KWLoc),
- PrevTagDecl->getKindName());
+ << CodeModificationHint::CreateReplacement(SourceRange(KWLoc),
+ PrevTagDecl->getKindName());
else
Diag(KWLoc, diag::err_use_with_wrong_tag) << Name;
Diag(PrevTagDecl->getLocation(), diag::note_previous_use);
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Mar 31 12:25:35 2010
@@ -1104,8 +1104,8 @@
// member.
Diag(R.getNameLoc(), diag::err_mem_init_not_member_or_class_suggest)
<< MemberOrBase << true << R.getLookupName()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ R.getLookupName().getAsString());
Diag(Member->getLocation(), diag::note_previous_decl)
<< Member->getDeclName();
@@ -1123,8 +1123,8 @@
// that base class.
Diag(R.getNameLoc(), diag::err_mem_init_not_member_or_class_suggest)
<< MemberOrBase << false << R.getLookupName()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ R.getLookupName().getAsString());
const CXXBaseSpecifier *BaseSpec = DirectBaseSpec? DirectBaseSpec
: VirtualBaseSpec;
@@ -2612,7 +2612,7 @@
if (Context.getCanonicalType(ParamType).getUnqualifiedType() == ClassTy) {
SourceLocation ParamLoc = Constructor->getParamDecl(0)->getLocation();
Diag(ParamLoc, diag::err_constructor_byvalue_arg)
- << FixItHint::CreateInsertion(ParamLoc, " const &");
+ << CodeModificationHint::CreateInsertion(ParamLoc, " const &");
// FIXME: Rather that making the constructor invalid, we should endeavor
// to fix the type.
@@ -3157,7 +3157,8 @@
UsingLoc = Name.getSourceRange().getBegin();
Diag(UsingLoc, diag::warn_access_decl_deprecated)
- << FixItHint::CreateInsertion(SS.getRange().getBegin(), "using ");
+ << CodeModificationHint::CreateInsertion(SS.getRange().getBegin(),
+ "using ");
}
NamedDecl *UD = BuildUsingDeclaration(S, AS, UsingLoc, SS,
@@ -5432,7 +5433,8 @@
<< (unsigned) RD->getTagKind()
<< T
<< SourceRange(DS.getFriendSpecLoc())
- << FixItHint::CreateInsertion(DS.getTypeSpecTypeLoc(), InsertionText);
+ << CodeModificationHint::CreateInsertion(DS.getTypeSpecTypeLoc(),
+ InsertionText);
return DeclPtrTy();
}else {
Diag(DS.getFriendSpecLoc(), diag::err_unexpected_friend)
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Mar 31 12:25:35 2010
@@ -559,8 +559,8 @@
<< ClassName << R.getLookupName();
Diag(IDecl->getLocation(), diag::note_previous_decl)
<< R.getLookupName()
- << FixItHint::CreateReplacement(ClassLoc,
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(ClassLoc,
+ R.getLookupName().getAsString());
IDecl = 0;
} else {
Diag(ClassLoc, diag::warn_undef_interface) << ClassName;
Modified: cfe/trunk/lib/Sema/SemaExceptionSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExceptionSpec.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExceptionSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExceptionSpec.cpp Wed Mar 31 12:25:35 2010
@@ -210,7 +210,8 @@
// late-specified return types.
Diag(New->getLocation(), diag::warn_missing_exception_specification)
<< New << OS.str()
- << FixItHint::CreateInsertion(AfterParenLoc, " " + OS.str().str());
+ << CodeModificationHint::CreateInsertion(AfterParenLoc,
+ " " + OS.str().str());
}
if (!Old->getLocation().isInvalid())
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Mar 31 12:25:35 2010
@@ -949,7 +949,8 @@
// Actually quite difficult!
if (isInstance)
Diag(R.getNameLoc(), diagnostic) << Name
- << FixItHint::CreateInsertion(R.getNameLoc(), "this->");
+ << CodeModificationHint::CreateInsertion(R.getNameLoc(),
+ "this->");
else
Diag(R.getNameLoc(), diagnostic) << Name;
@@ -968,14 +969,14 @@
if (isa<ValueDecl>(*R.begin()) || isa<FunctionTemplateDecl>(*R.begin())) {
if (SS.isEmpty())
Diag(R.getNameLoc(), diagnostic_suggest) << Name << R.getLookupName()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ R.getLookupName().getAsString());
else
Diag(R.getNameLoc(), diag::err_no_member_suggest)
<< Name << computeDeclContext(SS, false) << R.getLookupName()
<< SS.getRange()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ R.getLookupName().getAsString());
if (NamedDecl *ND = R.getAsSingle<NamedDecl>())
Diag(ND->getLocation(), diag::note_previous_decl)
<< ND->getDeclName();
@@ -2613,8 +2614,8 @@
(isa<ValueDecl>(*R.begin()) || isa<FunctionTemplateDecl>(*R.begin()))) {
SemaRef.Diag(R.getNameLoc(), diag::err_no_member_suggest)
<< Name << DC << R.getLookupName() << SS.getRange()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ R.getLookupName().getAsString());
if (NamedDecl *ND = R.getAsSingle<NamedDecl>())
SemaRef.Diag(ND->getLocation(), diag::note_previous_decl)
<< ND->getDeclName();
@@ -2892,7 +2893,7 @@
SourceLocation Loc = PP.getLocForEndOfToken(BaseExpr->getLocEnd());
Diag(Loc, diag::err_member_reference_needs_call)
<< QualType(Fun, 0)
- << FixItHint::CreateInsertion(Loc, "()");
+ << CodeModificationHint::CreateInsertion(Loc, "()");
OwningExprResult NewBase
= ActOnCallExpr(0, ExprArg(*this, BaseExpr), Loc,
@@ -3011,7 +3012,7 @@
// by now.
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
<< BaseType << int(IsArrow) << BaseExpr->getSourceRange()
- << FixItHint::CreateReplacement(OpLoc, ".");
+ << CodeModificationHint::CreateReplacement(OpLoc, ".");
IsArrow = false;
} else {
Diag(MemberLoc, diag::err_typecheck_member_reference_arrow)
@@ -3031,7 +3032,7 @@
if (PT && PT->getPointeeType()->isRecordType()) {
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
<< BaseType << int(IsArrow) << BaseExpr->getSourceRange()
- << FixItHint::CreateReplacement(OpLoc, "->");
+ << CodeModificationHint::CreateReplacement(OpLoc, "->");
BaseType = PT->getPointeeType();
IsArrow = true;
}
@@ -3070,8 +3071,8 @@
Diag(R.getNameLoc(),
diag::err_typecheck_member_reference_ivar_suggest)
<< IDecl->getDeclName() << MemberName << IV->getDeclName()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- IV->getNameAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ IV->getNameAsString());
Diag(IV->getLocation(), diag::note_previous_decl)
<< IV->getDeclName();
}
@@ -3245,8 +3246,8 @@
Res.getAsSingle<ObjCPropertyDecl>()) {
Diag(R.getNameLoc(), diag::err_property_not_found_suggest)
<< MemberName << BaseType << Res.getLookupName()
- << FixItHint::CreateReplacement(R.getNameLoc(),
- Res.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(R.getNameLoc(),
+ Res.getLookupName().getAsString());
ObjCPropertyDecl *Property = Res.getAsSingle<ObjCPropertyDecl>();
Diag(Property->getLocation(), diag::note_previous_decl)
<< Property->getDeclName();
@@ -3575,7 +3576,7 @@
if (NumArgs > 0) {
// Pseudo-destructor calls should not have any arguments.
Diag(Fn->getLocStart(), diag::err_pseudo_dtor_call_with_args)
- << FixItHint::CreateRemoval(
+ << CodeModificationHint::CreateRemoval(
SourceRange(Args[0]->getLocStart(),
Args[NumArgs-1]->getLocEnd()));
@@ -5425,10 +5426,12 @@
PDiag(diag::warn_stringcompare)
<< isa<ObjCEncodeExpr>(literalStringStripped)
<< literalString->getSourceRange()
- << FixItHint::CreateReplacement(SourceRange(Loc), ", ")
- << FixItHint::CreateInsertion(lex->getLocStart(), "strcmp(")
- << FixItHint::CreateInsertion(PP.getLocForEndOfToken(rex->getLocEnd()),
- resultComparison));
+ << CodeModificationHint::CreateReplacement(SourceRange(Loc), ", ")
+ << CodeModificationHint::CreateInsertion(lex->getLocStart(),
+ "strcmp(")
+ << CodeModificationHint::CreateInsertion(
+ PP.getLocForEndOfToken(rex->getLocEnd()),
+ resultComparison));
}
}
@@ -6412,8 +6415,8 @@
}
Self.Diag(Loc, PD)
- << FixItHint::CreateInsertion(ParenRange.getBegin(), "(")
- << FixItHint::CreateInsertion(EndLoc, ")");
+ << CodeModificationHint::CreateInsertion(ParenRange.getBegin(), "(")
+ << CodeModificationHint::CreateInsertion(EndLoc, ")");
if (!SecondPD.getDiagID())
return;
@@ -6427,8 +6430,8 @@
}
Self.Diag(Loc, SecondPD)
- << FixItHint::CreateInsertion(SecondParenRange.getBegin(), "(")
- << FixItHint::CreateInsertion(EndLoc, ")");
+ << CodeModificationHint::CreateInsertion(SecondParenRange.getBegin(), "(")
+ << CodeModificationHint::CreateInsertion(EndLoc, ")");
}
/// DiagnoseBitwisePrecedence - Emit a warning when bitwise and comparison
@@ -7132,8 +7135,11 @@
return Owned(new (Context) GNUNullExpr(Ty, TokenLoc));
}
-static void MakeObjCStringLiteralFixItHint(Sema& SemaRef, QualType DstType,
- Expr *SrcExpr, FixItHint &Hint) {
+static void
+MakeObjCStringLiteralCodeModificationHint(Sema& SemaRef,
+ QualType DstType,
+ Expr *SrcExpr,
+ CodeModificationHint &Hint) {
if (!SemaRef.getLangOptions().ObjC1)
return;
@@ -7154,7 +7160,7 @@
if (!SL || SL->isWide())
return;
- Hint = FixItHint::CreateInsertion(SL->getLocStart(), "@");
+ Hint = CodeModificationHint::CreateInsertion(SL->getLocStart(), "@");
}
bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
@@ -7164,7 +7170,7 @@
// Decode the result (notice that AST's are still created for extensions).
bool isInvalid = false;
unsigned DiagKind;
- FixItHint Hint;
+ CodeModificationHint Hint;
switch (ConvTy) {
default: assert(0 && "Unknown conversion type");
@@ -7176,7 +7182,7 @@
DiagKind = diag::ext_typecheck_convert_int_pointer;
break;
case IncompatiblePointer:
- MakeObjCStringLiteralFixItHint(*this, DstType, SrcExpr, Hint);
+ MakeObjCStringLiteralCodeModificationHint(*this, DstType, SrcExpr, Hint);
DiagKind = diag::ext_typecheck_convert_incompatible_pointer;
break;
case IncompatiblePointerSign:
@@ -7543,10 +7549,10 @@
Diag(Loc, diagnostic)
<< E->getSourceRange()
- << FixItHint::CreateInsertion(Open, "(")
- << FixItHint::CreateInsertion(Close, ")");
+ << CodeModificationHint::CreateInsertion(Open, "(")
+ << CodeModificationHint::CreateInsertion(Close, ")");
Diag(Loc, diag::note_condition_assign_to_comparison)
- << FixItHint::CreateReplacement(Loc, "==");
+ << CodeModificationHint::CreateReplacement(Loc, "==");
}
bool Sema::CheckBooleanCondition(Expr *&E, SourceLocation Loc) {
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Mar 31 12:25:35 2010
@@ -1858,7 +1858,7 @@
else {
Diag(Loc, diag::err_bad_memptr_lhs)
<< OpSpelling << 1 << LType
- << FixItHint::CreateReplacement(SourceRange(Loc), ".*");
+ << CodeModificationHint::CreateReplacement(SourceRange(Loc), ".*");
return QualType();
}
}
@@ -2589,7 +2589,7 @@
SourceLocation ExpectedLParenLoc = PP.getLocForEndOfToken(NameLoc);
Diag(E->getLocStart(), diag::err_dtor_expr_without_call)
<< isa<CXXPseudoDestructorExpr>(E)
- << FixItHint::CreateInsertion(ExpectedLParenLoc, "()");
+ << CodeModificationHint::CreateInsertion(ExpectedLParenLoc, "()");
return ActOnCallExpr(/*Scope*/ 0,
move(MemExpr),
@@ -2623,7 +2623,7 @@
// The user wrote "p->" when she probably meant "p."; fix it.
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
<< ObjectType << true
- << FixItHint::CreateReplacement(OpLoc, ".");
+ << CodeModificationHint::CreateReplacement(OpLoc, ".");
if (isSFINAEContext())
return ExprError();
@@ -2728,7 +2728,7 @@
// The user wrote "p->" when she probably meant "p."; fix it.
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
<< ObjectType << true
- << FixItHint::CreateReplacement(OpLoc, ".");
+ << CodeModificationHint::CreateReplacement(OpLoc, ".");
if (isSFINAEContext())
return ExprError();
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Mar 31 12:25:35 2010
@@ -504,11 +504,13 @@
SemaRef.Diag(StructuredSubobjectInitList->getLocStart(),
diag::warn_missing_braces)
<< StructuredSubobjectInitList->getSourceRange()
- << FixItHint::CreateInsertion(StructuredSubobjectInitList->getLocStart(),
- "{")
- << FixItHint::CreateInsertion(SemaRef.PP.getLocForEndOfToken(
+ << CodeModificationHint::CreateInsertion(
+ StructuredSubobjectInitList->getLocStart(),
+ "{")
+ << CodeModificationHint::CreateInsertion(
+ SemaRef.PP.getLocForEndOfToken(
StructuredSubobjectInitList->getLocEnd()),
- "}");
+ "}");
}
}
@@ -569,8 +571,8 @@
if (T->isScalarType() && !TopLevelObject)
SemaRef.Diag(IList->getLocStart(), diag::warn_braces_around_scalar_init)
<< IList->getSourceRange()
- << FixItHint::CreateRemoval(IList->getLocStart())
- << FixItHint::CreateRemoval(IList->getLocEnd());
+ << CodeModificationHint::CreateRemoval(IList->getLocStart())
+ << CodeModificationHint::CreateRemoval(IList->getLocEnd());
}
void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity,
@@ -1361,8 +1363,8 @@
SemaRef.Diag(D->getFieldLoc(),
diag::err_field_designator_unknown_suggest)
<< FieldName << CurrentObjectType << R.getLookupName()
- << FixItHint::CreateReplacement(D->getFieldLoc(),
- R.getLookupName().getAsString());
+ << CodeModificationHint::CreateReplacement(D->getFieldLoc(),
+ R.getLookupName().getAsString());
SemaRef.Diag(ReplacementField->getLocation(),
diag::note_previous_decl)
<< ReplacementField->getDeclName();
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Mar 31 12:25:35 2010
@@ -471,9 +471,9 @@
S.Diag(SwitchLoc, diag::err_switch_explicit_conversion)
<< CondType << ConvTy << CondExpr->getSourceRange()
- << FixItHint::CreateInsertion(CondExpr->getLocStart(),
- "static_cast<" + TypeStr + ">(")
- << FixItHint::CreateInsertion(
+ << CodeModificationHint::CreateInsertion(CondExpr->getLocStart(),
+ "static_cast<" + TypeStr + ">(")
+ << CodeModificationHint::CreateInsertion(
S.PP.getLocForEndOfToken(CondExpr->getLocEnd()),
")");
S.Diag(Conversion->getLocation(), diag::note_switch_conversion)
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Wed Mar 31 12:25:35 2010
@@ -161,7 +161,7 @@
NestedNameSpecifier *Qualifier = (NestedNameSpecifier*)SS->getScopeRep();
Diag(IILoc, diag::err_template_kw_missing)
<< Qualifier << II.getName()
- << FixItHint::CreateInsertion(IILoc, "template ");
+ << CodeModificationHint::CreateInsertion(IILoc, "template ");
SuggestedTemplate
= TemplateTy::make(Context.getDependentTemplateName(Qualifier, &II));
SuggestedKind = TNK_Dependent_template_name;
@@ -240,12 +240,12 @@
if (LookupCtx)
Diag(Found.getNameLoc(), diag::err_no_member_template_suggest)
<< Name << LookupCtx << Found.getLookupName() << SS.getRange()
- << FixItHint::CreateReplacement(Found.getNameLoc(),
+ << CodeModificationHint::CreateReplacement(Found.getNameLoc(),
Found.getLookupName().getAsString());
else
Diag(Found.getNameLoc(), diag::err_no_template_suggest)
<< Name << Found.getLookupName()
- << FixItHint::CreateReplacement(Found.getNameLoc(),
+ << CodeModificationHint::CreateReplacement(Found.getNameLoc(),
Found.getLookupName().getAsString());
if (TemplateDecl *Template = Found.getAsSingle<TemplateDecl>())
Diag(Template->getLocation(), diag::note_previous_decl)
@@ -822,7 +822,8 @@
if (!isAcceptableTagRedeclaration(PrevRecordDecl, Kind, KWLoc, *Name)) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< Name
- << FixItHint::CreateReplacement(KWLoc, PrevRecordDecl->getKindName());
+ << CodeModificationHint::CreateReplacement(KWLoc,
+ PrevRecordDecl->getKindName());
Diag(PrevRecordDecl->getLocation(), diag::note_previous_use);
Kind = PrevRecordDecl->getTagKind();
}
@@ -1294,7 +1295,8 @@
} else {
Diag(SS.getRange().getBegin(), diag::err_template_spec_needs_header)
<< SS.getRange()
- << FixItHint::CreateInsertion(FirstTemplateLoc, "template<> ");
+ << CodeModificationHint::CreateInsertion(FirstTemplateLoc,
+ "template<> ");
IsExplicitSpecialization = true;
}
return 0;
@@ -1497,7 +1499,8 @@
if (!isAcceptableTagRedeclaration(D, TagKind, TagLoc, *Id)) {
Diag(TagLoc, diag::err_use_with_wrong_tag)
<< Type
- << FixItHint::CreateReplacement(SourceRange(TagLoc), D->getKindName());
+ << CodeModificationHint::CreateReplacement(SourceRange(TagLoc),
+ D->getKindName());
Diag(D->getLocation(), diag::note_previous_use);
}
}
@@ -3460,7 +3463,7 @@
} else if (TemplateParams) {
if (TUK == TUK_Friend)
Diag(KWLoc, diag::err_template_spec_friend)
- << FixItHint::CreateRemoval(
+ << CodeModificationHint::CreateRemoval(
SourceRange(TemplateParams->getTemplateLoc(),
TemplateParams->getRAngleLoc()))
<< SourceRange(LAngleLoc, RAngleLoc);
@@ -3468,7 +3471,7 @@
isExplicitSpecialization = true;
} else if (TUK != TUK_Friend) {
Diag(KWLoc, diag::err_template_spec_needs_header)
- << FixItHint::CreateInsertion(KWLoc, "template<> ");
+ << CodeModificationHint::CreateInsertion(KWLoc, "template<> ");
isExplicitSpecialization = true;
}
@@ -3486,7 +3489,7 @@
*ClassTemplate->getIdentifier())) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< ClassTemplate
- << FixItHint::CreateReplacement(KWLoc,
+ << CodeModificationHint::CreateReplacement(KWLoc,
ClassTemplate->getTemplatedDecl()->getKindName());
Diag(ClassTemplate->getTemplatedDecl()->getLocation(),
diag::note_previous_use);
@@ -3528,7 +3531,8 @@
// to the implicit argument list of the primary template.
Diag(TemplateNameLoc, diag::err_partial_spec_args_match_primary_template)
<< (TUK == TUK_Definition)
- << FixItHint::CreateRemoval(SourceRange(LAngleLoc, RAngleLoc));
+ << CodeModificationHint::CreateRemoval(SourceRange(LAngleLoc,
+ RAngleLoc));
return CheckClassTemplate(S, TagSpec, TUK, KWLoc, SS,
ClassTemplate->getIdentifier(),
TemplateNameLoc,
@@ -4375,7 +4379,7 @@
*ClassTemplate->getIdentifier())) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< ClassTemplate
- << FixItHint::CreateReplacement(KWLoc,
+ << CodeModificationHint::CreateReplacement(KWLoc,
ClassTemplate->getTemplatedDecl()->getKindName());
Diag(ClassTemplate->getTemplatedDecl()->getLocation(),
diag::note_previous_use);
@@ -4693,7 +4697,7 @@
if (D.getDeclSpec().isInlineSpecified() && getLangOptions().CPlusPlus0x)
Diag(D.getDeclSpec().getInlineSpecLoc(),
diag::err_explicit_instantiation_inline)
- <<FixItHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
+ <<CodeModificationHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
// FIXME: check for constexpr specifier.
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Wed Mar 31 12:25:35 2010
@@ -689,8 +689,8 @@
if (!SemaRef.isAcceptableTagRedeclaration(TD, Tag, TagLocation, *Id)) {
SemaRef.Diag(TagLocation, diag::err_use_with_wrong_tag)
<< Id
- << FixItHint::CreateReplacement(SourceRange(TagLocation),
- TD->getKindName());
+ << CodeModificationHint::CreateReplacement(SourceRange(TagLocation),
+ TD->getKindName());
SemaRef.Diag(TD->getLocation(), diag::note_previous_use);
}
}
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Wed Mar 31 12:25:35 2010
@@ -183,7 +183,8 @@
if (DS.isEmpty()) {
TheSema.Diag(DeclLoc, diag::ext_missing_declspec)
<< DS.getSourceRange()
- << FixItHint::CreateInsertion(DS.getSourceRange().getBegin(), "int");
+ << CodeModificationHint::CreateInsertion(DS.getSourceRange().getBegin(),
+ "int");
}
} else if (!DS.hasTypeSpecifier()) {
// C99 and C++ require a type specifier. For example, C99 6.7.2p2 says:
Modified: cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp?rev=100018&r1=100017&r2=100018&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp Wed Mar 31 12:25:35 2010
@@ -201,7 +201,7 @@
return createCXString("");
}
- const FixItHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt];
+ const CodeModificationHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt];
if (ReplacementRange) {
if (Hint.RemoveRange.isInvalid()) {
// Create an empty range that refers to a single source
More information about the cfe-commits
mailing list