What is the rationale for the name of hasReducedDebugInfo?

The implementation of hasReducedDebugInfo is:

return getDebugInfo() >= llvm::codegenoptions::DebugInfoConstructor;

Thus it returns true for anything more than DebugInfoConstructor, for example FullDebugInfo. On the other hand it returns false for NoDebugInfo which would seem to be the ultimate reduction of debug information.

I got a little confused while looking at this too – it depends on whether you look on it as “full debug info that’s been reduced” or “produce some amount of debug-info”.

I think the comment on the function, “Check if type and variable info should be emitted.”, is correct, but the function name could be made clearer. If you look at the sites that call hasReducedDebugInfo such as in CGDecl.cpp, it’s be used as a “should I emit variable information?” test. Possibly we should rename it to “hasVariableDebugInfo” or something more informative?