Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp.

llvm-svn: 199147
This commit is contained in:
Cameron McInally 2014-01-13 22:04:55 +00:00
parent 6840282c99
commit f0379fa41a
2 changed files with 7 additions and 2 deletions

View File

@ -207,9 +207,10 @@ static std::pair<StringRef, StringRef> split(StringRef Str, char Separator) {
/// Get an unsigned integer, including error checks.
static unsigned getInt(StringRef R) {
unsigned Result = 0;
unsigned Result;
bool error = R.getAsInteger(10, Result); (void)error;
assert(!error && "not a number, or does not fit in an unsigned int");
if (error)
report_fatal_error("not a number, or does not fit in an unsigned int");
return Result;
}

View File

@ -0,0 +1,4 @@
; RUN: opt < %s
; XFAIL: *
target datalayout = "p:4294967296:64:64"