mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
llvm-mc: Support -n, useful for comparing -integrated-as output since the
compiler may not lead with the text section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98418 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -64,7 +64,7 @@ public:
|
|||||||
const MCAsmInfo &MAI);
|
const MCAsmInfo &MAI);
|
||||||
~AsmParser();
|
~AsmParser();
|
||||||
|
|
||||||
bool Run();
|
bool Run(bool NoInitialTextSection);
|
||||||
|
|
||||||
|
|
||||||
void AddDirectiveHandler(StringRef Directive,
|
void AddDirectiveHandler(StringRef Directive,
|
||||||
|
@@ -138,15 +138,14 @@ const AsmToken &AsmParser::Lex() {
|
|||||||
return *tok;
|
return *tok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AsmParser::Run() {
|
bool AsmParser::Run(bool NoInitialTextSection) {
|
||||||
// Create the initial section.
|
// Create the initial section, if requested.
|
||||||
//
|
//
|
||||||
// FIXME: Support -n.
|
|
||||||
// FIXME: Target hook & command line option for initial section.
|
// FIXME: Target hook & command line option for initial section.
|
||||||
Out.SwitchSection(getMachOSection("__TEXT", "__text",
|
if (!NoInitialTextSection)
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
Out.SwitchSection(getMachOSection("__TEXT", "__text",
|
||||||
0, SectionKind::getText()));
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
|
0, SectionKind::getText()));
|
||||||
|
|
||||||
// Prime the lexer.
|
// Prime the lexer.
|
||||||
Lex();
|
Lex();
|
||||||
|
@@ -84,6 +84,10 @@ static cl::opt<std::string>
|
|||||||
TripleName("triple", cl::desc("Target triple to assemble for, "
|
TripleName("triple", cl::desc("Target triple to assemble for, "
|
||||||
"see -version for available targets"));
|
"see -version for available targets"));
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
NoInitialTextSection("n", cl::desc(
|
||||||
|
"Don't assume assembly file starts in the text section"));
|
||||||
|
|
||||||
enum ActionType {
|
enum ActionType {
|
||||||
AC_AsLex,
|
AC_AsLex,
|
||||||
AC_Assemble,
|
AC_Assemble,
|
||||||
@@ -303,7 +307,7 @@ static int AssembleInput(const char *ProgName) {
|
|||||||
|
|
||||||
Parser.setTargetParser(*TAP.get());
|
Parser.setTargetParser(*TAP.get());
|
||||||
|
|
||||||
int Res = Parser.Run();
|
int Res = Parser.Run(NoInitialTextSection);
|
||||||
if (Out != &fouts())
|
if (Out != &fouts())
|
||||||
delete Out;
|
delete Out;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user