[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:
Anna Zaks
2013-08-07 18:39:48 +00:00
parent b478def6b1
commit aaa4b2c332
7 changed files with 61 additions and 8 deletions

View File

@@ -176,8 +176,10 @@ public:
void dump() const;
/// Pretty-print the module to the designated stream.
void print(raw_ostream &OS) const;
///
/// \param Verbose Dump SIL location information in verbose mode.
void print(raw_ostream &OS, bool Verbose = false) const;
/// Allocate memory using the module's internal allocator.
void *allocate(unsigned Size, unsigned Align) const {
if (TheASTContext.LangOpts.UseMalloc)