Add support for assertions in llvm-rs-cc.
Bug: 3430674
Change-Id: I3400238652449cde84275cc2a770f405332d9544
diff --git a/slang_rs_export_func.cpp b/slang_rs_export_func.cpp
index 58968e7..95e09f2 100644
--- a/slang_rs_export_func.cpp
+++ b/slang_rs_export_func.cpp
@@ -24,6 +24,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Target/TargetData.h"
+#include "slang_assert.h"
#include "slang_rs_context.h"
namespace slang {
@@ -33,7 +34,7 @@
llvm::StringRef Name = FD->getName();
RSExportFunc *F;
- assert(!Name.empty() && "Function must have a name");
+ slangAssert(!Name.empty() && "Function must have a name");
F = new RSExportFunc(Context, Name);
@@ -77,7 +78,7 @@
RD->completeDefinition();
clang::QualType T = Ctx.getTagDeclType(RD);
- assert(!T.isNull());
+ slangAssert(!T.isNull());
RSExportType *ET =
RSExportType::Create(Context, T.getTypePtr());
@@ -90,7 +91,7 @@
return NULL;
}
- assert((ET->getClass() == RSExportType::ExportClassRecord) &&
+ slangAssert((ET->getClass() == RSExportType::ExportClassRecord) &&
"Parameter packet must be a record");
F->mParamPacketType = static_cast<RSExportRecordType *>(ET);
@@ -106,7 +107,7 @@
else if (!hasParam())
return false;
- assert(mParamPacketType != NULL);
+ slangAssert(mParamPacketType != NULL);
const RSExportRecordType *ERT = mParamPacketType;
// must have same number of elements