summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-21 07:50:02 +0000
committerChris Lattner <sabre@nondot.org>2008-11-21 07:50:02 +0000
commit2b78690a9ce871f299ddd3c3d66e8c659a7c8d3d (patch)
treeb8b87b5df601d2f3d1fd36d0a62044f0077df1f5 /clang/lib/CodeGen/CodeGenModule.cpp
parent09a203765a045a567baf638eea4a7ad5716cf993 (diff)
downloadbcm5719-llvm-2b78690a9ce871f299ddd3c3d66e8c659a7c8d3d.tar.gz
bcm5719-llvm-2b78690a9ce871f299ddd3c3d66e8c659a7c8d3d.zip
Add the concept of "modifiers" to the clang diagnostic format
strings. This allows us to have considerable flexibility in how these things are displayed and provides extra information that allows us to merge away diagnostics that are very similar. Diagnostic modifiers are a string of characters with the regex [-a-z]+ that occur between the % and digit. They may optionally have an argument that can parameterize them. For now, I've added two example modifiers. One is a very useful tool that allows you to factor commonality across diagnostics that need single words or phrases combined. Basically you can use %select{a|b|c}4 with with an integer argument that selects either a/b/c based on an integer value in the range [0..3). The second modifier is also an integer modifier, aimed to help English diagnostics handle plurality. "%s3" prints to 's' if integer argument #3 is not 1, otherwise it prints to nothing. I'm fully aware that 's' is an English concept and doesn't apply to all situations (mouse vs mice). However, this is very useful and we can add other crazy modifiers once we add support for polish! ;-) I converted a couple C++ diagnostics over to use this as an example, I'd appreciate it if others could merge the other likely candiates. If you have other modifiers that you want, lets talk on cfe-dev. llvm-svn: 59803
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud