diff options
Diffstat (limited to 'lib/Analysis/BodyFarm.cpp')
-rw-r--r-- | lib/Analysis/BodyFarm.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Analysis/BodyFarm.cpp b/lib/Analysis/BodyFarm.cpp index 794ff9c..dda26bf 100644 --- a/lib/Analysis/BodyFarm.cpp +++ b/lib/Analysis/BodyFarm.cpp @@ -12,12 +12,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/StringSwitch.h" +#include "BodyFarm.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/Expr.h" #include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" #include "clang/AST/ExprObjC.h" -#include "BodyFarm.h" +#include "llvm/ADT/StringSwitch.h" using namespace clang; @@ -103,9 +103,7 @@ BinaryOperator *ASTMaker::makeComparison(const Expr *LHS, const Expr *RHS, } CompoundStmt *ASTMaker::makeCompound(ArrayRef<Stmt *> Stmts) { - return new (C) CompoundStmt(C, const_cast<Stmt**>(Stmts.data()), - Stmts.size(), - SourceLocation(), SourceLocation()); + return new (C) CompoundStmt(C, Stmts, SourceLocation(), SourceLocation()); } DeclRefExpr *ASTMaker::makeDeclRefExpr(const VarDecl *D) { @@ -270,7 +268,11 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D) if (D->param_size() != 3) return 0; - // Body for: + // Signature: + // _Bool OSAtomicCompareAndSwapPtr(void *__oldValue, + // void *__newValue, + // void * volatile *__theValue) + // Generate body: // if (oldValue == *theValue) { // *theValue = newValue; // return YES; @@ -342,7 +344,7 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D) Stmt *BodyFarm::getBody(const FunctionDecl *D) { D = D->getCanonicalDecl(); - llvm::Optional<Stmt *> &Val = Bodies[D]; + Optional<Stmt *> &Val = Bodies[D]; if (Val.hasValue()) return Val.getValue(); |