diff options
author | Puyan Lotfi <puyan@puyan.org> | 2019-11-28 16:43:56 -0500 |
---|---|---|
committer | Puyan Lotfi <puyan@puyan.org> | 2019-12-05 12:56:37 -0500 |
commit | ef7267def69f9416b53388a5b5ea612bed9573d9 (patch) | |
tree | ce0219aaa26f93105f37d81aa36d767011c1b1e3 /llvm/tools/llvm-ifs/llvm-ifs.cpp | |
parent | 1847fd9d85506ecee692230cb2500e3774ec628e (diff) | |
download | bcm5719-llvm-ef7267def69f9416b53388a5b5ea612bed9573d9.tar.gz bcm5719-llvm-ef7267def69f9416b53388a5b5ea612bed9573d9.zip |
[llvm] llvm-ifs: Support for handling empty IFS and merging weak+strong symbols.
The following changes enable llvm-ifs to handle the following merge conflicts:
* Weak + Strong symbol merging for the same symbol
* empty vs non-empty triple field
* empty vs non-empty object file format
Differential Revision: https://reviews.llvm.org/D70834
Diffstat (limited to 'llvm/tools/llvm-ifs/llvm-ifs.cpp')
-rw-r--r-- | llvm/tools/llvm-ifs/llvm-ifs.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp index 2aadab988e2..d5816f49f65 100644 --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp @@ -422,6 +422,10 @@ int main(int argc, char *argv[]) { Stub.SOName = TargetStub->SOName; Stub.NeededLibs = TargetStub->NeededLibs; } else { + Stub.ObjectFileFormat = !Stub.ObjectFileFormat.empty() + ? Stub.ObjectFileFormat + : TargetStub->ObjectFileFormat; + if (Stub.IfsVersion != TargetStub->IfsVersion) { if (Stub.IfsVersion.getMajor() != IFSVersionCurrent.getMajor()) { WithColor::error() @@ -434,7 +438,8 @@ int main(int argc, char *argv[]) { if (TargetStub->IfsVersion > Stub.IfsVersion) Stub.IfsVersion = TargetStub->IfsVersion; } - if (Stub.ObjectFileFormat != TargetStub->ObjectFileFormat) { + if (Stub.ObjectFileFormat != TargetStub->ObjectFileFormat && + !TargetStub->ObjectFileFormat.empty()) { WithColor::error() << "Interface Stub: ObjectFileFormat Mismatch." << "\nFilenames: " << PreviousInputFilePath << " " << InputFilePath << "\nObjectFileFormat Values: " @@ -442,7 +447,7 @@ int main(int argc, char *argv[]) { << TargetStub->ObjectFileFormat << "\n"; return -1; } - if (Stub.Triple != TargetStub->Triple) { + if (Stub.Triple != TargetStub->Triple && !TargetStub->Triple.empty()) { WithColor::error() << "Interface Stub: Triple Mismatch." << "\nFilenames: " << PreviousInputFilePath << " " << InputFilePath @@ -494,13 +499,8 @@ int main(int argc, char *argv[]) { return -1; } if (Symbol.Weak != SI->second.Weak) { - // TODO: Add conflict resolution for Weak vs non-Weak. - WithColor::error() << "Interface Stub: Weak Mismatch for " - << Symbol.Name << ".\nFilename: " << InputFilePath - << "\nWeak Values: " << SI->second.Weak << " " - << Symbol.Weak << "\n"; - - return -1; + Symbol.Weak = false; + continue; } // TODO: Not checking Warning. Will be dropped. } |