[LLVMdev] Is the online demo using outdated binaries?
Óscar Fuentes
ofv at wanadoo.es
Fri Oct 17 22:52:51 PDT 2008
Throwing this C++ code at the online demo:
struct S {
double d;
unsigned u;
};
S foo() {
return S();
}
produces this LLVM C++ API code:
(...)
PAListPtr func__Z3foov_PAL = 0;
{
SmallVector<ParamAttrsWithIndex, 4> Attrs;
ParamAttrsWithIndex PAWI;
PAWI.index = 0; PAWI.attrs = 0 | ParamAttr::NoUnwind;
Attrs.push_back(PAWI);
PAWI.index = 1; PAWI.attrs = 0 | ParamAttr::StructRet | ParamAttr::NoAlias;
Attrs.push_back(PAWI);
func__Z3foov_PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
}
func__Z3foov->setParamAttrs(func__Z3foov_PAL);
(...)
Please note that it uses index 1 for the return attributes, which is
inconsistent with what ReleaseNotes.html TOT says:
...
* Return value attributes are stored at index 0. Function attributes are
stored at index ~0U. Parameter attributes are stored at index that
matches parameter number.
...
Apart from this, the online demo page mentions llvm2cpp, which does not
exists since 2.3:
Output from llvm2cpp
// Generated by llvm2cpp - DO NOT MODIFY!
--
Oscar
More information about the llvm-dev
mailing list