mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL Printer] Add optional source location printing.
Added a -v(verbose) option to swift that will trigger verbose printing in SIL Printer. SIL Printer will print the location info only in the verbose mode. Here is the example of the format - only the line and colon are displayed for brevity: %24 = apply %13(%22) : $[cc(method), thin] ((), [byref] Bool) -> Builtin.Int1 // user: %26 line:46:10 (This will be used to test the validity of SILLocation info.) Swift SVN r6991
This commit is contained in:
@@ -25,6 +25,12 @@ SourceLoc SourceManager::getCodeCompletionLoc() const {
|
||||
Buffer->getBufferStart() + CodeCompletionOffset));
|
||||
}
|
||||
|
||||
void SourceLoc::printLineAndColon(raw_ostream &OS,
|
||||
const SourceManager &SM) const {
|
||||
int BufferIndex = SM->FindBufferContainingLoc(Value);
|
||||
print(OS, SM, BufferIndex);
|
||||
}
|
||||
|
||||
void SourceLoc::print(raw_ostream &OS, const SourceManager &SM,
|
||||
int &LastBuffer) const {
|
||||
if (isInvalid()) {
|
||||
|
||||
Reference in New Issue
Block a user