Skip to content

Commit c56b792

Browse files
Get rid of section prefix validation in codegen.
1 parent 331888b commit c56b792

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

llvm/lib/CodeGen/StaticDataAnnotator.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,8 @@ bool StaticDataAnnotator::runOnModule(Module &M) {
7878
if (!llvm::memprof::IsAnnotationOK(GV))
7979
continue;
8080

81-
// The implementation below assumes prior passes don't set section prefixes,
82-
// and specifically do 'assign' rather than 'update'. So report error if a
83-
// section prefix is already set.
84-
if (auto maybeSectionPrefix = GV.getSectionPrefix();
85-
maybeSectionPrefix && !maybeSectionPrefix->empty())
86-
llvm::report_fatal_error("Global variable " + GV.getName() +
87-
" already has a section prefix " +
88-
*maybeSectionPrefix);
89-
9081
StringRef SectionPrefix = SDPI->getConstantSectionPrefix(&GV, PSI);
91-
if (SectionPrefix.empty())
92-
continue;
93-
82+
// setSectionPrefix returns true if the section prefix is updated.
9483
Changed |= GV.setSectionPrefix(SectionPrefix);
9584
}
9685

0 commit comments

Comments
 (0)