Try to get rid of a -wunitialized warning: explicitly initialize the pointer

to NULL and use asserts to check in relevant places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176134 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Bendersky 2013-02-26 23:04:17 +00:00
parent 616025007a
commit 533048228f

View File

@ -427,7 +427,7 @@ int main(int argc, char **argv) {
OwningPtr<MCSubtargetInfo>
STI(TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr));
MCInstPrinter *IP;
MCInstPrinter *IP = NULL;
if (FileType == OFT_AssemblyFile) {
IP =
TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *MCII, *MRI, *STI);
@ -465,10 +465,12 @@ int main(int argc, char **argv) {
Res = AssembleInput(ProgName, TheTarget, SrcMgr, Ctx, *Str, *MAI, *STI);
break;
case AC_MDisassemble:
assert(IP && "Expected assembly output");
IP->setUseMarkup(1);
disassemble = true;
break;
case AC_HDisassemble:
assert(IP && "Expected assembly output");
IP->setPrintImmHex(1);
disassemble = true;
break;