Add UBSAN build option and fix undefined behaviour errors.
1. The assembler tried to write to unaligned addresses but memcpy fixes this.
2. The InstKind and OperandKind enums allowed target specific kinds that did not
fall in the defined range. Defining the maximum target kind in the enum sorts
this problem.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1311653003 .
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index 1d10ba4..4450a79 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -745,7 +745,7 @@
addGlobalInitializer(*VarDecl, Initializer);
}
}
- return std::move(VariableDeclarations);
+ return VariableDeclarations;
}
void LLVM2ICEGlobalsConverter::addGlobalInitializer(