[cfe-commits] [PATCH 1/2] [clang.py] Add TranslationUnit.get_{file, source_location, source_range}

Gregory Szorc gregory.szorc at gmail.com
Fri Jun 29 00:13:44 PDT 2012


These are just convenience APIs to make obtaining File,
SourceLocation, and SourceRange instances easier.

Old way:

f = File.from_name(tu, 'foo.c')
location = SourceLocation.from_offset(tu, f, 10)

New way:

location = tu.get_source_location('foo.c', offset=10)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-clang.py-Add-TranslationUnit.get_-file-source_locati.patch
Type: text/x-patch
Size: 5753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120629/43eea107/attachment.bin>


More information about the cfe-commits mailing list