[llvm] r296547 - [opt-viewer] Handle column number 0
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 15:59:47 PST 2017
Author: anemet
Date: Tue Feb 28 17:59:46 2017
New Revision: 296547
URL: http://llvm.org/viewvc/llvm-project?rev=296547&view=rev
Log:
[opt-viewer] Handle column number 0
The asm-printer now emits remarks with function location which have
unspecified (0) source column number.
Modified:
llvm/trunk/utils/opt-viewer/opt-viewer.py
Modified: llvm/trunk/utils/opt-viewer/opt-viewer.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/opt-viewer.py?rev=296547&r1=296546&r2=296547&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/opt-viewer.py (original)
+++ llvm/trunk/utils/opt-viewer/opt-viewer.py Tue Feb 28 17:59:46 2017
@@ -217,7 +217,7 @@ class SourceFileRenderer:
# Column is the number of characters *including* tabs, keep those and
# replace everything else with spaces.
- indent = line[:r.Column - 1]
+ indent = line[:max(r.Column, 1) - 1]
indent = re.sub('\S', ' ', indent)
print('''
More information about the llvm-commits
mailing list