summaryrefslogtreecommitdiffstats
path: root/lib/Analysis/OSAtomicChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/OSAtomicChecker.cpp')
-rw-r--r--lib/Analysis/OSAtomicChecker.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/OSAtomicChecker.cpp b/lib/Analysis/OSAtomicChecker.cpp
index 5a89345..cf16796 100644
--- a/lib/Analysis/OSAtomicChecker.cpp
+++ b/lib/Analysis/OSAtomicChecker.cpp
@@ -44,11 +44,15 @@ bool OSAtomicChecker::EvalCallExpr(CheckerContext &C,const CallExpr *CE) {
if (!FD)
return false;
- const char *FName = FD->getNameAsCString();
+ const IdentifierInfo *II = FD->getIdentifier();
+ if (!II)
+ return false;
+
+ llvm::StringRef FName(II->getName());
// Check for compare and swap.
- if (strncmp(FName, "OSAtomicCompareAndSwap", 22) == 0 ||
- strncmp(FName, "objc_atomicCompareAndSwap", 25) == 0)
+ if (FName.startswith("OSAtomicCompareAndSwap") ||
+ FName.startswith("objc_atomicCompareAndSwap"))
return EvalOSAtomicCompareAndSwap(C, CE);
// FIXME: Other atomics.
OpenPOWER on IntegriCloud