Squelch leak found by LSan by handling missing switch case.

Also, use the enum type in the switch so this doesn't happen again.

PR19523

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207128 91177308-0d34-0410-b5e6-96231b3b80d8
[X86] Add Clang support for intrinsics __rdtsc and __rdtscp.

This patch:
 1. Adds a definition for two new GCCBuiltins in BuiltinsX86.def:
   __builtin_ia32_rdtsc;
   __builtin_ia32_rdtscp;

 2. Replaces the already existing definition of intrinsic __rdtsc in
    ia32intrin.h with a simple call to the new GCC builtin __builtin_ia32_rdtsc.

 3. Adds a definition for the new intrinsic __rdtscp in ia32intrin.h



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207132 91177308-0d34-0410-b5e6-96231b3b80d8
Intrin.h: remove __rdtsc and __rdtscp declarations

Since r207132, these are defined in ia32intrin.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207134 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a tiny test-only leak, found by LSan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207137 91177308-0d34-0410-b5e6-96231b3b80d8
MicrosoftVTableContext: Don't leak VPtrInfos. Found by LSan, PR19522.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207138 91177308-0d34-0410-b5e6-96231b3b80d8
If we see an explicit instantiation declaration or definition of a function
after we've already instantiated a definition for the function, pass it to the
ASTConsumer again so that it knows the specialization kind has changed and can
update the function's linkage.

This only matters if we instantiate the definition of the function before we
reach the end of the TU; this can happen in at least three different ways:
C++11 constexpr functions, C++14 deduced return types, and functions
instantiated within modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207152 91177308-0d34-0410-b5e6-96231b3b80d8
Reland r206934 with a hopefully fixed test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207155 91177308-0d34-0410-b5e6-96231b3b80d8
bindings: expose C++ access specifiers

Expose the enum CX_CXXAccessSpecifier in the python bindings as a property of
the cursor.  If access specifier is not applicable to the node, return the
INVALID specifier rather than raising an exception.

Patch by Tamás Szeli!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207173 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Avoid instrumenting implicit Decls more effectively

We don't assign counters for implicit Decls, but we were emitting code
to increment the (non-existent) counters and adding empty counter
lists in the output. This fixes the checks in assignRegionCounters and
emitInstrumentationData to do the right thing, and adds an assert for
the pathological case of emitting zero counters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207203 91177308-0d34-0410-b5e6-96231b3b80d8
fix a test-only leak found by lsan, PR19521

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207223 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Reland r206934 with a hopefully fixed test"

This reverts commit r207155.
The test was still failing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207225 91177308-0d34-0410-b5e6-96231b3b80d8
Improve ownership of ASTUnits in libTooling by using std::unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207229 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: pass -debug flag to the linker when compiling with debug info

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207233 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: /fallback only applies to C or C++ files

We would previously hit an assert if using /fallback with an .ll file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207234 91177308-0d34-0410-b5e6-96231b3b80d8
Push unique_ptr ownership of ASTUnits further back into their factories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207237 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Refactor linkage/visibility calculation

It turns out that linkage and visibility have rather similar logic for
both functions and non-variable globals.  Split the calculation out so
that both sides may share this code.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207239 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Cleanup variable linkage calculation

Almost all linkage calculation for VarDecls occured inside of
GetLLVMLinkageVarDefinition except for static data members.  Centralize
the logic so that it can be more readily reused.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207241 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: replace use of @llvm.arm.sevl with @llvm.arm.hint

Use the new generic @llvm.arm.hint hint intrinsic rather than the specialised
@llvm.arm.sevl hint instruction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207243 91177308-0d34-0410-b5e6-96231b3b80d8
PR19558: don't produce an "unused variable" warning for a variable template partial specialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207260 91177308-0d34-0410-b5e6-96231b3b80d8
Fix leak of GlobalModuleIndex::IdentifierIndex, found by LSan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207262 91177308-0d34-0410-b5e6-96231b3b80d8