Skip to content
Snippets Groups Projects
Commit 921ac4d6 authored by Yaron Keren's avatar Yaron Keren
Browse files

Fix string assignment, David Blaikie suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193116 91177308-0d34-0410-b5e6-96231b3b80d8
parent deefa7cd
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
using namespace clang;
using namespace clang::CodeGen;
......@@ -340,8 +341,11 @@ void CGDebugInfo::CreateCompileUnit() {
std::string MainFileDir;
if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) {
MainFileDir = MainFile->getDir()->getName();
if (MainFileDir != ".")
MainFileName = MainFileDir + "/" + MainFileName;
if (MainFileDir != ".") {
llvm::SmallString<1024> MainFileDirSS(MainFileDir);
llvm::sys::path::append(MainFileDirSS, MainFileName);
MainFileName = MainFileDirSS.str();
}
}
// Save filename string.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment