summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-12-03 22:19:05 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-12-03 22:19:05 +0000
commit057647d8783c01301a84bc09c9e5b667460c1ceb (patch)
tree131e536606573ac1177f2c9f130ca4d4db3ec041 /clang/lib/AST/Stmt.cpp
parentd3942beb463a87ffa30d565af338b3972462600c (diff)
downloadbcm5719-llvm-057647d8783c01301a84bc09c9e5b667460c1ceb.tar.gz
bcm5719-llvm-057647d8783c01301a84bc09c9e5b667460c1ceb.zip
[AST] [analyzer] NFC: Reuse code in stable ID dumping methods.
Use the new fancy method introduced in r348197 to simplify some code. Differential Revision: https://reviews.llvm.org/D54488 llvm-svn: 348199
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r--clang/lib/AST/Stmt.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 901df9ca759..32330ea3bfe 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -303,10 +303,7 @@ SourceLocation Stmt::getEndLoc() const {
}
int64_t Stmt::getID(const ASTContext &Context) const {
- Optional<int64_t> Out = Context.getAllocator().identifyObject(this);
- assert(Out && "Wrong allocator used");
- assert(*Out % alignof(Stmt) == 0 && "Wrong alignment information");
- return *Out / alignof(Stmt);
+ return Context.getAllocator().identifyKnownAlignedObject<Stmt>(this);
}
CompoundStmt::CompoundStmt(ArrayRef<Stmt *> Stmts, SourceLocation LB,
OpenPOWER on IntegriCloud