diff options
| author | David Peixotto <dpeixott@codeaurora.org> | 2013-12-19 18:08:08 +0000 | 
|---|---|---|
| committer | David Peixotto <dpeixott@codeaurora.org> | 2013-12-19 18:08:08 +0000 | 
| commit | 308e7e4367210934fad7e7c0c404a00e7c564993 (patch) | |
| tree | a23713aae4fd020a4ac0d488f4c718fe0eeae850 | |
| parent | a570b5adb5e328c6ef3dd62c730389ae9a2bc2fd (diff) | |
| download | bcm5719-llvm-308e7e4367210934fad7e7c0c404a00e7c564993.tar.gz bcm5719-llvm-308e7e4367210934fad7e7c0c404a00e7c564993.zip  | |
Add a finishParse() callback to the targer asm parser
This callback is invoked when the parse has finished successfuly. It
will be used to write out ARM constant pools to implement the ldr
pseudo.
llvm-svn: 197706
| -rw-r--r-- | llvm/include/llvm/MC/MCTargetAsmParser.h | 5 | ||||
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 4 | 
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/MC/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCTargetAsmParser.h index d132a732c41..bfcf233f70b 100644 --- a/llvm/include/llvm/MC/MCTargetAsmParser.h +++ b/llvm/include/llvm/MC/MCTargetAsmParser.h @@ -182,6 +182,11 @@ public:      return 0;    } +  /// Allow a target to perform any actions after the parse completes +  /// successfully.  For example, to write out constant pools for ldr pseudo on +  /// ARM. +  virtual void finishParse() {}; +    virtual void onLabelParsed(MCSymbol *Symbol) { };  }; diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 35f38a2a87c..5de10a7ba37 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -677,6 +677,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {      }    } +  // Callback to the target parser in case it needs to do anything. +  if (!HadError) +    getTargetParser().finishParse(); +    // Finalize the output stream if there are no errors and if the client wants    // us to.    if (!HadError && !NoFinalize)  | 

