diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-10 07:14:18 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-10 07:14:18 +0000 |
commit | 24e64df7ec25b55aa872c2ef33728dfbb8c353c4 (patch) | |
tree | 7bd02b0cd86413d8a5202b7356d5670522ec2c93 /lib/Bitcode/Reader | |
parent | f4fb91181cbd3f63d487a2519c7f7be9d5e51709 (diff) | |
download | external_llvm-24e64df7ec25b55aa872c2ef33728dfbb8c353c4.zip external_llvm-24e64df7ec25b55aa872c2ef33728dfbb8c353c4.tar.gz external_llvm-24e64df7ec25b55aa872c2ef33728dfbb8c353c4.tar.bz2 |
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 87c4fd7..a417c68 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -766,6 +766,7 @@ bool BitcodeReader::ParseMetadata() { continue; } + bool IsFunctionLocal = false; // Read a record. Record.clear(); switch (Stream.ReadRecord(Code, Record)) { @@ -804,6 +805,9 @@ bool BitcodeReader::ParseMetadata() { MDValueList.AssignValue(V, NextValueNo++); break; } + case bitc::METADATA_FN_NODE: + IsFunctionLocal = true; + // fall-through case bitc::METADATA_NODE: { if (Record.empty() || Record.size() % 2 == 1) return Error("Invalid METADATA_NODE record"); @@ -819,7 +823,9 @@ bool BitcodeReader::ParseMetadata() { else Elts.push_back(NULL); } - Value *V = MDNode::get(Context, &Elts[0], Elts.size()); + Value *V = MDNode::getWhenValsUnresolved(Context, &Elts[0], Elts.size(), + IsFunctionLocal); + IsFunctionLocal = false; MDValueList.AssignValue(V, NextValueNo++); break; } |