[PATCH] D41832: LLParser: Do not check alloca addr space if the assembly does not contain data layout definition

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 08:13:28 PST 2018


yaxunl added inline comments.


================
Comment at: include/llvm/IR/Verifier.h:101
+                  bool *BrokenDebugInfo = nullptr,
+                  bool CheckAllocaAddrSpace = true);
 
----------------
arsenm wrote:
> yaxunl wrote:
> > arsenm wrote:
> > > I'm not sure I understand why this option is needed or to UpgradeDebugInfo. I would expect the datalayout to be set already by the time any verification is done
> > LLParser calls UpgradeDebugInfo, which calls verifyModule. At this point the datalayout has not been set yet. llc sets datalayout by target after parsing the IR.
> Why does UpgradeDebugInfo need a special second verify run? Is there an issue with just removing that and relying on the normal verify pass?
UpgradeDebugInfo checks if the module only contains debug info error or any other error. If the module only contains debug info error,  then it reports the error. If the debug info version is outdated, it deletes the debug info. If the module contains other error, it will report fatal error.

LLParser calls UpgradeDebugInfo mainly to report debug info error and delete outdated debug info. However since UpgradeDeugInfo may be called by other functions which expect it to abort on invalid module.


https://reviews.llvm.org/D41832





More information about the llvm-commits mailing list