- Jul 23, 2014
-
-
Saleem Abdulrasool authored
Now that we support WoA, this test fails on ARM build bots as __va_start has a different signature on different architectures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213714 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 22, 2014
-
-
Aaron Ballman authored
Improve the checkUInt32Argument() helper function so that it diagnoses integer constants larger than 32-bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213658 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
Provide extra information in the "integer constant is too large" diagnostic. This will be used to improve other diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213657 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 21, 2014
-
-
Justin Bogner authored
This fixes a couple of asserts when analyzing comparisons involving C11 atomics that were uncovered by r205608 when we extended the applicability of -Wtautological-constant-out-of-range-compare. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213573 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 19, 2014
-
-
Hal Finkel authored
C99 array parameters can have index-type CVR qualifiers, and the TypePrinter should print them when present (and we were not for constant-sized arrays). Otherwise, we'd drop the restrict in: int foo(int a[restrict static 3]) { ... } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213445 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
ExtWarn/Warnings. Mostly the name of the warning was changed to match the semantics, but in the PR20356 cases, the warning was about valid code, so the diagnostic was changed from ExtWarn to Warning instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213443 91177308-0d34-0410-b5e6-96231b3b80d8
-
Akira Hatanaka authored
<rdar://problem/17476689> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213428 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hal Finkel authored
In C99, an array parameter declarator might have the form: direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']' and when the size of the array is a constant, don't omit the static keyword when printing the type. Also, in the VLA case, put a space after the static keyword (some assignment expression must follow it). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213424 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 18, 2014
-
-
Yi Kong authored
Add an additional test to ensure that someone doesn't accidentally change the definitions such that they can take a non-constant value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213364 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
We were crashing on the relevant test case inputs. Also, refactor this code a bit so we can report failure and slurp the pragma tokens without returning a diagnostic id. This is more consistent with the rest of the parser and sema code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213337 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 17, 2014
-
-
Hal Finkel authored
This is a follow-up to an IRC conversation with Richard last night; __assume does not evaluate its argument, and so the argument should not contribute to whether (__assume(e), constant) can be used where a constant is required. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213267 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hal Finkel authored
In MS-compatibility mode, we support the __assume builtin. The __assume builtin does not evaluate its arguments, and we should issue a warning if __assume is provided with an argument with side effects (because these effects will be discarded). This is similar in spirit to the warnings issued by other compilers (Intel Diagnostic 2261, MS Compiler Warning C4557). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213266 91177308-0d34-0410-b5e6-96231b3b80d8
-
Yi Kong authored
Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to implement their corresponding ACLE and MSVC intrinsics. This patch ports ARM dmb, dsb, isb intrinsic to AArch64. Requires LLVM r213247. Differential Revision: http://reviews.llvm.org/D4521 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213250 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 16, 2014
-
-
Alp Toker authored
We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213159 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213148 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213139 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 11, 2014
-
-
Alp Toker authored
Make argument orders match, unify diagnostic IDs and reword the message to be a little less saccharine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212845 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
The returns_nonnull attribute does not require a function prototype because it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212827 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 09, 2014
-
-
David Majnemer authored
gcc supports this behavior and it is pervasively used inside the Linux kernel. Note that both gcc and clang will reject code that attempts to do this in a C++ language mode. This fixes PR17998. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212631 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 07, 2014
-
-
Anders Carlsson authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212464 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
Codegen is still missing (and I won't work on that), but __leave is now as implemented as __try and friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212425 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema walk the scope chain to find the SEHTry parent on __leave statements. (They are rare enough that it seems better to do the walk instead of giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212422 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212421 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 04, 2014
-
-
Ehsan Akhgari authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212353 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 03, 2014
-
-
Yi Kong authored
Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions modelling by adding has-side-effects property. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212277 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 02, 2014
-
-
Tim Northover authored
ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing variants of the exclusive operations, in line with the C++11 memory model. This adds support for two new intrinsics to expose them to C & C++ developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in direct analogy with the versions with no implicit barrier. rdar://problem/15885451 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212175 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alp Toker authored
Also document that the function is a "best-effort" facility to extract source ranges from limited AST type location info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212174 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alp Toker authored
C++ [basic.start.main]p1: "It shall have a return type of type int" ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212171 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 28, 2014
-
-
Alp Toker authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211979 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 27, 2014
-
-
Yi Kong authored
Summary: This patch introduces ACLE header file, implementing extensions that can be directly mapped to existing Clang intrinsics. It implements for both AArch32 and AArch64. Reviewers: t.p.northover, compnerd, rengolin Reviewed By: compnerd, rengolin Subscribers: rnk, echristo, compnerd, aemerson, mroth, cfe-commits Differential Revision: http://reviews.llvm.org/D4296 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211962 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 25, 2014
-
-
Serge Pavlov authored
Types defined in function prototype are diagnosed earlier in C++ compilation. They are put into declaration context where the prototype is introduced. Later on, when FunctionDecl object is created, these types are moved into the function context. This patch fixes PR19018 and PR18963. Differential Revision: http://reviews.llvm.org/D4145 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211718 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Majnemer authored
The C++ language requires that the address of a function be the same across all translation units. To make __declspec(dllimport) useful, this means that a dllimported function must also obey this rule. MSVC implements this by dynamically querying the import address table located in the linked executable. This means that the address of such a function in C++ is not constant (which violates other rules). However, the C language has no notion of ODR nor does it permit dynamic initialization whatsoever. This requires implementations to _not_ dynamically query the import address table and instead utilize a wrapper function that will be synthesized by the linker which will eventually query the import address table. The effect this has is, to say the least, perplexing. Consider the following C program: __declspec(dllimport) void f(void); typedef void (*fp)(void); static const fp var = &f; const fp fun() { return &f; } int main() { return fun() == var; } MSVC will statically initialize "var" with the address of the wrapper function and "fun" returns the address of the actual imported function. This means that "main" will return false! Note that LLVM's optimizers are strong enough to figure out that "main" should return true. However, this result is dependent on having optimizations enabled! N.B. This change also permits the usage of dllimport declarators inside of template arguments; they are sufficiently constant for such a purpose. Add tests to make sure we don't regress here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211677 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 20, 2014
-
-
James Molloy authored
and is unrelated to the NEON intrinsics in arm_neon.h. On little endian machines it works fine, however on big endian machines it exhibits surprising behaviour: uint32x2_t x = {42, 64}; return vget_lane_u32(x, 0); // Will return 64. Because of this, explicitly call out that it is unsupported on big endian machines. This patch will emit the following warning in big-endian mode: test.c:3:15: warning: vector initializers are a GNU extension and are not compatible with NEON intrinsics [-Wgnu] int32x4_t x = {0, 1, 2, 3}; ^ test.c:3:15: note: consider using vld1q_s32() to initialize a vector from memory, or vcombine_s32(vcreate_s32(), vcreate_s32()) to initialize from integer constants 1 warning generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211362 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 19, 2014
-
-
David Majnemer authored
CL permits static redeclarations to follow extern declarations. The storage specifier on the latter declaration has no effect. This fixes PR20034. Differential Revision: http://reviews.llvm.org/D4149 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211238 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 17, 2014
-
-
James Molloy authored
There comes a time in the life of any amateur code generator when dumb string concatenation just won't cut it any more. For NeonEmitter.cpp, that time has come. There were a bunch of magic type codes which meant different things depending on the context. There were a bunch of special cases that really had no reason to be there but the whole thing was so creaky that removing them would cause something weird to fall over. There was a 1000 line switch statement for code generation involving string concatenation, which actually did lexical scoping to an extent (!!) with a bunch of semi-repeated cases. I tried to refactor this three times in three different ways without success. The only way forward was to rewrite the entire thing. Luckily the testing coverage on this stuff is absolutely massive, both with regression tests and the "emperor" random test case generator. The main change is that previously, in arm_neon.td a bunch of "Operation"s were defined with special names. NeonEmitter.cpp knew about these Operations and would emit code based on a huge switch. Actually this doesn't make much sense - the type information was held as strings, so type checking was impossible. Also TableGen's DAG type actually suits this sort of code generation very well (surprising that...) So now every operation is defined in terms of TableGen DAGs. There are a bunch of operators to use, including "op" (a generic unary or binary operator), "call" (to call other intrinsics) and "shuffle" (take a guess...). One of the main advantages of this apart from making it more obvious what is going on, is that we have proper type inference. This has two obvious advantages: 1) TableGen can error on bad intrinsic definitions easier, instead of just generating wrong code. 2) Calls to other intrinsics are typechecked too. So we no longer need to work out whether the thing we call needs to be the Q-lane version or the D-lane version - TableGen knows that itself! Here's an example: before: case OpAbdl: { std::string abd = MangleName("vabd", typestr, ClassS) + "(__a, __b)"; if (typestr[0] != 'U') { // vabd results are always unsigned and must be zero-extended. std::string utype = "U" + typestr.str(); s += "(" + TypeString(proto[0], typestr) + ")"; abd = "(" + TypeString('d', utype) + ")" + abd; s += Extend(utype, abd) + ";"; } else { s += Extend(typestr, abd) + ";"; } break; } after: def OP_ABDL : Op<(cast "R", (call "vmovl", (cast $p0, "U", (call "vabd", $p0, $p1))))>; As an example of what happens if you do something wrong now, here's what happens if you make $p0 unsigned before the call to "vabd" - that is, $p0 -> (cast "U", $p0): arm_neon.td:574:1: error: No compatible intrinsic found - looking up intrinsic 'vabd(uint8x8_t, int8x8_t)' Available overloads: - float64x2_t vabdq_v(float64x2_t, float64x2_t) - float64x1_t vabd_v(float64x1_t, float64x1_t) - float64_t vabdd_f64(float64_t, float64_t) - float32_t vabds_f32(float32_t, float32_t) ... snip ... This makes it seriously easy to work out what you've done wrong in fairly nasty intrinsics. As part of this I've massively beefed up the documentation in arm_neon.td too. Things still to do / on the radar: - Testcase generation. This was implemented in the previous version and not in the new one, because - Autogenerated tests are not being run. The testcase in test/ differs from the autogenerated version. - There were a whole slew of special cases in the testcase generation that just felt (and looked) like hacks. If someone really feels strongly about this, I can try and reimplement it too. - Big endian. That's coming soon and should be a very small diff on top of this one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211101 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 11, 2014
-
-
Richard Smith authored
preferred-alignment transformations. Corrects alignof(T[]) to return alignof(T) in all cases, as required by relevant standards. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210609 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 05, 2014
-
-
Renato Golin authored
This patch adds support for pointer types in global named registers variables. It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls. Also adds some early checks on types on SemaDecl to avoid the assert. Tests changed accordingly. (PR19837) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210274 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 04, 2014
-
-
Richard Smith authored
to the normal non-placement ::operator new and ::operator delete, but allow optimizations like new-expressions and delete-expressions do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210137 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 03, 2014
-
-
Rafael Espindola authored
Aliases in llvm now hold an arbitrary expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210063 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 31, 2014
-
-
Jordan Rose authored
This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209966 91177308-0d34-0410-b5e6-96231b3b80d8
-