belickim created this revision.
Herald added a subscriber: cfe-commits.
This patch is a fix for following issue:
https://bugs.llvm.org/show_bug.cgi?id=31362
The problem was caused by front end lowering C calling conventions without
taking into account calling conventions enforced by __attribute_
belickim updated this revision to Diff 100674.
belickim added a comment.
Thanks Akira for your comments, I made all changes that you suggested.
https://reviews.llvm.org/D33356
Files:
include/clang/Basic/BuiltinsNios2.def
include/clang/Basic/TargetBuiltins.h
lib/Basic/Targets.cpp
lib/Dri
belickim added inline comments.
Comment at: include/clang/Basic/TargetBuiltins.h:154
+ /// \brief Nios2 builtins
+ namespace Nios2 {
+ enum {
ahatanak wrote:
> No need to indent enum inside namespace.
>
> http://llvm.org/docs/CodingStandards.html#namespac
belickim updated this revision to Diff 100668.
belickim added a comment.
I added test for driver to check if target and CPU flags are recognized, as
Craig suggested.
https://reviews.llvm.org/D33356
Files:
include/clang/Basic/BuiltinsNios2.def
include/clang/Basic/TargetBuiltins.h
lib/Basi
belickim updated this revision to Diff 100111.
belickim added a comment.
I implemented changes suggested by Joerg.
In previous version there was also an additional macro with CPU name that I
removed. It was not documented anywhere and is not even used by GCC. So there
seems to be no prior usage
belickim added inline comments.
Comment at: lib/Basic/Targets.cpp:7650
+DefineStd(Builder, "nios2", Opts);
+DefineStd(Builder, "NIOS2", Opts);
+
joerg wrote:
> belickim wrote:
> > joerg wrote:
> > > DefineStd tends to give a lot of namespace pollution, is
belickim added a comment.
Additionally this information may be useful in context of this patch: here is
specification of Nios2 builtins as implemented in GCC:
https://gcc.gnu.org/onlinedocs/gcc/Altera-Nios-II-Built-in-Functions.html
https://reviews.llvm.org/D33356
__
belickim added inline comments.
Comment at: lib/Basic/Targets.cpp:7614
+ resetDataLayout(("e-" + Layout).str());
+}
+ }
joerg wrote:
> Can you just give the full string and avoid the runtime allocations?
Yes, I will fix this.
Comment
belickim created this revision.
Hello,
This patch is part of our effort to implement Nios2 architecture support in
LLVM and clang (our plans were announced in mailing list thread: "[llvm-dev]
[RFC] Nios II backend" form April 12th).
This patch depends on changes introduced by patch D32669