forked from OSchip/llvm-project
parent
f63a4ecc0b
commit
7c73b19bb8
|
@ -499,7 +499,8 @@ void BytecodeParser::ParseModuleGlobalInfo(const unsigned char *&Buf,
|
||||||
BCR_TRACE(2, "Function of type: " << Ty << "\n");
|
BCR_TRACE(2, "Function of type: " << Ty << "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
align32(Buf, End);
|
if (hasInconsistentModuleGlobalInfo)
|
||||||
|
align32(Buf, End);
|
||||||
|
|
||||||
// Now that the function signature list is set up, reverse it so that we can
|
// Now that the function signature list is set up, reverse it so that we can
|
||||||
// remove elements efficiently from the back of the vector.
|
// remove elements efficiently from the back of the vector.
|
||||||
|
@ -530,6 +531,7 @@ void BytecodeParser::ParseVersionInfo(const unsigned char *&Buf,
|
||||||
hasExtendedLinkageSpecs = true;
|
hasExtendedLinkageSpecs = true;
|
||||||
hasOldStyleVarargs = false;
|
hasOldStyleVarargs = false;
|
||||||
hasVarArgCallPadding = false;
|
hasVarArgCallPadding = false;
|
||||||
|
hasInconsistentModuleGlobalInfo = false;
|
||||||
FirstDerivedTyID = 14;
|
FirstDerivedTyID = 14;
|
||||||
|
|
||||||
switch (RevisionNum) {
|
switch (RevisionNum) {
|
||||||
|
@ -539,15 +541,22 @@ void BytecodeParser::ParseVersionInfo(const unsigned char *&Buf,
|
||||||
hasExtendedLinkageSpecs = false;
|
hasExtendedLinkageSpecs = false;
|
||||||
hasOldStyleVarargs = true;
|
hasOldStyleVarargs = true;
|
||||||
hasVarArgCallPadding = true;
|
hasVarArgCallPadding = true;
|
||||||
|
hasInconsistentModuleGlobalInfo = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0: // LLVM 1.0, 1.1 release version
|
case 0: // LLVM 1.0, 1.1 release version
|
||||||
// Compared to rev #2, we added support for weak linkage, a more dense
|
// Compared to rev #2, we added support for weak linkage, a more dense
|
||||||
// encoding, and better varargs support.
|
// encoding, and better varargs support.
|
||||||
|
|
||||||
// Base LLVM 1.0 bytecode format.
|
// Base LLVM 1.0 bytecode format.
|
||||||
|
hasInconsistentModuleGlobalInfo = true;
|
||||||
break;
|
break;
|
||||||
case 1: // LLVM 1.2 release version
|
case 1: // LLVM 1.2 release version
|
||||||
// LLVM 1.2 added explicit support for emitting strings efficiently.
|
// LLVM 1.2 added explicit support for emitting strings efficiently.
|
||||||
|
|
||||||
|
// Also, it fixed the problem where the size of the ModuleGlobalInfo block
|
||||||
|
// included the size for the alignment at the end, where the rest of the
|
||||||
|
// blocks did not.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -97,6 +97,10 @@ private:
|
||||||
|
|
||||||
bool usesOldStyleVarargs; // Does this module USE old style varargs?
|
bool usesOldStyleVarargs; // Does this module USE old style varargs?
|
||||||
|
|
||||||
|
// LLVM 1.0 & 1.1 had an explicit alignment of data only for the
|
||||||
|
// ModuleGlobalInfo block. This was fixed to be like all other blocks in 1.2
|
||||||
|
bool hasInconsistentModuleGlobalInfo;
|
||||||
|
|
||||||
typedef std::vector<ValueList*> ValueTable;
|
typedef std::vector<ValueList*> ValueTable;
|
||||||
ValueTable Values;
|
ValueTable Values;
|
||||||
ValueTable ModuleValues;
|
ValueTable ModuleValues;
|
||||||
|
|
Loading…
Reference in New Issue