Thread Safety Analysis: fix handling of string and char literals.
authorDeLesley Hutchins <delesley@google.com>
Fri, 30 May 2014 18:20:04 +0000 (18:20 +0000)
committerDeLesley Hutchins <delesley@google.com>
Fri, 30 May 2014 18:20:04 +0000 (18:20 +0000)
llvm-svn: 209913

clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
clang/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h

index e84af07..8e4299e 100644 (file)
@@ -237,7 +237,7 @@ inline ValueType ValueType::getValueType<long double>() {
 
 template<>
 inline ValueType ValueType::getValueType<StringRef>() {
-  return ValueType(BT_Pointer, getSizeType(sizeof(StringRef)), false, 0);
+  return ValueType(BT_String, getSizeType(sizeof(StringRef)), false, 0);
 }
 
 template<>
index 322a3b5..bc1490b 100644 (file)
@@ -599,6 +599,10 @@ protected:
     SS << E->value();
   }
 
+  void printLiteralT(LiteralT<uint8_t> *E, StreamType &SS) {
+    SS << "'" << E->value() << "'";
+  }
+
   void printLiteral(Literal *E, StreamType &SS) {
     if (E->clangExpr()) {
       SS << getSourceLiteralString(E->clangExpr());