aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-10-24 01:09:48 +0000
committerSteve Naroff <snaroff@apple.com>2007-10-24 01:09:48 +0000
commitc0006097e970e5e09636dc46df8d3182042640fb (patch)
tree086bd17b3c276813225a9660332dd1eba61c180d /Driver/RewriteTest.cpp
parentc4c429a1a5947ba9be64d3070741d98362872265 (diff)
Incorporate some feedback from Chris...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 42b5940e19..cfa794619d 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -40,6 +40,7 @@ namespace {
SM = &Context->SourceMgr;
MainFileID = mainFileID;
MsgSendFunctionDecl = 0;
+ GetClassFunctionDecl = 0;
Rewrite.setSourceMgr(Context->SourceMgr);
}
@@ -74,9 +75,9 @@ void RewriteTest::HandleTopLevelDecl(Decl *D) {
// Look for built-in declarations that we need to refer during the rewrite.
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- if (FD->getIdentifier() == &Context->Idents.get("objc_msgSend"))
+ if (strcmp(FD->getName(), "objc_msgSend") == 0)
MsgSendFunctionDecl = FD;
- else if (FD->getIdentifier() == &Context->Idents.get("objc_getClass"))
+ else if (strcmp(FD->getName(), "objc_getClass") == 0)
GetClassFunctionDecl = FD;
}
if (SM->getDecomposedFileLoc(Loc).first == MainFileID)
@@ -185,8 +186,7 @@ void RewriteTest::RewriteForwardClassDecl(ObjcClassDecl *ClassDecl) {
// Get the start location and compute the semi location.
SourceLocation startLoc = ClassDecl->getLocation();
const char *startBuf = SM->getCharacterData(startLoc);
- const char *semiPtr = startBuf;
- while (semiPtr && (*semiPtr != ';')) semiPtr++;
+ const char *semiPtr = strchr(startBuf, ';');
// Translate to typedef's that forward reference structs with the same name
// as the class. As a convenience, we include the original declaration