@@ -116,6 +116,19 @@ AVR::Fixups AVRMCExpr::getFixupKind() const {
116116 return Kind;
117117}
118118
119+ void AVRMCAsmInfo::printSpecifierExpr (raw_ostream &OS,
120+ const MCSpecifierExpr &Expr) const {
121+ auto &E = static_cast <const AVRMCExpr &>(Expr);
122+ assert (E.getSpecifier () != AVR::S_AVR_NONE);
123+ OS << E.getName () << ' (' ;
124+ if (E.isNegated ())
125+ OS << ' -' << ' (' ;
126+ printExpr (OS, *E.getSubExpr ());
127+ if (E.isNegated ())
128+ OS << ' )' ;
129+ OS << ' )' ;
130+ }
131+
119132int64_t AVRMCExpr::evaluateAsInt64 (int64_t Value) const {
120133 if (Negated)
121134 Value *= -1 ;
@@ -164,15 +177,19 @@ int64_t AVRMCExpr::evaluateAsInt64(int64_t Value) const {
164177 return static_cast <uint64_t >(Value) & 0xff ;
165178}
166179
167- bool AVRMCExpr::evaluateAsRelocatableImpl (MCValue &Result,
168- const MCAssembler *Asm) const {
180+ // bool AVRMCExpr::evaluateAsRelocatableImpl(MCValue &Result,
181+ // const MCAssembler *Asm) const {
182+ bool AVRMCAsmInfo::evaluateAsRelocatableImpl (const MCSpecifierExpr &Expr,
183+ MCValue &Result,
184+ const MCAssembler *Asm) const {
185+ auto &E = static_cast <const AVRMCExpr &>(Expr);
169186 MCValue Value;
170- bool isRelocatable = getSubExpr ()->evaluateAsRelocatable (Value, Asm);
187+ bool isRelocatable = E. getSubExpr ()->evaluateAsRelocatable (Value, Asm);
171188 if (!isRelocatable)
172189 return false ;
173190
174191 if (Value.isAbsolute ()) {
175- Result = MCValue::get (evaluateAsInt64 (Value.getConstant ()));
192+ Result = MCValue::get (E. evaluateAsInt64 (Value.getConstant ()));
176193 } else {
177194 if (!Asm || !Asm->hasLayout ())
178195 return false ;
@@ -181,7 +198,7 @@ bool AVRMCExpr::evaluateAsRelocatableImpl(MCValue &Result,
181198 if (Value.getSpecifier () != MCSymbolRefExpr::VK_None)
182199 return false ;
183200 assert (!Value.getSubSym ());
184- if (specifier == AVR::S_PM)
201+ if (E. getSpecifier () == AVR::S_PM)
185202 Spec = AVR::S_PM;
186203
187204 // TODO: don't attach specifier to MCSymbolRefExpr.
0 commit comments