[cfe-commits] r39065 - in /cfe/cfe/trunk: Basic/SourceBuffer.cpp Lex/HeaderSearch.cpp include/clang/Basic/FileManager.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:27:15 PDT 2007
Author: sabre
Date: Wed Jul 11 11:27:15 2007
New Revision: 39065
URL: http://llvm.org/viewvc/llvm-project?rev=39065&view=rev
Log:
change FileEntry::getName to return a const char*.
Modified:
cfe/cfe/trunk/Basic/SourceBuffer.cpp
cfe/cfe/trunk/Lex/HeaderSearch.cpp
cfe/cfe/trunk/include/clang/Basic/FileManager.h
Modified: cfe/cfe/trunk/Basic/SourceBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/SourceBuffer.cpp?rev=39065&r1=39064&r2=39065&view=diff
==============================================================================
--- cfe/cfe/trunk/Basic/SourceBuffer.cpp (original)
+++ cfe/cfe/trunk/Basic/SourceBuffer.cpp Wed Jul 11 11:27:15 2007
@@ -170,10 +170,10 @@
return new SourceBufferMMapFile(sys::Path(FileEnt->getName()));
SourceBuffer *SB = getNewUninitMemBuffer(FileEnt->getSize(),
- FileEnt->getName().c_str());
+ FileEnt->getName());
char *BufPtr = const_cast<char*>(SB->getBufferStart());
- int FD = ::open(FileEnt->getName().c_str(), O_RDONLY);
+ int FD = ::open(FileEnt->getName(), O_RDONLY);
if (FD == -1) {
delete SB;
return 0;
Modified: cfe/cfe/trunk/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/HeaderSearch.cpp?rev=39065&r1=39064&r2=39065&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/HeaderSearch.cpp (original)
+++ cfe/cfe/trunk/Lex/HeaderSearch.cpp Wed Jul 11 11:27:15 2007
@@ -189,14 +189,14 @@
if (SlashPos == std::string::npos) return 0;
// Look up the base framework name of the ContextFileEnt.
- const std::string &ContextName = ContextFileEnt->getName();
- std::string::size_type FrameworkPos = ContextName.find(".framework/");
+ const char *ContextName = ContextFileEnt->getName();
+
// If the context info wasn't a framework, couldn't be a subframework.
- if (FrameworkPos == std::string::npos)
+ const char *FrameworkPos = strstr(ContextName, ".framework/");
+ if (FrameworkPos == 0)
return 0;
- std::string FrameworkName(ContextName.begin(),
- ContextName.begin()+FrameworkPos+strlen(".framework/"));
+ std::string FrameworkName(ContextName, FrameworkPos+strlen(".framework/"));
// Append Frameworks/HIToolbox.framework/
FrameworkName += "Frameworks/";
Modified: cfe/cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/FileManager.h?rev=39065&r1=39064&r2=39065&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/FileManager.h Wed Jul 11 11:27:15 2007
@@ -45,7 +45,7 @@
friend class FileManager;
public:
- const std::string &getName() const { return Name; }
+ const char *getName() const { return Name.c_str(); }
off_t getSize() const { return Size; }
unsigned getUID() const { return UID; }
time_t getModificationTime() const { return ModTime; }
More information about the cfe-commits
mailing list