Index: lib/Transforms/Vectorize/LoopVectorize.cpp =================================================================== --- lib/Transforms/Vectorize/LoopVectorize.cpp +++ lib/Transforms/Vectorize/LoopVectorize.cpp @@ -84,6 +84,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Format.h" +#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetLibraryInfo.h" #include "llvm/Transforms/Scalar.h" @@ -493,8 +494,12 @@ } const DILocation Loc(N); const unsigned LineNo = Loc.getLineNumber(); - const char *DirName = Loc.getDirectory().data(); const char *FileName = Loc.getFilename().data(); + // Absolute path doesn't need DirName. + if (sys::path::is_absolute(FileName)) + return format("%s%s:%u", "", FileName, + LineNo); + const char *DirName = Loc.getDirectory().data(); return format("%s/%s:%u", DirName, FileName, LineNo); } #endif