[llvm-commits] [llvm] r161529 - /llvm/trunk/tools/lto/LTOModule.cpp
Bill Wendling
isanbard at gmail.com
Wed Aug 8 15:01:55 PDT 2012
Author: void
Date: Wed Aug 8 17:01:55 2012
New Revision: 161529
URL: http://llvm.org/viewvc/llvm-project?rev=161529&view=rev
Log:
Cache a commonly used reference.
Modified:
llvm/trunk/tools/lto/LTOModule.cpp
Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=161529&r1=161528&r2=161529&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Wed Aug 8 17:01:55 2012
@@ -798,21 +798,20 @@
OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr,
_context, *Streamer,
*_target->getMCAsmInfo()));
- OwningPtr<MCSubtargetInfo> STI(_target->getTarget().
- createMCSubtargetInfo(_target->getTargetTriple(),
- _target->getTargetCPU(),
- _target->getTargetFeatureString()));
- OwningPtr<MCTargetAsmParser>
- TAP(_target->getTarget().createMCAsmParser(*STI, *Parser.get()));
+ const Target &T = _target->getTarget();
+ OwningPtr<MCSubtargetInfo>
+ STI(T.createMCSubtargetInfo(_target->getTargetTriple(),
+ _target->getTargetCPU(),
+ _target->getTargetFeatureString()));
+ OwningPtr<MCTargetAsmParser> TAP(T.createMCAsmParser(*STI, *Parser.get()));
if (!TAP) {
- errMsg = "target " + std::string(_target->getTarget().getName()) +
- " does not define AsmParser.";
+ errMsg = "target " + std::string(T.getName()) +
+ " does not define AsmParser.";
return true;
}
Parser->setTargetParser(*TAP);
- int Res = Parser->Run(false);
- if (Res)
+ if (Parser->Run(false))
return true;
for (RecordStreamer::const_iterator i = Streamer->begin(),
@@ -827,6 +826,7 @@
Value == RecordStreamer::Used)
addAsmGlobalSymbolUndef(Key.data());
}
+
return false;
}
@@ -834,8 +834,10 @@
static bool isDeclaration(const GlobalValue &V) {
if (V.hasAvailableExternallyLinkage())
return true;
+
if (V.isMaterializable())
return false;
+
return V.isDeclaration();
}
More information about the llvm-commits
mailing list