diff options
author | Manman Ren <mren@apple.com> | 2013-04-04 21:53:22 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-04 21:53:22 +0000 |
commit | c451e5766e8b27f7ca55614364db0b101b729121 (patch) | |
tree | 23f1682e4b4f2272412e5edec957748629b9f6db /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 092d9e8f3bfbd2c8be47ce8651c647e02d63f10f (diff) | |
download | bcm5719-llvm-c451e5766e8b27f7ca55614364db0b101b729121.tar.gz bcm5719-llvm-c451e5766e8b27f7ca55614364db0b101b729121.zip |
Initial support for struct-path aware TBAA.
Added TBAABaseType and TBAAOffset in LValue. These two fields are initialized to
the actual type and 0, and are updated in EmitLValueForField.
Path-aware TBAA tags are enabled for EmitLoadOfScalar and EmitStoreOfScalar.
Added command line option -struct-path-tbaa.
llvm-svn: 178797
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6d85a8835b7..c518a5554e2 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -227,6 +227,20 @@ llvm::MDNode *CodeGenModule::getTBAAStructInfo(QualType QTy) { return TBAA->getTBAAStructInfo(QTy); } +llvm::MDNode *CodeGenModule::getTBAAStructTypeInfo(QualType QTy) { + if (!TBAA) + return 0; + return TBAA->getTBAAStructTypeInfo(QTy); +} + +llvm::MDNode *CodeGenModule::getTBAAStructTagInfo(QualType BaseTy, + llvm::MDNode *AccessN, + uint64_t O) { + if (!TBAA) + return 0; + return TBAA->getTBAAStructTagInfo(BaseTy, AccessN, O); +} + void CodeGenModule::DecorateInstruction(llvm::Instruction *Inst, llvm::MDNode *TBAAInfo) { Inst->setMetadata(llvm::LLVMContext::MD_tbaa, TBAAInfo); |