aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/R600/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-03-18 17:36:31 -0700
committerStephen Hines <srhines@google.com>2013-03-18 17:36:31 -0700
commit2d4629c5d7dcc6582fa7b85a517744f1a3654eba (patch)
tree90c0395880593bf195fb818c2af1139cb7e846df /lib/Target/R600/SIMachineFunctionInfo.cpp
parentcd4c0bff77a9b5617896982e99dc80f469e26e4f (diff)
parent242cec5be3b3a715de0535d1a074bb4dff94772f (diff)
downloadexternal_llvm-2d4629c5d7dcc6582fa7b85a517744f1a3654eba.zip
external_llvm-2d4629c5d7dcc6582fa7b85a517744f1a3654eba.tar.gz
external_llvm-2d4629c5d7dcc6582fa7b85a517744f1a3654eba.tar.bz2
Merge branch 'upstream' into merge_2013_03_18
Diffstat (limited to 'lib/Target/R600/SIMachineFunctionInfo.cpp')
-rw-r--r--lib/Target/R600/SIMachineFunctionInfo.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/Target/R600/SIMachineFunctionInfo.cpp b/lib/Target/R600/SIMachineFunctionInfo.cpp
index 7e59b42..1a4e4cb 100644
--- a/lib/Target/R600/SIMachineFunctionInfo.cpp
+++ b/lib/Target/R600/SIMachineFunctionInfo.cpp
@@ -10,11 +10,25 @@
#include "SIMachineFunctionInfo.h"
+#include "llvm/IR/Attributes.h"
+#include "llvm/IR/Function.h"
using namespace llvm;
+const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
+
SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
: MachineFunctionInfo(),
- SPIPSInputAddr(0),
- ShaderType(0)
- { }
+ ShaderType(0),
+ PSInputAddr(0) {
+
+ AttributeSet Set = MF.getFunction()->getAttributes();
+ Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
+ ShaderTypeAttribute);
+
+ if (A.isStringAttribute()) {
+ StringRef Str = A.getValueAsString();
+ if (Str.getAsInteger(0, ShaderType))
+ llvm_unreachable("Can't parse shader type!");
+ }
+}