summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Headers: be a bit more careful about inline asmSaleem Abdulrasool2014-06-251-0/+12
| | | | | | | | | Conditionally include x86intrin.h if we are building for x86 or x86_64. Conditionalise definition of inline assembly routines which use x86 or x86_64 inline assembly. This is needed as clang can target Windows on ARM where these definitions may be included into user code. llvm-svn: 211716
* Rename loop unrolling and loop vectorizer metadata to have a common prefix.Eli Bendersky2014-06-253-13/+13
| | | | | | | | | | | | | | | | | | | [Clang part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. llvm-svn: 211712
* Align with new GCC options for x86 AndroidAlexey Volkov2014-06-251-2/+6
| | | | | | | | | 32-bit: +ssse3 64-bit: +sse4.2 +popcnt Differential Revision: http://reviews.llvm.org/D4287 llvm-svn: 211688
* [OPENMP] Initial support for 'sections' directive.Alexey Bataev2014-06-2513-5/+128
| | | | llvm-svn: 211685
* AST: Initialization with dllimport functions in CDavid Majnemer2014-06-251-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 211677
* [OPENMP] OMPSimdDirective and OMPForDirective: added initialization for ↵Alexey Bataev2014-06-252-27/+32
| | | | | | CollapsedNum member. llvm-svn: 211672
* Don't go through the TypeSourceInfo when getting the SourceRange.Zachary Turner2014-06-251-3/+3
| | | | | | | | | | | | VarDecl provides a method getSourceRange(), which provides a more robust way of getting the SourceRange since the TypeSourceInfo can be null in certain cases. Reviewed by: majnemer Differential Revision: http://reviews.llvm.org/D4281 llvm-svn: 211667
* [Driver] Follow-up to r211598, r211663. Do not build a dynamic linkerSimon Atanasyan2014-06-251-6/+6
| | | | | | path using sub-strings concatenation. Return the whole string explicitly. llvm-svn: 211665
* Tools.cpp: Update getLinuxDynamicLinker() to return Twine instead of ↵NAKAMURA Takumi2014-06-251-3/+3
| | | | | | StringRef, since r211598 has introduced manipulation of return string. llvm-svn: 211663
* Reformat.NAKAMURA Takumi2014-06-251-3/+3
| | | | llvm-svn: 211661
* [OPENMP] Improved code and replaced struct by lambda.Alexey Bataev2014-06-251-18/+12
| | | | llvm-svn: 211660
* Implement predefined stdint macrosJF Bastien2014-06-252-8/+129
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* Fix parsing nested __if_exists blocksReid Kleckner2014-06-251-6/+8
| | | | | | | | | | | Rather than having kw___if_exists be a special case of ParseCompoundStatementBody, we can look for kw___if_exists in the big switch over for valid statement tokens in ParseStatementOrDeclaration. Nested __if_exists blocks are used in the DECLARE_REGISTRY_RESOURCEID macro from atlcom.h. llvm-svn: 211654
* MS ABI: Ignore dll attributes on partial template specializationsHans Wennborg2014-06-241-0/+7
| | | | llvm-svn: 211648
* Merge handleDLLImportAttr and handleDLLExportAttr into one function.Hans Wennborg2014-06-241-13/+6
| | | | llvm-svn: 211647
* Provide a better diagnostic when braces are put before the identifier.Richard Trieu2014-06-241-6/+116
| | | | | | | | | | | | | | | | | When a user types: int [4] foo; assume that the user means: int foo[4]; Update the information for 'foo' to prevent additional errors, and provide a fix-it hint to move the brackets to the correct location. Additionally, suggest parens for types that require it, such as: int [4] *foo; to: int (*foo)[4]; llvm-svn: 211641
* Add R600 builtin codegen.Matt Arsenault2014-06-243-3/+48
| | | | llvm-svn: 211631
* Correctly Load Mixed FP-GP Variadic Arguments for x86-64.Rafael Espindola2014-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | According to the x86-64 ABI, structures with both floating point and integer members are split between floating-point and general purpose registers, and consecutive 32-bit floats can be packed into a single floating point register. In the case of variadic functions these are stored to memory and the position recorded in the va_list. This was already correctly implemented in llvm.va_start. The problem is that the code in clang for implementing va_arg was reading floating point registers from the wrong location. Patch by Thomas Jablin. Fixes PR20018. llvm-svn: 211626
* Use appropriate default PIE settings for OpenBSD.Brad Smith2014-06-241-0/+21
| | | | llvm-svn: 211624
* Add directory_iterator for (non-recursive) iteration of VFS directoriesBen Langmuir2014-06-241-7/+191
| | | | | | | | The API is based on sys::fs::directory_iterator, but it allows iterating over overlays and the yaml-based VFS. For now, it isn't used by anything (except its tests). llvm-svn: 211623
* [Driver][Mips] Support mips64-linux-gnuabi64 / mips64el-linux-gnuabi64 ↵Simon Atanasyan2014-06-241-2/+40
| | | | | | | | | target triples. The patch fixes the bug #19869. http://llvm.org/bugs/show_bug.cgi?id=19869 llvm-svn: 211619
* Objective-C. When we use @selector(save:), etc. there may be more Fariborz Jahanian2014-06-242-12/+27
| | | | | | | | | | | | | than one method with mismatched type of same selector name. clang issues a warning to point this out since it may cause undefined behavior. There are cases though that some APIs don't care about user methods and such warnings are perceived as noise. This patch allows users to add paren delimiters around selector name to turn off such warnings. So, @selector((save:)) will turn off the warning. It also provides 'fixit' so user knows what to do. // rdar://16458579 llvm-svn: 211611
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-243-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 llvm-svn: 211610
* Allow static_assert inside an anonymous union; fixes PR20021 as well as ↵Aaron Ballman2014-06-241-0/+2
| | | | | | implements C++ Issue 1940. llvm-svn: 211606
* Use lowercase windows.h for mingw cross compilation.Logan Chien2014-06-241-1/+1
| | | | llvm-svn: 211604
* Fix "warning: fallthrough annotation does not directly precede switch label" ↵Alexander Kornienko2014-06-241-0/+3
| | | | | | | | | | | | | | | | in lambdas. Summary: This patch fixes http://llvm.org/PR17864 - "warning: fallthrough annotation does not directly precede switch label" in lambdas. Reviewers: rsmith Reviewed By: rsmith Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D4258 llvm-svn: 211599
* [mips] Correct linux dynamic linker for -mnan=2008Daniel Sanders2014-06-242-5/+25
| | | | | | | | | | | | Summary: The dynamic linker is named ld-linux-mipsn8.so.1 when -mnan=2008 is given (or is the default). It remains ld.so.1 for other cases. This is necessary for MIPS32r6/MIPS64r6 since these ISA's default to -mnan=2008. Differential Revision: http://reviews.llvm.org/D4273 llvm-svn: 211598
* [OPENMP] Additional checking for 'collapse' clause.Alexey Bataev2014-06-241-9/+42
| | | | llvm-svn: 211589
* ARM: remove dead CodeGen functions.Tim Northover2014-06-242-33/+0
| | | | | | These two are no longer being used by NEON codegen. llvm-svn: 211586
* clang-format: Understand that breaking before lambdas is fine.Daniel Jasper2014-06-241-1/+1
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([]( const aaaaaaaaaa &a) { return a; }); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( [](const aaaaaaaaaa &a) { return a; }); llvm-svn: 211575
* Driver: Restore proper naming of crashdump filesJustin Bogner2014-06-241-1/+2
| | | | | | Based on a review of r211411 by Jordan Rose. llvm-svn: 211572
* AST: Address of dllimport functions isn't constantDavid Majnemer2014-06-241-1/+4
| | | | | | | | | | | | | | | | The address of dllimport functions can be accessed one of two ways: - Through the IAT which is symbolically referred to with a symbol starting with __imp_. - Via the wrapper-function which ends up calling through the __imp_ symbol. The problem with using the wrapper-function is that it's address will not compare as equal in all translation units. Specifically, it will compare unequally with the translation unit which defines the function. This fixes PR19955. llvm-svn: 211570
* AST: Address of dllimport variables isn't constantDavid Majnemer2014-06-241-0/+3
| | | | | | | | | | | | | The address of dllimport variables isn't something that can be meaningfully used in a constexpr context and isn't suitable for evaluation at load-time. They require loads from memory to properly evaluate. This fixes PR19955. Differential Revision: http://reviews.llvm.org/D4250 llvm-svn: 211568
* [OPENMP] Added initial checking of nesting of OpenMP regions.Alexey Bataev2014-06-241-3/+49
| | | | llvm-svn: 211566
* Propagate isAddressOfMember into typo correction so that we don't correct ↵Nick Lewycky2014-06-233-7/+36
| | | | | | &qualified-id into &unqualified-id. Also make sure to set the naming class when we find the qualified-id in a different class than the nested name specifier specified so far. Fixes PR19681! llvm-svn: 211551
* Fix spelling. s/overloaed/overloaded/Jim Grosbach2014-06-231-2/+2
| | | | llvm-svn: 211530
* CodeGen: Remove a stray tab character (NFC)Justin Bogner2014-06-231-1/+1
| | | | llvm-svn: 211528
* Driver: correct behaviour of -fmsc-version=MAJORSaleem Abdulrasool2014-06-231-1/+5
| | | | | | | | | Ensure that we properly handle the case where just the major version component is provided by the user. Thanks to Alp Toker for pointing out that this was not handled correctly! llvm-svn: 211506
* Stop sharing the FileManager in ASTUnit::ParseBen Langmuir2014-06-231-1/+7
| | | | | | | | | | We were using old stat values for any files that had previously been looked up, leading to badness. There might be a more elegant solution in invalidating the cache for those file (since we already know which ones they are), but it seems too likely there are existing references to them hiding somewhere. llvm-svn: 211504
* [OPENMP] Reformatting and code improvement.Alexey Bataev2014-06-231-10/+7
| | | | llvm-svn: 211489
* clang-format: [proto] Add required space before absolute references.Daniel Jasper2014-06-231-0/+4
| | | | llvm-svn: 211488
* clang-format: Fix corner case in pointer/reference detection.Daniel Jasper2014-06-231-0/+2
| | | | llvm-svn: 211487
* Parse: Simplify construction of the clobber listDavid Majnemer2014-06-231-4/+1
| | | | | | | | This avoids going over the clobber list twice. No functionality change. llvm-svn: 211485
* StaticAnalyzer: Switch a loop to a range-based forDavid Majnemer2014-06-231-3/+2
| | | | | | Merely a code simplification, no functionality change. llvm-svn: 211484
* DiagnosticIDs: use diagnostic severities to simplify extension handlingAlp Toker2014-06-225-30/+13
| | | | llvm-svn: 211479
* Driver: Skip the -ivfsoverlay argument in driver crash diagsJustin Bogner2014-06-221-1/+1
| | | | llvm-svn: 211474
* Revert "Revert r211402 (and r211408,r211410), "CodeGen: Refactor ↵David Majnemer2014-06-224-366/+427
| | | | | | | | | dynamic_cast and typeid" It crashes msvc codegen in clang/test/SemaCXX/undefined-internal.cpp." This reverts commit r211467 which reverted r211408,r211410, it caused crashes in test/SemaCXX/undefined-internal.cpp for i686-win32 targets. llvm-svn: 211473
* Revert r211402 (and r211408,r211410), "CodeGen: Refactor dynamic_cast and ↵NAKAMURA Takumi2014-06-224-430/+366
| | | | | | | | | | typeid" It crashes msvc codegen in clang/test/SemaCXX/undefined-internal.cpp. It is reproducible with: $ clang -cc1 -triple i686-win32 -emit-llvm-only clang/test/SemaCXX/undefined-internal.cpp llvm-svn: 211467
* TextDiagnosticPrinter: use the mapped level for remark flag computationAlp Toker2014-06-222-6/+1
| | | | | | | | | Custom diagnostics don't have a builtin class so this wouldn't have worked. Reduces surface area of remark-related changes. No test coverage. llvm-svn: 211462
* Enable WindowsToolChain on all native Windows buildsAlp Toker2014-06-221-7/+2
| | | | | | | | Make binaries built by MSVC, mingw and clang functionally equivalent. The checks are trivially performed at runtime to eliminate functional differences between supported configurations that used to be hard-coded. llvm-svn: 211461
OpenPOWER on IntegriCloud