[llvm] 86b08ed - [DebugInfo][NFC] Do not call 'isRootFile' for DWARF Version < 5

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 22:52:55 PST 2022


Author: Igor Kudrin
Date: 2022-01-21T13:52:10+07:00
New Revision: 86b08ed6bb16a96e921445299858f3cabd6f9e45

URL: https://github.com/llvm/llvm-project/commit/86b08ed6bb16a96e921445299858f3cabd6f9e45
DIFF: https://github.com/llvm/llvm-project/commit/86b08ed6bb16a96e921445299858f3cabd6f9e45.diff

LOG: [DebugInfo][NFC] Do not call 'isRootFile' for DWARF Version < 5

A quicker comparison should be done first.

Differential Revision: https://reviews.llvm.org/D117786

Added: 
    

Modified: 
    llvm/lib/MC/MCDwarf.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 15cfdba5d7fde..2cb5a000f88a7 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -586,7 +586,7 @@ MCDwarfLineTableHeader::tryGetFile(StringRef &Directory,
     trackMD5Usage(Checksum.hasValue());
     HasSource = (Source != None);
   }
-  if (isRootFile(RootFile, Directory, FileName, Checksum) && DwarfVersion >= 5)
+  if (DwarfVersion >= 5 && isRootFile(RootFile, Directory, FileName, Checksum))
     return 0;
   if (FileNumber == 0) {
     // File numbers start with 1 and/or after any file numbers


        


More information about the llvm-commits mailing list