forked from OSchip/llvm-project
parent
37a913ae8f
commit
a7c3273e85
|
@ -46,7 +46,7 @@ static cl::opt<bool>
|
||||||
FatalAssemblerWarnings("fatal-assembler-warnings",
|
FatalAssemblerWarnings("fatal-assembler-warnings",
|
||||||
cl::desc("Consider warnings as error"));
|
cl::desc("Consider warnings as error"));
|
||||||
|
|
||||||
MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {}
|
MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -192,9 +192,9 @@ public:
|
||||||
virtual MCAsmLexer &getLexer() { return Lexer; }
|
virtual MCAsmLexer &getLexer() { return Lexer; }
|
||||||
virtual MCContext &getContext() { return Ctx; }
|
virtual MCContext &getContext() { return Ctx; }
|
||||||
virtual MCStreamer &getStreamer() { return Out; }
|
virtual MCStreamer &getStreamer() { return Out; }
|
||||||
virtual unsigned getAssemblerDialect() {
|
virtual unsigned getAssemblerDialect() {
|
||||||
if (AssemblerDialect == ~0U)
|
if (AssemblerDialect == ~0U)
|
||||||
return MAI.getAssemblerDialect();
|
return MAI.getAssemblerDialect();
|
||||||
else
|
else
|
||||||
return AssemblerDialect;
|
return AssemblerDialect;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,8 @@ private:
|
||||||
bool ParseDirectiveFill(); // ".fill"
|
bool ParseDirectiveFill(); // ".fill"
|
||||||
bool ParseDirectiveSpace(); // ".space"
|
bool ParseDirectiveSpace(); // ".space"
|
||||||
bool ParseDirectiveZero(); // ".zero"
|
bool ParseDirectiveZero(); // ".zero"
|
||||||
bool ParseDirectiveSet(StringRef IDVal, bool allow_redef); // ".set", ".equ", ".equiv"
|
// ".set", ".equ", ".equiv"
|
||||||
|
bool ParseDirectiveSet(StringRef IDVal, bool allow_redef);
|
||||||
bool ParseDirectiveOrg(); // ".org"
|
bool ParseDirectiveOrg(); // ".org"
|
||||||
// ".align{,32}", ".p2align{,w,l}"
|
// ".align{,32}", ".p2align{,w,l}"
|
||||||
bool ParseDirectiveAlign(bool IsPow2, unsigned ValueSize);
|
bool ParseDirectiveAlign(bool IsPow2, unsigned ValueSize);
|
||||||
|
@ -1409,7 +1410,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||||
// section is the initial text section then generate a .loc directive for
|
// section is the initial text section then generate a .loc directive for
|
||||||
// the instruction.
|
// the instruction.
|
||||||
if (!HadError && getContext().getGenDwarfForAssembly() &&
|
if (!HadError && getContext().getGenDwarfForAssembly() &&
|
||||||
getContext().getGenDwarfSection() == getStreamer().getCurrentSection() ) {
|
getContext().getGenDwarfSection() == getStreamer().getCurrentSection()) {
|
||||||
|
|
||||||
unsigned Line = SrcMgr.FindLineNumber(IDLoc, CurBuffer);
|
unsigned Line = SrcMgr.FindLineNumber(IDLoc, CurBuffer);
|
||||||
|
|
||||||
|
@ -1421,8 +1422,8 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||||
if (CppHashFilename.size() != 0) {
|
if (CppHashFilename.size() != 0) {
|
||||||
if(MCDwarfFiles[getContext().getGenDwarfFileNumber()]->getName() !=
|
if(MCDwarfFiles[getContext().getGenDwarfFileNumber()]->getName() !=
|
||||||
CppHashFilename)
|
CppHashFilename)
|
||||||
getStreamer().EmitDwarfFileDirective(
|
getStreamer().EmitDwarfFileDirective(
|
||||||
getContext().nextGenDwarfFileNumber(), StringRef(), CppHashFilename);
|
getContext().nextGenDwarfFileNumber(), StringRef(), CppHashFilename);
|
||||||
|
|
||||||
unsigned CppHashLocLineNo = SrcMgr.FindLineNumber(CppHashLoc,CppHashBuf);
|
unsigned CppHashLocLineNo = SrcMgr.FindLineNumber(CppHashLoc,CppHashBuf);
|
||||||
Line = CppHashLineNumber - 1 + (Line - CppHashLocLineNo);
|
Line = CppHashLineNumber - 1 + (Line - CppHashLocLineNo);
|
||||||
|
@ -1512,7 +1513,7 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
|
||||||
DiagSrcMgr.PrintIncludeStack(ParentIncludeLoc, OS);
|
DiagSrcMgr.PrintIncludeStack(ParentIncludeLoc, OS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have not parsed a cpp hash line filename comment or the source
|
// If we have not parsed a cpp hash line filename comment or the source
|
||||||
// manager changed or buffer changed (like in a nested include) then just
|
// manager changed or buffer changed (like in a nested include) then just
|
||||||
// print the normal diagnostic using its Filename and LineNo.
|
// print the normal diagnostic using its Filename and LineNo.
|
||||||
if (!Parser->CppHashLineNumber ||
|
if (!Parser->CppHashLineNumber ||
|
||||||
|
@ -1525,7 +1526,7 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the CppHashFilename and calculate a line number based on the
|
// Use the CppHashFilename and calculate a line number based on the
|
||||||
// CppHashLoc and CppHashLineNumber relative to this Diag's SMLoc for
|
// CppHashLoc and CppHashLineNumber relative to this Diag's SMLoc for
|
||||||
// the diagnostic.
|
// the diagnostic.
|
||||||
const std::string Filename = Parser->CppHashFilename;
|
const std::string Filename = Parser->CppHashFilename;
|
||||||
|
|
Loading…
Reference in New Issue