Provide additional information about global variables.
Bug: 20306487
This patch extends our global information pass to include details about the
type of a global variable, whether or not it is static, constant, or a
pointer. It also refactors code that deals with conversion between
RenderScript's internal data types and LLVM's type system. A subtle bug
has also been fixed with respect to the RSInvokeHelperPass. The previous
version could ignore an rs_* object that did not have a numeric suffix.
The new helper function properly addresses cases like this.
Change-Id: If9c933a885bf6a9063b7edec3f0873e1b144188d
diff --git a/lib/Renderscript/RSEmbedInfo.cpp b/lib/Renderscript/RSEmbedInfo.cpp
index 65f7ed7..dc1033c 100644
--- a/lib/Renderscript/RSEmbedInfo.cpp
+++ b/lib/Renderscript/RSEmbedInfo.cpp
@@ -15,7 +15,11 @@
*/
#include "bcc/Assert.h"
+#include "bcc/Config/Config.h"
#include "bcc/Renderscript/RSTransforms.h"
+#include "bcc/Support/Log.h"
+#include "bcinfo/MetadataExtractor.h"
+#include "rsDefines.h"
#include <cstdlib>
#include <vector>
@@ -29,10 +33,6 @@
#include <llvm/Support/raw_ostream.h>
#include <llvm/IR/Type.h>
-#include "bcc/Config/Config.h"
-#include "bcc/Support/Log.h"
-#include "bcinfo/MetadataExtractor.h"
-
using namespace bcc;
namespace {
@@ -142,7 +142,7 @@
llvm::GlobalVariable *InfoGV =
new llvm::GlobalVariable(M, Init->getType(), true,
llvm::GlobalValue::ExternalLinkage, Init,
- ".rs.info");
+ kRsInfo);
(void) InfoGV;
return true;