diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-12-16 19:39:01 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-12-16 19:39:01 +0000 |
commit | 73ec065604a8ff2512f478fb763eaa4f9c2bf354 (patch) | |
tree | 51d4abac2d0ddd62eff9bc43ea30b15d3486fa48 /llvm/lib/IR/LLVMContextImpl.h | |
parent | d0fffd1d1405823e4dc1a4ad16e007e3bdd4bf69 (diff) | |
download | bcm5719-llvm-73ec065604a8ff2512f478fb763eaa4f9c2bf354.tar.gz bcm5719-llvm-73ec065604a8ff2512f478fb763eaa4f9c2bf354.zip |
Revert "[IR] Remove the DIExpression field from DIGlobalVariable."
This reverts commit 289920 (again).
I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable
has not DIExpression. Unfortunately it is not possible to safely upgrade
these variables without adding a flag to the bitcode record indicating which
version they are.
My plan of record is to roll the planned follow-up patch that adds a
unit: field to DIGlobalVariable into this patch before recomitting.
This way we only need one Bitcode upgrade for both changes (with a
version flag in the bitcode record to safely distinguish the record
formats).
Sorry for the churn!
llvm-svn: 289982
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 55443c598f9..f1cc12a2902 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -763,16 +763,18 @@ template <> struct MDNodeKeyImpl<DIGlobalVariable> { Metadata *Type; bool IsLocalToUnit; bool IsDefinition; + Metadata *Expr; Metadata *StaticDataMemberDeclaration; uint32_t AlignInBits; MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition, - Metadata *StaticDataMemberDeclaration, uint32_t AlignInBits) + Metadata *Expr, Metadata *StaticDataMemberDeclaration, + uint32_t AlignInBits) : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File), Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit), - IsDefinition(IsDefinition), + IsDefinition(IsDefinition), Expr(Expr), StaticDataMemberDeclaration(StaticDataMemberDeclaration), AlignInBits(AlignInBits) {} MDNodeKeyImpl(const DIGlobalVariable *N) @@ -780,6 +782,7 @@ template <> struct MDNodeKeyImpl<DIGlobalVariable> { LinkageName(N->getRawLinkageName()), File(N->getRawFile()), Line(N->getLine()), Type(N->getRawType()), IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()), + Expr(N->getRawExpr()), StaticDataMemberDeclaration(N->getRawStaticDataMemberDeclaration()), AlignInBits(N->getAlignInBits()) {} @@ -789,6 +792,7 @@ template <> struct MDNodeKeyImpl<DIGlobalVariable> { File == RHS->getRawFile() && Line == RHS->getLine() && Type == RHS->getRawType() && IsLocalToUnit == RHS->isLocalToUnit() && IsDefinition == RHS->isDefinition() && + Expr == RHS->getRawExpr() && StaticDataMemberDeclaration == RHS->getRawStaticDataMemberDeclaration() && AlignInBits == RHS->getAlignInBits(); @@ -802,7 +806,7 @@ template <> struct MDNodeKeyImpl<DIGlobalVariable> { // generated IR is random for each run and test fails with Align included. // TODO: make hashing work fine with such situations return hash_combine(Scope, Name, LinkageName, File, Line, Type, - IsLocalToUnit, IsDefinition, /* AlignInBits, */ + IsLocalToUnit, IsDefinition, /* AlignInBits, */ Expr, StaticDataMemberDeclaration); } }; @@ -859,22 +863,6 @@ template <> struct MDNodeKeyImpl<DIExpression> { } }; -template <> struct MDNodeKeyImpl<DIGlobalVariableExpression> { - Metadata *Variable; - Metadata *Expression; - - MDNodeKeyImpl(Metadata *Variable, Metadata *Expression) - : Variable(Variable), Expression(Expression) {} - MDNodeKeyImpl(const DIGlobalVariableExpression *N) - : Variable(N->getRawVariable()), Expression(N->getRawExpression()) {} - - bool isKeyOf(const DIGlobalVariableExpression *RHS) const { - return Variable == RHS->getRawVariable() && - Expression == RHS->getRawExpression(); - } - unsigned getHashValue() const { return hash_combine(Variable, Expression); } -}; - template <> struct MDNodeKeyImpl<DIObjCProperty> { MDString *Name; Metadata *File; |