diff options
author | Manman Ren <mren@apple.com> | 2013-04-11 23:02:56 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-11 23:02:56 +0000 |
commit | e1ad74e6fd1da695e119d1a92ae10f326e6e0968 (patch) | |
tree | 3a8b70ccb00f550136e30ff3d216c2832001147f /clang/lib/CodeGen/CodeGenModule.h | |
parent | 65b8da0623ae3010f2508158d82d04d661138138 (diff) | |
download | bcm5719-llvm-e1ad74e6fd1da695e119d1a92ae10f326e6e0968.tar.gz bcm5719-llvm-e1ad74e6fd1da695e119d1a92ae10f326e6e0968.zip |
Struct-path aware TBAA: uniformize scalar tag and path tag.
For struct-path aware TBAA, we used to use scalar type node as the scalar tag,
which has an incompatible format with the struct path tag. We now use the same
format: base type, access type and offset.
We also uniformize the scalar type node and the struct type node: name, a list
of pairs (offset + pointer to MDNode). For scalar type, we have a single pair.
These are to make implementaiton of aliasing rules easier.
llvm-svn: 179335
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 6bc44563fae..f8b09711f78 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -519,8 +519,13 @@ public: bool isPaddedAtomicType(QualType type); bool isPaddedAtomicType(const AtomicType *type); - static void DecorateInstruction(llvm::Instruction *Inst, - llvm::MDNode *TBAAInfo); + /// Decorate the instruction with a TBAA tag. For scalar TBAA, the tag + /// is the same as the type. For struct-path aware TBAA, the tag + /// is different from the type: base type, access type and offset. + /// When ConvertTypeToTag is true, we create a tag based on the scalar type. + void DecorateInstruction(llvm::Instruction *Inst, + llvm::MDNode *TBAAInfo, + bool ConvertTypeToTag = true); /// getSize - Emit the given number of characters as a value of type size_t. llvm::ConstantInt *getSize(CharUnits numChars); |