aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CFG.cpp
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
commit54eec4c00d25cbb30a3e589f1b3a4ebaa72c81a0 (patch)
tree0b8596438471a13c38c508418468f4e1841c6652 /lib/AST/CFG.cpp
parentf494b579b22f9950f5af021f0bf9879a91bb8b41 (diff)
Fix one strict-aliasing warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r--lib/AST/CFG.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp
index aad9ee7ada..ba6a6c8552 100644
--- a/lib/AST/CFG.cpp
+++ b/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;