Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: tools/lto/LTOModule.cpp

Issue 7850008: lto/addAsmGlobalSymbols: fast path when no module level asm is present (Closed) Base URL: https://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: . Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.empty())
619 return false;
618 620
619 OwningPtr<RecordStreamer> Streamer(new RecordStreamer(Context)); 621 OwningPtr<RecordStreamer> Streamer(new RecordStreamer(Context));
620 MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm); 622 MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm);
621 SourceMgr SrcMgr; 623 SourceMgr SrcMgr;
622 SrcMgr.AddNewSourceBuffer(Buffer, SMLoc()); 624 SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
623 OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, 625 OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr,
624 Context, *Streamer, 626 Context, *Streamer,
625 *_target->getMCAsmInfo())); 627 *_target->getMCAsmInfo()));
626 OwningPtr<MCSubtargetInfo> STI(_target->getTarget(). 628 OwningPtr<MCSubtargetInfo> STI(_target->getTarget().
627 createMCSubtargetInfo(_target->getTargetTriple(), 629 createMCSubtargetInfo(_target->getTargetTriple(),
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 else 723 else
722 return lto_symbol_attributes(0); 724 return lto_symbol_attributes(0);
723 } 725 }
724 726
725 const char *LTOModule::getSymbolName(uint32_t index) { 727 const char *LTOModule::getSymbolName(uint32_t index) {
726 if (index < _symbols.size()) 728 if (index < _symbols.size())
727 return _symbols[index].name; 729 return _symbols[index].name;
728 else 730 else
729 return NULL; 731 return NULL;
730 } 732 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698