mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences on code, because tags should always be stripped off (giving a non-volatile pointer) before dereferencing. The new qualification is there to catch some attempts to use tagged pointers in a context where an untagged pointer is appropriate. Notably this approach does not catch dereferencing of tagged pointers, but helps in separating the two concepts a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57641 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+3
-5
@@ -127,7 +127,7 @@ void Use::zap(Use *Start, const Use *Stop, bool del) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
struct AugmentedUse : Use {
|
||||
User *ref;
|
||||
volatile User *ref;
|
||||
AugmentedUse(); // not implemented
|
||||
};
|
||||
|
||||
@@ -138,12 +138,10 @@ struct AugmentedUse : Use {
|
||||
|
||||
User *Use::getUser() const {
|
||||
const Use *End = getImpliedUser();
|
||||
User *She = static_cast<const AugmentedUse*>(End - 1)->ref;
|
||||
She = extractTag<Tag, tagOne>(She)
|
||||
volatile User *She = static_cast<const AugmentedUse*>(End - 1)->ref;
|
||||
return extractTag<Tag, tagOne>(She)
|
||||
? llvm::stripTag<tagOne>(She)
|
||||
: reinterpret_cast<User*>(const_cast<Use*>(End));
|
||||
|
||||
return She;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user