Clean up the definition of Str in AsmParser::ParseDirectiveDarwinDumpOrLoad
authorKevin Enderby <enderby@apple.com>
Thu, 16 Jul 2009 17:17:46 +0000 (17:17 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 16 Jul 2009 17:17:46 +0000 (17:17 +0000)
so it is defined with a lifetime that is as short as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76082 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-mc/AsmParser.cpp

index 68eb9d56c07b8ab0a6f98d70e84a2373e402bd95..5a6db1c9c02d7313bcb7c478a03c9eb1ad3c6abd 100644 (file)
@@ -1196,12 +1196,10 @@ bool AsmParser::ParseDirectiveInclude() {
 /// ParseDirectiveDarwinDumpOrLoad
 ///  ::= ( .dump | .load ) "filename"
 bool AsmParser::ParseDirectiveDarwinDumpOrLoad(bool IsDump) {
-  const char *Str;
-
   if (Lexer.isNot(asmtok::String))
     return TokError("expected string in '.dump' or '.load' directive");
   
-  Str = Lexer.getCurStrVal();
+  const char *Str = Lexer.getCurStrVal();
 
   Lexer.Lex();