summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-29 21:52:26 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-29 21:52:26 +0000
commit5fc6dc070cb6be572ebe478ddf17089a3051fe20 (patch)
tree818e03cae52a16128c494d70d2be5282071944b8 /clang/lib
parent96af4ddb629c28201c2b8f6365d72809a0d36195 (diff)
downloadbcm5719-llvm-5fc6dc070cb6be572ebe478ddf17089a3051fe20.tar.gz
bcm5719-llvm-5fc6dc070cb6be572ebe478ddf17089a3051fe20.zip
Fix one strict-aliasing warning.
llvm-svn: 51707
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/CFG.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/AST/CFG.cpp b/clang/lib/AST/CFG.cpp
index aad9ee7ada4..ba6a6c8552c 100644
--- a/clang/lib/AST/CFG.cpp
+++ b/clang/lib/AST/CFG.cpp
@@ -1177,17 +1177,17 @@ typedef llvm::FoldingSet<PersistPairTy> BlkEdgeSetTy;
const std::pair<CFGBlock*,CFGBlock*>*
CFG::getBlockEdgeImpl(const CFGBlock* B1, const CFGBlock* B2) {
- llvm::BumpPtrAllocator*& Alloc =
- reinterpret_cast<llvm::BumpPtrAllocator*&>(Allocator);
+ if (!Allocator)
+ Allocator = new llvm::BumpPtrAllocator();
- if (!Alloc)
- Alloc = new llvm::BumpPtrAllocator();
+ llvm::BumpPtrAllocator* Alloc =
+ static_cast<llvm::BumpPtrAllocator*>(Allocator);
- BlkEdgeSetTy*& p = reinterpret_cast<BlkEdgeSetTy*&>(BlkEdgeSet);
+ if (!BlkEdgeSet)
+ BlkEdgeSet = new BlkEdgeSetTy();
+
+ BlkEdgeSetTy* p = static_cast<BlkEdgeSetTy*>(BlkEdgeSet);
- if (!p)
- p = new BlkEdgeSetTy();
-
// Profile the edges.
llvm::FoldingSetNodeID profile;
void* InsertPos;
OpenPOWER on IntegriCloud