aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorHasyimi Bahrudin <hasyimi@ridebeam.com>2021-05-27 04:01:20 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-05-27 04:20:03 +0000
commit8d25762720660aba3344752e577ae7017e6125c2 (patch)
tree4c8fb6c199e4ee22a94bcf93ebc87cc2726e81f6 /llvm/lib/IR/Module.cpp
parent0ce58c52d50bd2edd09df7c7ef3dd4dc85b05992 (diff)
downloadllvm-8d25762720660aba3344752e577ae7017e6125c2.zip
llvm-8d25762720660aba3344752e577ae7017e6125c2.tar.gz
llvm-8d25762720660aba3344752e577ae7017e6125c2.tar.bz2
Fix non-global-value-max-name-size not considered by LLParser
`non-global-value-max-name-size` is used by `Value` to cap the length of local value name. However, this flag is not considered by `LLParser`, which leads to unexpected `use of undefined value error`. The fix is to move the responsibility of capping the length to `ValueSymbolTable`. The test is the one provided by [[ https://bugs.llvm.org/show_bug.cgi?id=45899 | Mikael in the bug report ]]. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D102707
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index d38b2d1..eae4e69 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -72,7 +72,7 @@ template class llvm::SymbolTableListTraits<GlobalIFunc>;
//
Module::Module(StringRef MID, LLVMContext &C)
- : Context(C), ValSymTab(std::make_unique<ValueSymbolTable>()),
+ : Context(C), ValSymTab(std::make_unique<ValueSymbolTable>(-1)),
Materializer(), ModuleID(std::string(MID)),
SourceFileName(std::string(MID)), DL("") {
Context.addModule(this);