diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CompilerDriver/CompilationGraph.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CompilerDriver/Main.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CompilerDriver/Tool.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 23 | 
4 files changed, 17 insertions, 15 deletions
diff --git a/llvm/lib/CompilerDriver/CompilationGraph.cpp b/llvm/lib/CompilerDriver/CompilationGraph.cpp index 0e8f5d599c2..87a2c4817a8 100644 --- a/llvm/lib/CompilerDriver/CompilationGraph.cpp +++ b/llvm/lib/CompilerDriver/CompilationGraph.cpp @@ -32,7 +32,7 @@ using namespace llvmc;  namespace llvmc {    const std::string* LanguageMap::GetLanguage(const sys::Path& File) const { -    StringRef suf = sys::path::extension(File.str()); +    StringRef suf = File.getSuffix();      LanguageMap::const_iterator Lang =        this->find(suf.empty() ? "*empty*" : suf);      if (Lang == this->end()) { diff --git a/llvm/lib/CompilerDriver/Main.cpp b/llvm/lib/CompilerDriver/Main.cpp index 88cfdb21230..4f8794041b9 100644 --- a/llvm/lib/CompilerDriver/Main.cpp +++ b/llvm/lib/CompilerDriver/Main.cpp @@ -43,7 +43,8 @@ namespace {        return 0;      }      else if (SaveTemps == SaveTempsEnum::Obj && !OutputFilename.empty()) { -      tempDir = sys::path::parent_path(OutputFilename); +      tempDir = OutputFilename; +      tempDir = tempDir.getDirname();      }      else {        // SaveTemps == Cwd --> use current dir (leave tempDir empty). diff --git a/llvm/lib/CompilerDriver/Tool.cpp b/llvm/lib/CompilerDriver/Tool.cpp index 876759aa72b..232bd41c4ba 100644 --- a/llvm/lib/CompilerDriver/Tool.cpp +++ b/llvm/lib/CompilerDriver/Tool.cpp @@ -61,7 +61,7 @@ sys::Path Tool::OutFilename(const sys::Path& In,        Out.appendSuffix(OutputSuffix);      }      else { -      Out.set(sys::path::stem(In.str())); +      Out.set(In.getBasename());        Out.appendSuffix(OutputSuffix);      }    } @@ -69,7 +69,7 @@ sys::Path Tool::OutFilename(const sys::Path& In,      if (IsJoin())        Out = MakeTempFile(TempDir, "tmp", OutputSuffix);      else -      Out = MakeTempFile(TempDir, sys::path::stem(In.str()), OutputSuffix); +      Out = MakeTempFile(TempDir, In.getBasename(), OutputSuffix);    }    return Out;  } diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index f6c7d032524..dd0b07e09bd 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -449,7 +449,7 @@ static void LinkNamedMDNodes(Module *Dest, Module *Src,      const NamedMDNode *SrcNMD = I;      NamedMDNode *DestNMD = Dest->getOrInsertNamedMetadata(SrcNMD->getName());      // Add Src elements into Dest node. -    for (unsigned i = 0, e = SrcNMD->getNumOperands(); i != e; ++i) +    for (unsigned i = 0, e = SrcNMD->getNumOperands(); i != e; ++i)         DestNMD->addOperand(cast<MDNode>(MapValue(SrcNMD->getOperand(i),                                                  ValueMap,                                                  true))); @@ -559,14 +559,14 @@ static bool LinkGlobals(Module *Dest, const Module *Src,        // we are replacing may be a function (if a prototype, weak, etc) or a        // global variable.        GlobalVariable *NewDGV = -        new GlobalVariable(*Dest, SGV->getType()->getElementType(), -                           SGV->isConstant(), NewLinkage, /*init*/0, +        new GlobalVariable(*Dest, SGV->getType()->getElementType(),  +                           SGV->isConstant(), NewLinkage, /*init*/0,                              DGV->getName(), 0, false,                             SGV->getType()->getAddressSpace());        // Propagate alignment, section, and visibility info.        CopyGVAttributes(NewDGV, SGV); -      DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV, +      DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV,                                                                 DGV->getType()));        // DGV will conflict with NewDGV because they both had the same @@ -928,7 +928,7 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src,        CopyGVAttributes(NewDF, SF);        // Any uses of DF need to change to NewDF, with cast -      DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF, +      DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF,                                                                 DGV->getType()));        // DF will conflict with NewDF because they both had the same. We must @@ -1017,7 +1017,7 @@ static bool LinkFunctionBody(Function *Dest, Function *Src,          Value *Old = MI->second;          if (!isa<Instruction>(Old) && !isa<BasicBlock>(Old)) {            Value *New = MapValue(Old, ValueMap, true); -          if (New != Old) +          if (New != Old)               I->setMetadata(MI->first, cast<MDNode>(New));          }        } @@ -1100,7 +1100,7 @@ static bool LinkAppendingVars(Module *M,           "Appending variables with different section name need to be linked!");        unsigned NewSize = T1->getNumElements() + T2->getNumElements(); -      ArrayType *NewType = ArrayType::get(T1->getElementType(), +      ArrayType *NewType = ArrayType::get(T1->getElementType(),                                                            NewSize);        G1->setName("");   // Clear G1's name in case of a conflict! @@ -1144,7 +1144,7 @@ static bool LinkAppendingVars(Module *M,        // getelementptr instructions to not use the Cast!        G1->replaceAllUsesWith(ConstantExpr::getBitCast(NG,                               G1->getType())); -      G2->replaceAllUsesWith(ConstantExpr::getBitCast(NG, +      G2->replaceAllUsesWith(ConstantExpr::getBitCast(NG,                                G2->getType()));        // Remove the two globals from the module now... @@ -1301,9 +1301,10 @@ Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) {    // If the source library's module id is in the dependent library list of the    // destination library, remove it since that module is now linked in. -  const std::string &modId = Src->getModuleIdentifier(); -  if (!modId.empty()) -    Dest->removeLibrary(sys::path::stem(modId)); +  sys::Path modId; +  modId.set(Src->getModuleIdentifier()); +  if (!modId.isEmpty()) +    Dest->removeLibrary(modId.getBasename());    return false;  }  | 

