[llvm] 027d012 - [MC,Hexagon] Simplify switchSection. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 09:55:27 PDT 2024


Author: Fangrui Song
Date: 2024-06-28T09:55:23-07:00
New Revision: 027d0128df2271885c019ed432c63aa45ed1fd78

URL: https://github.com/llvm/llvm-project/commit/027d0128df2271885c019ed432c63aa45ed1fd78
DIFF: https://github.com/llvm/llvm-project/commit/027d0128df2271885c019ed432c63aa45ed1fd78.diff

LOG: [MC,Hexagon] Simplify switchSection. NFC

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
index 6e5e2a61bd77d..2fb1c484fc8a1 100644
--- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
+++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
@@ -745,11 +745,8 @@ bool HexagonAsmParser::ParseDirectiveSubsection(SMLoc L) {
   // end of the section.  Only legacy hexagon-gcc created assembly code
   // used negative subsections.
   if ((Res < 0) && (Res > -8193))
-    Subsection = HexagonMCExpr::create(
-        MCConstantExpr::create(8192 + Res, getContext()), getContext());
-
-  getStreamer().switchSection(getStreamer().getCurrentSectionOnly(),
-                              Subsection);
+    Res += 8192;
+  getStreamer().switchSection(getStreamer().getCurrentSectionOnly(), Res);
   return false;
 }
 


        


More information about the llvm-commits mailing list