#NEWLINE# def addGCCLineNumberDirective( contents , path , isCoverageBuild ) : #NEWLINE# #INDENT# if isCoverageBuild : #NEWLINE# #INDENT# return contents #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# contents = contents . split ( '\n' ) #NEWLINE# lineNumber = 1 #NEWLINE# outContents = [ ] #NEWLINE# lastLineEndedInBackslash = False #NEWLINE# for line in contents : #NEWLINE# #INDENT# if ( not lastLineEndedInBackslash ) : #NEWLINE# #INDENT# outContents . append ( ( '#line %d "%s"' % ( lineNumber , path ) ) ) #NEWLINE# #UNINDENT# outContents . append ( lineNumber ) #NEWLINE# lastLineEndedInBackslash = line . endswith ( '\\' ) #NEWLINE# lineNumber += 1 #NEWLINE# #UNINDENT# return '\n' . join ( outContents )