[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-dev] Another LLVM API breakage



Another month, another LLVM API breakage. 

diff --git a/clang_delta/EmptyStructToInt.cpp b/clang_delta/EmptyStructToInt.cpp
index e8e759e6d7fe..2c17700cf3bc 100644
--- a/clang_delta/EmptyStructToInt.cpp
+++ b/clang_delta/EmptyStructToInt.cpp
@@ -20,6 +20,7 @@
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/AST/ASTContext.h"
+#include "llvm/ADT/StringRef.h"
 #include "TransformationManager.h"
 
 using namespace clang;
@@ -165,9 +166,9 @@ bool EmptyStructToIntRewriteVisitor::VisitElaboratedTypeLoc(
   // We need to omit it.
   if (StartBuf > EndBuf) {
     SourceLocation KeywordLoc = Loc.getElaboratedKeywordLoc();
-    const char *Keyword = TypeWithKeyword::getKeywordName(ETy->getKeyword());
-    ConsumerInstance->TheRewriter.ReplaceText(KeywordLoc, 
-                                              strlen(Keyword), "int");
+    const llvm::StringRef Keyword =TypeWithKeyword::getKeywordName(ETy->getKeyword());
+    ConsumerInstance->TheRewriter.ReplaceText(KeywordLoc,
+                                              Keyword.size(), "int");
     return true;
   }
   
-- 
Markus