Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===-- LTOModule.cpp - LLVM Link Time Optimizer --------------------------===// | 1 //===-- LTOModule.cpp - LLVM Link Time Optimizer --------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the Link Time Optimization library. This library is | 10 // This file implements the Link Time Optimization library. This library is |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 for (unsigned i = Inst.getNumOperands(); i--; ) | 608 for (unsigned i = Inst.getNumOperands(); i--; ) |
| 609 if (Inst.getOperand(i).isExpr()) | 609 if (Inst.getOperand(i).isExpr()) |
| 610 AddValueSymbols(Inst.getOperand(i).getExpr()); | 610 AddValueSymbols(Inst.getOperand(i).getExpr()); |
| 611 } | 611 } |
| 612 virtual void Finish() {} | 612 virtual void Finish() {} |
| 613 }; | 613 }; |
| 614 } | 614 } |
| 615 | 615 |
| 616 bool LTOModule::addAsmGlobalSymbols(MCContext &Context) { | 616 bool LTOModule::addAsmGlobalSymbols(MCContext &Context) { |
| 617 const std::string &inlineAsm = _module->getModuleInlineAsm(); | 617 const std::string &inlineAsm = _module->getModuleInlineAsm(); |
| 618 if (inlineAsm == "") { | |
|
nlewycky
2011/09/08 00:31:52
inlineAsm.empty(), and this file doesn't use {} in
krasin
2011/09/08 00:34:23
Done.
| |
| 619 return false; | |
| 620 } | |
| 618 | 621 |
| 619 OwningPtr<RecordStreamer> Streamer(new RecordStreamer(Context)); | 622 OwningPtr<RecordStreamer> Streamer(new RecordStreamer(Context)); |
| 620 MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm); | 623 MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm); |
| 621 SourceMgr SrcMgr; | 624 SourceMgr SrcMgr; |
| 622 SrcMgr.AddNewSourceBuffer(Buffer, SMLoc()); | 625 SrcMgr.AddNewSourceBuffer(Buffer, SMLoc()); |
| 623 OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, | 626 OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, |
| 624 Context, *Streamer, | 627 Context, *Streamer, |
| 625 *_target->getMCAsmInfo())); | 628 *_target->getMCAsmInfo())); |
| 626 OwningPtr<MCSubtargetInfo> STI(_target->getTarget(). | 629 OwningPtr<MCSubtargetInfo> STI(_target->getTarget(). |
| 627 createMCSubtargetInfo(_target->getTargetTriple(), | 630 createMCSubtargetInfo(_target->getTargetTriple(), |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 else | 724 else |
| 722 return lto_symbol_attributes(0); | 725 return lto_symbol_attributes(0); |
| 723 } | 726 } |
| 724 | 727 |
| 725 const char *LTOModule::getSymbolName(uint32_t index) { | 728 const char *LTOModule::getSymbolName(uint32_t index) { |
| 726 if (index < _symbols.size()) | 729 if (index < _symbols.size()) |
| 727 return _symbols[index].name; | 730 return _symbols[index].name; |
| 728 else | 731 else |
| 729 return NULL; | 732 return NULL; |
| 730 } | 733 } |
| OLD | NEW |