revert 88761 as it fails builds.
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Sat, 14 Nov 2009 07:22:25 +0000 (07:22 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Sat, 14 Nov 2009 07:22:25 +0000 (07:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88762 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/PIC16/PIC16DebugInfo.cpp

index 6d660a60c3e65e6abfa5b22eac2438a0dcee954d..7c5c23b268ff2b9f6c63801967a78c608b0f3122 100644 (file)
@@ -138,7 +138,7 @@ bool AsmPrinter::doInitialization(Module &M) {
   if (MMI)
     MMI->AnalyzeModule(M);
   DW = getAnalysisIfAvailable<DwarfWriter>();
-  if (DW && MAI->doesSupportDebugInformation())
+  if (DW)
     DW->BeginModule(&M, MMI, O, this, MAI);
 
   return false;
index 49df457af7e0eb7a35e6e29f838506e3ab018da2..0ed44d21fc40c820e7537fbfc5c1ee43f39d5cb4 100644 (file)
@@ -467,18 +467,12 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
 void PIC16DbgInfo::SwitchToCU(MDNode *CU) {
   // Get the file path from CU.
   DICompileUnit cu(CU);
-  std::string FilePath = "";
-  if (cu.getDirectory()) {
-    std::string DirName = cu.getDirectory();
-    FilePath = FilePath + DirName + "/";
-  }
-  if (cu.getFilename()) {
-    std::string FileName = cu.getFilename();
-    FilePath = FilePath + FileName;
-  }
+  std::string DirName = cu.getDirectory();
+  std::string FileName = cu.getFilename();
+  std::string FilePath = DirName + "/" + FileName;
 
-  // Nothing to do if source file is still same or it is empty.
-  if ( FilePath == CurFile || FilePath == "") return;
+  // Nothing to do if source file is still same.
+  if ( FilePath == CurFile ) return;
 
   // Else, close the current one and start a new.
   if (CurFile != "") O << "\n\t.eof";