This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC] Don't use llvm/Config/config.h in .h files
ClosedPublic

Authored by mtrofin on Jul 23 2020, 12:54 PM.

Details

Summary

config.h is excluded from installs, llvm-config.h isn't

Diff Detail

Event Timeline

mtrofin created this revision.Jul 23 2020, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2020, 12:54 PM

This doesn't address the case in include/llvm/Support/Windows/WindowsSupport.h, I'll try to identify an owner for that.

I wouldn't worry about the Windows header. It's some pre-existing thing and nobody seems to care.

llvm/include/llvm/Analysis/InlineAdvisor.h
216

Hm, maybe it's better to move the other define to llvm-config and make these APIs available only if the config header advertises their existence? It seems a bit nicer for external clients if they can check at build time instead of at runtime maybe.

216

(Also, then no other change in this patch would be needed other than replacing some #include lines)

mtrofin marked 3 inline comments as done.Jul 23 2020, 8:56 PM
mtrofin added inline comments.
llvm/include/llvm/Analysis/InlineAdvisor.h
216

Yup - done.

stellaraccident accepted this revision.Jul 23 2020, 10:16 PM
This revision is now accepted and ready to land.Jul 23 2020, 10:16 PM
mtrofin updated this revision to Diff 280328.Jul 23 2020, 10:26 PM

Further simplified the patch - the .cpp files are fine to include config.h.

This revision was automatically updated to reflect the committed changes.