[Mlir-commits] [mlir] [MLIR][LLVM] Allow importing of nameless globals (PR #101918)
Christian Ulmann
llvmlistbot at llvm.org
Sun Aug 4 20:26:54 PDT 2024
================
@@ -1061,7 +1073,12 @@ FailureOr<Value> ModuleImport::convertConstant(llvm::Constant *constant) {
// Convert global variable accesses.
if (auto *globalVar = dyn_cast<llvm::GlobalVariable>(constant)) {
Type type = convertType(globalVar->getType());
- auto symbolRef = FlatSymbolRefAttr::get(context, globalVar->getName());
+ StringRef globalName = globalVar->getName();
+ FlatSymbolRefAttr symbolRef;
+ if (globalName == "")
----------------
Dinistro wrote:
```suggestion
if (globalName.empty())
```
https://github.com/llvm/llvm-project/pull/101918
More information about the Mlir-commits
mailing list