@@ -3193,7 +3193,7 @@ class AsmStmt : public Stmt {
31933193 // / getOutputConstraint - Return the constraint string for the specified
31943194 // / output operand. All output constraints are known to be non-empty (either
31953195 // / '=' or '+').
3196- StringRef getOutputConstraint (unsigned i) const ;
3196+ std::string getOutputConstraint (unsigned i) const ;
31973197
31983198 // / isOutputPlusConstraint - Return true if the specified output constraint
31993199 // / is a "+" constraint (which is both an input and an output) or false if it
@@ -3214,14 +3214,14 @@ class AsmStmt : public Stmt {
32143214
32153215 // / getInputConstraint - Return the specified input constraint. Unlike output
32163216 // / constraints, these can be empty.
3217- StringRef getInputConstraint (unsigned i) const ;
3217+ std::string getInputConstraint (unsigned i) const ;
32183218
32193219 const Expr *getInputExpr (unsigned i) const ;
32203220
32213221 // ===--- Other ---===//
32223222
32233223 unsigned getNumClobbers () const { return NumClobbers; }
3224- StringRef getClobber (unsigned i) const ;
3224+ std::string getClobber (unsigned i) const ;
32253225
32263226 static bool classof (const Stmt *T) {
32273227 return T->getStmtClass () == GCCAsmStmtClass ||
@@ -3302,21 +3302,20 @@ class GCCAsmStmt : public AsmStmt {
33023302 friend class ASTStmtReader ;
33033303
33043304 SourceLocation RParenLoc;
3305- StringLiteral *AsmStr;
3305+ Expr *AsmStr;
33063306
33073307 // FIXME: If we wanted to, we could allocate all of these in one big array.
3308- StringLiteral **Constraints = nullptr ;
3309- StringLiteral **Clobbers = nullptr ;
3308+ Expr **Constraints = nullptr ;
3309+ Expr **Clobbers = nullptr ;
33103310 IdentifierInfo **Names = nullptr ;
33113311 unsigned NumLabels = 0 ;
33123312
33133313public:
33143314 GCCAsmStmt (const ASTContext &C, SourceLocation asmloc, bool issimple,
33153315 bool isvolatile, unsigned numoutputs, unsigned numinputs,
3316- IdentifierInfo **names, StringLiteral **constraints, Expr **exprs,
3317- StringLiteral *asmstr, unsigned numclobbers,
3318- StringLiteral **clobbers, unsigned numlabels,
3319- SourceLocation rparenloc);
3316+ IdentifierInfo **names, Expr **constraints, Expr **exprs,
3317+ Expr *asmstr, unsigned numclobbers, Expr **clobbers,
3318+ unsigned numlabels, SourceLocation rparenloc);
33203319
33213320 // / Build an empty inline-assembly statement.
33223321 explicit GCCAsmStmt (EmptyShell Empty) : AsmStmt(GCCAsmStmtClass, Empty) {}
@@ -3326,9 +3325,11 @@ class GCCAsmStmt : public AsmStmt {
33263325
33273326 // ===--- Asm String Analysis ---===//
33283327
3329- const StringLiteral *getAsmString () const { return AsmStr; }
3330- StringLiteral *getAsmString () { return AsmStr; }
3331- void setAsmString (StringLiteral *E) { AsmStr = E; }
3328+ const Expr *getAsmStringExpr () const { return AsmStr; }
3329+ Expr *getAsmStringExpr () { return AsmStr; }
3330+ void setAsmStringExpr (Expr *E) { AsmStr = E; }
3331+
3332+ std::string getAsmString () const ;
33323333
33333334 // / AsmStringPiece - this is part of a decomposed asm string specification
33343335 // / (for use with the AnalyzeAsmString function below). An asm string is
@@ -3397,14 +3398,12 @@ class GCCAsmStmt : public AsmStmt {
33973398 return {};
33983399 }
33993400
3400- StringRef getOutputConstraint (unsigned i) const ;
3401+ std::string getOutputConstraint (unsigned i) const ;
34013402
3402- const StringLiteral *getOutputConstraintLiteral (unsigned i) const {
3403- return Constraints[i];
3404- }
3405- StringLiteral *getOutputConstraintLiteral (unsigned i) {
3403+ const Expr *getOutputConstraintExpr (unsigned i) const {
34063404 return Constraints[i];
34073405 }
3406+ Expr *getOutputConstraintExpr (unsigned i) { return Constraints[i]; }
34083407
34093408 Expr *getOutputExpr (unsigned i);
34103409
@@ -3425,12 +3424,12 @@ class GCCAsmStmt : public AsmStmt {
34253424 return {};
34263425 }
34273426
3428- StringRef getInputConstraint (unsigned i) const ;
3427+ std::string getInputConstraint (unsigned i) const ;
34293428
3430- const StringLiteral * getInputConstraintLiteral (unsigned i) const {
3429+ const Expr * getInputConstraintExpr (unsigned i) const {
34313430 return Constraints[i + NumOutputs];
34323431 }
3433- StringLiteral * getInputConstraintLiteral (unsigned i) {
3432+ Expr * getInputConstraintExpr (unsigned i) {
34343433 return Constraints[i + NumOutputs];
34353434 }
34363435
@@ -3441,6 +3440,8 @@ class GCCAsmStmt : public AsmStmt {
34413440 return const_cast <GCCAsmStmt*>(this )->getInputExpr (i);
34423441 }
34433442
3443+ static std::string ExtractStringFromGCCAsmStmtComponent (const Expr *E);
3444+
34443445 // ===--- Labels ---===//
34453446
34463447 bool isAsmGoto () const {
@@ -3489,12 +3490,9 @@ class GCCAsmStmt : public AsmStmt {
34893490private:
34903491 void setOutputsAndInputsAndClobbers (const ASTContext &C,
34913492 IdentifierInfo **Names,
3492- StringLiteral **Constraints,
3493- Stmt **Exprs,
3494- unsigned NumOutputs,
3495- unsigned NumInputs,
3496- unsigned NumLabels,
3497- StringLiteral **Clobbers,
3493+ Expr **Constraints, Stmt **Exprs,
3494+ unsigned NumOutputs, unsigned NumInputs,
3495+ unsigned NumLabels, Expr **Clobbers,
34983496 unsigned NumClobbers);
34993497
35003498public:
@@ -3505,12 +3503,10 @@ class GCCAsmStmt : public AsmStmt {
35053503 // / This returns -1 if the operand name is invalid.
35063504 int getNamedOperand (StringRef SymbolicName) const ;
35073505
3508- StringRef getClobber (unsigned i) const ;
3506+ std::string getClobber (unsigned i) const ;
35093507
3510- StringLiteral *getClobberStringLiteral (unsigned i) { return Clobbers[i]; }
3511- const StringLiteral *getClobberStringLiteral (unsigned i) const {
3512- return Clobbers[i];
3513- }
3508+ Expr *getClobberExpr (unsigned i) { return Clobbers[i]; }
3509+ const Expr *getClobberExpr (unsigned i) const { return Clobbers[i]; }
35143510
35153511 SourceLocation getBeginLoc () const LLVM_READONLY { return AsmLoc; }
35163512 SourceLocation getEndLoc () const LLVM_READONLY { return RParenLoc; }
0 commit comments