summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Assert that the name of some internal variables start with \01L or \01l.Rafael Espindola2014-02-271-47/+55
| | | | | | | No functionality change. This is just an intermediate patch for changing those global variables to use private linkage. llvm-svn: 202409
* [OPENMP] First changes for Parsing and Sema for 'omp simd' directive supportAlexey Bataev2014-02-2711-38/+167
| | | | llvm-svn: 202360
* [-Wunreachable-code] Don't warn about trivially unreachable return ↵Ted Kremenek2014-02-271-4/+57
| | | | | | statements preceded by 'noreturn' functions. llvm-svn: 202352
* [-Wunreachable-code] Don't warn about unreachable 'default:' cases.Ted Kremenek2014-02-271-0/+6
| | | | | | They are covered by -Wcovered-switch-default. llvm-svn: 202349
* [ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis2014-02-275-48/+38
| | | | | | | | | | | | | | | ASTUnit::getMainBufferWithPrecompiledPreamble(). With r197755 we started reading the contents of buffer file entries, but the buffers may point to ASTReader blobs that have been disposed. Fix this by having the CompilerInstance object keep a reference to the ASTReader as well as having the ASTContext keep reference to the ExternalASTSource. This was very difficult to construct a test case for. rdar://16149782 llvm-svn: 202346
* As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a ↵Nick Lewycky2014-02-271-0/+1
| | | | | | crasher, PR18983. llvm-svn: 202340
* Pass down the debug emission kind into the compile unit for codeEric Christopher2014-02-271-4/+6
| | | | | | | generation purposes. Paired with a commit to llvm. llvm-svn: 202334
* [MS ABI] Error instead of generating bad vftables for certain virtual ↵Hans Wennborg2014-02-271-0/+37
| | | | | | | | | | | hierarchies (PR18967) Erroring out until we fix the bug means we don't have to keep chasing down this same miscompile in a bunch of different places. Differential Revision: http://llvm-reviews.chandlerc.com/D2890 llvm-svn: 202331
* Fix -Wunused-variable in non-assert builds. No functionality change.Nick Lewycky2014-02-271-0/+1
| | | | llvm-svn: 202330
* Add a 'use-external-names' option to VFS overlay filesBen Langmuir2014-02-271-15/+46
| | | | | | | | | | | | | | | | When true, sets the name of the file to be the name from 'external-contents'. Otherwise, you get the virtual path that the file was looked up by. This will not affect any non-virtual paths, or fully virtual paths (for which there is no reasonable 'external' name anyway). The setting is available globally, but can be overriden on a per-file basis. The goal is that this setting will control which path you see in debug info, diagnostics, etc. which are sensitive to which path is used. That will come in future patches that pass the name through to FileManager. llvm-svn: 202329
* [-Wunreachable-code] Prune out unreachable warnings where a 'break' is ↵Ted Kremenek2014-02-271-7/+43
| | | | | | | | | | | | | | | preceded by a call to a 'noreturn' function. For example: unreachable(); break; This code is idiomatic and defensive. The fact that 'break' is unreachable here is not interesting. This occurs frequently in LLVM/Clang itself. llvm-svn: 202328
* [CFG] encode unreachable block information for would-have-been successors ↵Ted Kremenek2014-02-271-1/+1
| | | | | | for calls to 'noreturn' functions. llvm-svn: 202327
* [CFG] Encode unreachable block information for successors when visiting 'if' ↵Ted Kremenek2014-02-271-3/+4
| | | | | | statements. llvm-svn: 202326
* Rework CFG edges to encode potentially unreachable edges, instead of just ↵Ted Kremenek2014-02-273-6/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | making them NULL. This is to support some analyses, like -Wunreachable-code, that will need to recover the original unprunned CFG edges in order to suppress issues that aren't really bugs in practice. There are two important changes here: - AdjacentBlock replaces CFGBlock* for CFG successors/predecessors. This has the size of 2 pointers, instead of 1. This is unlikely to have a significant memory impact on Sema since a single CFG usually exists at one time, but could impact the memory usage of the static analyzer. This could possibly be optimized down to a single pointer with some cleverness. - Predecessors can now contain null predecessors, which means some analyses doing a reverse traversal will need to take into account. This already exists for successors, which contain successor slots for specific branch kinds (e.g., 'if') that expect a fixed number of successors, even if a branch is not reachable. llvm-svn: 202325
* PR18962: Fix "Unable to find record layout information for type"Reid Kleckner2014-02-271-2/+5
| | | | | | | | | | | | | | | | | | | Clang is using llvm::StructType::isOpaque() as a way of signaling if we've finished record type conversion in CodeGenTypes::isRecordLayoutComplete(). However, Clang was setting the body of the type before it finished laying out the type as a base type. Laying out the %class.C.base LLVM type attempts to convert more types, eventually recursively attempting to layout 'C' again, at which point we would say that layout was complete, even though we were still in the middle of it. By not setting the body, we correctly signal that layout is not complete, and things work as expected. At some point, it might be worth refactoring this to avoid looking at the LLVM IR types under construction. llvm-svn: 202320
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-268-83/+81
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* Refactor linkage computation in CGObjCMac.cpp.Rafael Espindola2014-02-263-73/+71
| | | | | | | | | | | | | | Before this patch the globals were created with the wrong linkage and patched afterwards. From the comments it looks like something would complain about having an internal GV with no initializer. At least in clang the verifier will only run way after we set the initializer, so that is not a problem. This patch should be a nop. It just figures out the linkage earlier and converts the old calls to setLinkage to asserts. The only case where that is not possible is when we first see a weak import that is then implemented. In that case we have to change the linkage, but that is the only setLinkage left. llvm-svn: 202305
* Sema: Definition of dllimport globals is not allowedNico Rieck2014-02-262-9/+7
| | | | | | | Upgrades the warning to an error and clarifies the message by treating the definition as error instead of the attribute. llvm-svn: 202300
* AArch64: use less cluttered intrinsic for vtbl/vtbxTim Northover2014-02-261-6/+2
| | | | | | | The table is always 128-bit so there's no reason to specify it every time we want the intrinsic. llvm-svn: 202259
* Fix typoTobias Grosser2014-02-261-1/+1
| | | | llvm-svn: 202254
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-2622-52/+34
| | | | llvm-svn: 202238
* [CMake] Apply DEPENDS intrinsics_gen in clangCodeGen.NAKAMURA Takumi2014-02-261-0/+3
| | | | llvm-svn: 202237
* 80-col and bad line ending fixups.Eric Christopher2014-02-261-8/+8
| | | | llvm-svn: 202219
* PR16074, implement warnings to catch pointer to boolean true and pointer toRichard Trieu2014-02-262-33/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | null comparison when the pointer is known to be non-null. This catches the array to pointer decay, function to pointer decay and address of variables. This does not catch address of function since this has been previously used to silence a warning. Pointer to bool conversion is under -Wbool-conversion. Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group of -Wtautological-compare. void foo() { int arr[5]; int x; // warn on these conditionals if (foo); if (arr); if (&x); if (foo == null); if (arr == null); if (&x == null); if (&foo); // no warning } llvm-svn: 202216
* [analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.Jordan Rose2014-02-261-1/+3
| | | | | | | | | For now, just ignore them. Later, we could try looking through LazyCompoundVals, but we at least shouldn't crash. <rdar://problem/16153464> llvm-svn: 202212
* Add -Wabsolute-value, warnings about absolute value functions.Richard Trieu2014-02-261-0/+325
| | | | | | | | | | | | | | | | | | The warnings fall into three groups. 1) Using an absolute value function of the wrong type, for instance, using the int absolute value function when the argument is a floating point type. 2) Using the improper sized absolute value function, for instance, using abs when the argument is a long long. llabs should be used instead. From these two cases, an implicit conversion will occur which may cause unexpected behavior. Where possible, suggest the proper absolute value function to use, and which header to include if the function is not available. 3) Taking the absolute value of an unsigned value. In addition to this warning, suggest to remove the function call. This usually indicates a logic error since the programmer assumed negative values would have been possible. llvm-svn: 202211
* Address review comments for r202185, no functionality changes.Adrian Prantl2014-02-251-2/+3
| | | | llvm-svn: 202208
* Hoist culling of -Wunreachable-code from headers before we even run the ↵Ted Kremenek2014-02-251-6/+10
| | | | | | analysis. llvm-svn: 202200
* Debug info: Generate debug info for variadic functions.Adrian Prantl2014-02-251-0/+16
| | | | | | | | Paired commit with LLVM. rdar://problem/13690847 llvm-svn: 202185
* Pretty Printer: Print constexpr and ref qualifiers. Don't print return types ↵Benjamin Kramer2014-02-251-1/+15
| | | | | | on destructors. llvm-svn: 202181
* Pass the sparc architecture variant to the assembler.Roman Divacky2014-02-251-0/+5
| | | | llvm-svn: 202179
* clang-cl: use -fno-rtti by defaultHans Wennborg2014-02-251-0/+4
| | | | | | | Generating RTTI in the MS ABI is currently not supported, and the failures are confusing to users, so let's disable it by default for now. llvm-svn: 202178
* Give sparcv9 the ability to set the target cpu. Change it from acceptingRoman Divacky2014-02-252-1/+18
| | | | | | | -march which doesnt exist on sparc gcc to -mcpu. While here adjust a few tests to not write an unused temporary file. llvm-svn: 202177
* Add a driver option -ivfsoverlayBen Langmuir2014-02-253-1/+31
| | | | | | | Reads the description of a virtual filesystem from a file and overlays it over the real file system. llvm-svn: 202176
* MS ABI: Just use getTypeInfoInChars to get the field sizeReid Kleckner2014-02-251-10/+4
| | | | | | | | | | | | This was changed to use manual desugaring and multiplication in r201832 and fixed for multi-dimensional arrays in r201917. However, it breaks down in the presence of typedefs. Rather than attempting to handle all the desugaring, just go back to calling the generic type info code. This was discovered while compiling SIInstrWaits.cpp in the R600 backend. llvm-svn: 202175
* Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."Benjamin Kramer2014-02-253-4/+14
| | | | | | There were many additional tests that had the bad behavior baked in. llvm-svn: 202174
* Revert "Pretty Printer: Fix printing of conversion operator decls and calls."Rafael Espindola2014-02-253-14/+4
| | | | | | | | This reverts commit r202167. It broke Analysis/auto-obj-dtors-cfg-output.cpp llvm-svn: 202173
* Update for llvm api change.Rafael Espindola2014-02-251-3/+3
| | | | llvm-svn: 202170
* Pretty Printer: Fix printing of conversion operator decls and calls.Benjamin Kramer2014-02-253-4/+14
| | | | | | | | | | | | | - Don't emit anything when we encounter a call to a conversion operator. "bar(a & b)" instead of "bar(a & b.operator int())" This preserves the semantics and is still idempotent if we print the AST multiple times. - Properly print declarations of conversion operators. "explicit operator bool();" instead of "bool operator _Bool();" PR18776. llvm-svn: 202167
* AArch64: use different type modifier in arm_neon.tdTim Northover2014-02-251-2/+2
| | | | | | | | | The 'f' modifier is designed for integer type arguments really (according to its documentation). It's better to use the "half width, same number" modifier. Should be no user-visible change. llvm-svn: 202152
* Add AArch64 big endian Target (aarch64_be)Christian Pirker2014-02-258-10/+67
| | | | llvm-svn: 202151
* Respect ToolChain::isPIEDefault() in constructing link job on Linux and FreeBSD.Alexey Samsonov2014-02-253-10/+17
| | | | | | Partially based on http://llvm-reviews.chandlerc.com/D2644 by Viktor Kutuzov. llvm-svn: 202150
* Factor adding sanitizer linker flags into a separate function and make it ↵Alexey Samsonov2014-02-251-62/+63
| | | | | | less OS-specific llvm-svn: 202148
* Sema: When merging objc string literals, give the result a constant array type.Benjamin Kramer2014-02-252-4/+11
| | | | | | | | Also assert that we never create non-array string literals again. PR18939. llvm-svn: 202147
* RewriteObjC: Factor string literal creation into a helper and make sure it ↵Benjamin Kramer2014-02-252-85/+36
| | | | | | | | gets a proper constant array type. No change in output. llvm-svn: 202146
* Fix for Bug 18536 - Bad alignment in clang/AST/StmpOpenMP.hAlexey Bataev2014-02-251-19/+25
| | | | llvm-svn: 202141
* IRGen: Remove a stale commentDavid Majnemer2014-02-251-1/+1
| | | | | | | This comment survived the transition from ForceInline to InlineAlways, fix it. llvm-svn: 202133
* Attr: Remove ForceInlineDavid Majnemer2014-02-253-8/+3
| | | | | | | | | | The __forceinline keyword's semantics are now recast as AlwaysInline and the kw___forceinline token has its language mode set for KEYMS. This preserves the semantics of the previous implementation but with less duplication of code. llvm-svn: 202131
* Remove dead assignment reported by Gautier DI FOLCO.Ted Kremenek2014-02-251-1/+0
| | | | llvm-svn: 202115
* Allow multi-component paths in VFS file nodesBen Langmuir2014-02-251-20/+31
| | | | | | | | | | | | | | | | This allows the 'name' field to contain a path, like { 'type': 'directory', 'name': '/path/to/dir', 'contents': [ ... ] } which not only simplifies reading and writing these files (for humans), but makes it possible to easily modify locations via textual replacement, which would not have worked in the old scheme. E.g. sed s:<ROOT>:<NEW ROOT> llvm-svn: 202109
OpenPOWER on IntegriCloud