]> granicus.if.org Git - llvm/commitdiff
[codeview] don't try to emit variable locations without registers
authorBob Haarman <llvm@inglorion.net>
Tue, 29 Aug 2017 01:45:54 +0000 (01:45 +0000)
committerBob Haarman <llvm@inglorion.net>
Tue, 29 Aug 2017 01:45:54 +0000 (01:45 +0000)
This fixes a problem introduced 311957, where the compiler would crash
with "fatal error: error in backend: unknown codeview register".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311969 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

index ed2c263d3202fa8441505de54b9916bd00849ebb..6a35e3214bd87c8faed05f7afcb6ed5ca09d7314 100644 (file)
@@ -988,7 +988,7 @@ void CodeViewDebug::calculateRanges(
     }
 
     // If we don't know how to handle this range, skip past it.
-    if (!Supported || (Location.Offset && !Location.InMemory))
+    if (!Supported || Location.Register == 0 || (Location.Offset && !Location.InMemory))
       continue;
 
     // Handle the two cases we can handle: indirect in memory and in register.