R600: Fix function name printing in LowerCall
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 25 Apr 2014 22:22:01 +0000 (22:22 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 25 Apr 2014 22:22:01 +0000 (22:22 +0000)
v2: Check both ExternalSymbol and GlobalAddress

Patch by: Jan Vesely <jan.vesely@rutgers.edu>

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

lib/Target/R600/AMDGPUISelLowering.cpp

index 97107a58e71d83482a7a05c5ccb33c1c74284f70..015f0ae4d7860490efce49008b3420b787bc4c03 100644 (file)
@@ -362,7 +362,9 @@ SDValue AMDGPUTargetLowering::LowerCall(CallLoweringInfo &CLI,
 
   StringRef FuncName("<unknown>");
 
-  if (const GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
+  if (const ExternalSymbolSDNode *G = dyn_cast<ExternalSymbolSDNode>(Callee))
+    FuncName = G->getSymbol();
+  else if (const GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
     FuncName = G->getGlobal()->getName();
 
   DiagnosticInfoUnsupported NoCalls(Fn, "call to function " + FuncName);