Use the newly added DebugInfo (DI) Trivial flag, which indicates if a C++ record is trivial or not, to determine Codeview::FunctionOptions.
Clang and MSVC generate slightly different Codeview for C++ records. For example, here is the C++ code for a class with a defaulted ctor,
class C { public: C() = default; };
Clang will produce a LF for the defaulted ctor while MSVC does not. For more details, refer to FIXMEs in the test cases in "function-options.ll" included with this set of changes.
This isn't going to work. The frontend is going to need to tag classes with the information you want. Consider this example:
Clang will only emit a forward declaration for B, so you won't be able to walk the whole class hierarchy.