================
@@ -386,6 +386,16 @@ MCSection *TargetLoweringObjectFile::getSectionForConstant(
   return DataSection;
 }
 
+MCSection *TargetLoweringObjectFile::getSectionForConstant(
+    const DataLayout &DL, SectionKind Kind, const Constant *C, Align 
&Alignment,
+    StringRef SectionPrefix) const {
+  // Fallback to `getSectionForConstant` without `SectionPrefix` parameter if 
it
+  // is empty.
+  if (SectionPrefix.empty())
----------------
mingmingl-llvm wrote:

Do you mean something like `assert(!SectionPrefix.empty() && "Call another 
method if section prefix is empty` here?

I think with the refactor suggested above 
(https://github.com/llvm/llvm-project/pull/129781/files#r1980454779), we can 
allow the new interface to handle empty section prefix by falling back to the 
original interface. What do you think about it?

https://github.com/llvm/llvm-project/pull/129781
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to