/// locations.
void Rewriter::InsertText(SourceLocation Loc,
const char *StrData, unsigned StrLen) {
+ assert(isRewritable(Loc) && "Not a rewritable location!");
unsigned FileID;
unsigned StartOffs = getLocationOffsetAndFileID(Loc, FileID);
getEditBuffer(FileID).InsertText(StartOffs, StrData, StrLen);
/// RemoveText - Remove the specified text region. This method is only valid
/// on a rewritable source location.
void Rewriter::RemoveText(SourceLocation Start, unsigned Length) {
+ assert(isRewritable(Start) && "Not a rewritable location!");
unsigned FileID;
unsigned StartOffs = getLocationOffsetAndFileID(Start, FileID);
getEditBuffer(FileID).RemoveText(StartOffs, Length);