Update function name and add some helpful comments.
authorEric Christopher <echristo@gmail.com>
Sat, 11 Jan 2014 00:23:16 +0000 (00:23 +0000)
committerEric Christopher <echristo@gmail.com>
Sat, 11 Jan 2014 00:23:16 +0000 (00:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198979 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index c606efac5b14d4ca7ffbdaf8fab3875951491fed..e6eb777ad8f3e54225cd89675384fd6e1993853f 100644 (file)
@@ -168,8 +168,9 @@ DIType DbgVariable::getType() const {
 
 } // end llvm namespace
 
-/// Return Dwarf Version by checking module flags.
-static unsigned getDwarfVersionFromModule(const Module *M) {
+/// Return Dwarf Version by checking module flags and returning
+/// the default version otherwise.
+static unsigned getDwarfVersion(const Module *M) {
   Value *Val = M->getModuleFlag("Dwarf Version");
   if (!Val)
     return dwarf::DWARF_VERSION;
@@ -211,7 +212,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
 
   DwarfVersion = DwarfVersionNumber
                      ? DwarfVersionNumber
-                     : getDwarfVersionFromModule(MMI->getModule());
+                     : getDwarfVersion(MMI->getModule());
 
   {
     NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);