Both PassSupport.h and PassAnalysisSupport.h are only supposed to be included via Pass.h.
This patch fixes the case where PassRegistry.cpp was including PassSupport.h and adds #ifndef error checks to help ensure it doesn't happen again.
Paths
| Differential D78815
[Pass] Ensure we don't include PassSupport.h/PassAnalysisSupport.h directly ClosedPublic Authored by RKSimon on Apr 24 2020, 9:35 AM.
Details Summary Both PassSupport.h and PassAnalysisSupport.h are only supposed to be included via Pass.h. This patch fixes the case where PassRegistry.cpp was including PassSupport.h and adds #ifndef error checks to help ensure it doesn't happen again.
Diff Detail
Event TimelineComment Actions There are still a bunch of other users of the headers in tree, but the error doesn't trigger since Pass.h gets included before. Is that worth changing as well? Comment Actions
Sure, I'll take a look Comment Actions Add check that PassSupport.h/PassAnalysisSupport.h aren't included again after Pass.h has been included. Many of the additional file changes have implicit Pass.h includes but since the PassSupport.h/PassAnalysisSupport.h include was explicit I've added a Pass.h include. Herald added subscribers: zzheng, kbarton, nemanjai and 3 others. · View Herald TranscriptApr 25 2020, 4:08 AM This revision is now accepted and ready to land.Apr 25 2020, 10:51 PM Closed by commit rGa3982491db94: [Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly (authored by RKSimon). · Explain WhyApr 26 2020, 5:18 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 260163 llvm/include/llvm/PassAnalysisSupport.h
llvm/include/llvm/PassSupport.h
llvm/include/llvm/Transforms/Utils/PredicateInfo.h
llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
llvm/lib/CodeGen/HardwareLoops.cpp
llvm/lib/CodeGen/RegAllocBasic.cpp
llvm/lib/CodeGen/RegUsageInfoPropagate.cpp
llvm/lib/IR/Pass.cpp
llvm/lib/IR/PassRegistry.cpp
llvm/lib/Target/ARM/ARMParallelDSP.cpp
llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp
llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp
llvm/lib/Target/Hexagon/HexagonPeephole.cpp
llvm/lib/Target/Hexagon/HexagonVExtract.cpp
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
|
Technically these include guards are now redundant but I've kept them for clarity