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 | a6b7303e4cbb0ae0a2d92b607bf27d05433694ca (patch) | |
tree | 7aa858b20e402473a1fa4567957a3f0a6e5b6971 /clang/lib/CodeGen | |
parent | 5a8341d6be481ed4d441269f2c13aa6d085faa15 (diff) | |
download | bcm5719-llvm-a6b7303e4cbb0ae0a2d92b607bf27d05433694ca.tar.gz bcm5719-llvm-a6b7303e4cbb0ae0a2d92b607bf27d05433694ca.zip |
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).
llvm-svn: 180653
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CodeGenTBAA.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp index 95b9714c348..54e0de6c129 100644 --- a/clang/lib/CodeGen/CodeGenTBAA.cpp +++ b/clang/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 |