diff options
author | Manman Ren <mren@apple.com> | 2013-04-27 00:26:07 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-27 00:26:07 +0000 |
commit | 50be9041fcca4d77c09f120e720d75be703b6ea0 (patch) | |
tree | dd4f45f4689786f03cda6eb64d6fc6c38f00ec4a /lib/CodeGen/CodeGenTBAA.cpp | |
parent | e1c4ac314f69b1590dd3046233b6530cc154ebb5 (diff) |
Struct-path aware TBAA: change the format of TBAAStructType node.
We switch the order of offset and field type to make TBAAStructType node
(name, parent node, offset) similar to scalar TBAA node (name, parent node).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTBAA.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenTBAA.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index 95b9714c34..54e0de6c12 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -57,7 +57,7 @@ llvm::MDNode *CodeGenTBAA::getRoot() { llvm::MDNode *CodeGenTBAA::createTBAAScalarType(StringRef Name, llvm::MDNode *Parent) { if (CodeGenOpts.StructPathTBAA) - return MDHelper.createTBAAScalarTypeNode(Name, 0, Parent); + return MDHelper.createTBAAScalarTypeNode(Name, Parent); else return MDHelper.createTBAANode(Name, Parent); } @@ -275,7 +275,7 @@ CodeGenTBAA::getTBAAStructTypeInfo(QualType QTy) { const RecordDecl *RD = TTy->getDecl()->getDefinition(); const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); - SmallVector <std::pair<uint64_t, llvm::MDNode*>, 4> Fields; + SmallVector <std::pair<llvm::MDNode*, uint64_t>, 4> Fields; unsigned idx = 0; const FieldDecl *LastFD = 0; bool IsMsStruct = RD->isMsStruct(Context); @@ -299,7 +299,7 @@ CodeGenTBAA::getTBAAStructTypeInfo(QualType QTy) { if (!FieldNode) return StructTypeMetadataCache[Ty] = NULL; Fields.push_back(std::make_pair( - Layout.getFieldOffset(idx) / Context.getCharWidth(), FieldNode)); + FieldNode, Layout.getFieldOffset(idx) / Context.getCharWidth())); } // TODO: This is using the RTTI name. Is there a better way to get |