weixin_39822993 2020-11-30 11:25
浏览 0

Multiple locations for list of extensions

Originally reported on Google Code with ID 82


There are at least three places where a list of extensions for source files is made
or used in the code. At least one of them (the python one) doesn't match the others.
 Ideally, we'd find a DRY solution allowing a single list of these extensions to be
used in all locations.  (They can be usually found by grepping for "\.cpp", since comments
typically use ".cc" so ".cpp" creates fewer false positives.)

iwyu_path_util.cc:
A. around line 45
B. around line 96

fix_includes.py
C. line 155


Kinds of lists involved:
- Source (non-header) file extensions, at A, B, and C
- Header file extensions - b, but assumed to be the complement of the previous at A
and C

Additionally, the lists of prefixes/suffixes and of source->header conversions found
near B may benefit from being stored as data rather than embedded in code. (an array
of POD structs that is statically initialized?)

Reported by ryan.pavlik on 2012-11-20 19:35:45

该提问来源于开源项目:include-what-you-use/include-what-you-use

  • 写回答

8条回答 默认 最新

  • weixin_39822993 2020-11-30 11:25
    关注
    
    A (very incomplete!) union of the two kinds of lists is also found in iwyu_test_util.py
    starting at line 85
    

    Reported by ryan.pavlik on 2012-11-20 19:50:12

    评论

报告相同问题?