diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-27 23:06:41 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-27 23:06:41 +0000 |
commit | 4f042633470186e51d5b11a818adf2027dd580db (patch) | |
tree | 4a9e248463703c2fced1c4d4a0379b7458a60de8 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | f3a8c27e8dbf67b6520436498e186f9ed8c1d6ab (diff) | |
download | bcm5719-llvm-4f042633470186e51d5b11a818adf2027dd580db.tar.gz bcm5719-llvm-4f042633470186e51d5b11a818adf2027dd580db.zip |
TBAA: use the same format for scalar TBAA and struct-path aware TBAA.
Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.
llvm-svn: 191586
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6c126718431..17bca0a6f38 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -243,14 +243,14 @@ llvm::MDNode *CodeGenModule::getTBAAStructTagInfo(QualType BaseTy, return TBAA->getTBAAStructTagInfo(BaseTy, AccessN, O); } -/// 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. +/// Decorate the instruction with a TBAA tag. For both scalar TBAA +/// and struct-path aware TBAA, the tag has the same format: +/// base type, access type and offset. /// When ConvertTypeToTag is true, we create a tag based on the scalar type. void CodeGenModule::DecorateInstruction(llvm::Instruction *Inst, llvm::MDNode *TBAAInfo, bool ConvertTypeToTag) { - if (ConvertTypeToTag && TBAA && CodeGenOpts.StructPathTBAA) + if (ConvertTypeToTag && TBAA) Inst->setMetadata(llvm::LLVMContext::MD_tbaa, TBAA->getTBAAScalarTagInfo(TBAAInfo)); else |