[llvm-bugs] [Bug 33650] New: abuse of YAMLTraits' LLVM_YAML_IS_SEQUENCE_VECTOR and LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR causing many ODR violations
llvm-bugs at lists.llvm.org
Thu Jun 29 17:45:11 PDT 2017
Bug ID: 33650
Summary: abuse of YAMLTraits' LLVM_YAML_IS_SEQUENCE_VECTOR and
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR causing many ODR
Component: Support Libraries
Assignee: unassignedbugs at nondot.org
Reporter: richard-llvm at metafoo.co.uk
CC: kledzik at apple.com, llvm-bugs at lists.llvm.org,
zturner at google.com
We have a large number of places in LLVM and a few in lld and clang-tools-extra
that do things like this:
This is ridiculous: this specializes a global trait on a global type, and is
not something that an individual source file has any place doing.
Worse, different source files attempt to specialize the same trait in different
ways (as flow / non-flow sequence), leading to ODR violations and particularly
to the wrong formatting being used at runtime if the differing parts are not
These ODR violations are currently causing the modules build bots to fail.
The best way forward seems to be to pick a style (flow / non-flow) for
sequences of all scalar types and of string / StringRef, specialize the traits
for that style centrally (in YAMLTraits.h), and remove all the other
For scalar types, all current code seems to agree that flow style is best. For
string types, across LLVM and its subprojects, we have 7 votes for block style
and 6 votes for flow style. That's not really consensus, but block style seems
likely to deal with long strings better, so I think we should go with that
(code that wants a different choice gets to define its own type).
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs