summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2012-02-06 20:47:31 +0000
committerAaron Ballman <aaron@aaronballman.com>2012-02-06 20:47:31 +0000
commitfd8fed902dee1cd2a4cab793b80280550e476668 (patch)
tree6c983bfff1d82b7fe6def7409d959f7bcff93514 /utils
parentb822f72c708e235a135fcaf9eb1dba8c20c6a680 (diff)
Added MSVC visualizers for PointerIntPair and PointerUnions.
Patch by Nikola Smiljanic git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/clangVisualizers.txt92
1 files changed, 91 insertions, 1 deletions
diff --git a/utils/clangVisualizers.txt b/utils/clangVisualizers.txt
index f9f834b76c..a5a8ee6039 100644
--- a/utils/clangVisualizers.txt
+++ b/utils/clangVisualizers.txt
@@ -41,4 +41,94 @@ llvm::StringRef{
clang::Token{
preview((clang::tok::TokenKind)(int)$e.Kind)
-} \ No newline at end of file
+}
+
+PointerIntPair<*,*,*,*>{
+ preview (
+ #(
+ ($T1*)($e.Value & PointerBitMask),
+ " [",
+ ($T3)(($e.Value >> IntShift) & IntMask),
+ "]"
+ )
+ )
+
+ children (
+ #(
+ #([ptr] : ($T1*)($e.Value & PointerBitMask)),
+ #([int] : ($T3)($e.Value >> IntShift) & IntMask)
+ )
+ )
+}
+
+PointerUnion<*,*>{
+ preview (
+ #if ((($e.Val.Value >> $e.Val.IntShift) & $e.Val.IntMask) == 0) (
+ "PT1"
+ ) #else (
+ "PT2"
+ )
+ )
+
+ children (
+ #(
+ #if ((($e.Val.Value >> $e.Val.IntShift) & $e.Val.IntMask) == 0) (
+ #([ptr] : ($T1)($e.Val.Value & $e.Val.PointerBitMask))
+ ) #else (
+ #([ptr] : ($T2)($e.Val.Value & $e.Val.PointerBitMask))
+ )
+ )
+ )
+}
+
+PointerUnion3<*,*,*>{
+ preview (
+ #if (($e.Val.Val.Value & 0x2) == 2) (
+ "PT2"
+ ) #elif (($e.Val.Val.Value & 0x1) == 1) (
+ "PT3"
+ ) #else (
+ "PT1"
+ )
+ )
+
+ children (
+ #(
+ #if (($e.Val.Val.Value & 0x2) == 2) (
+ #([ptr] : ($T2)(($e.Val.Val.Value >> 2) << 2))
+ ) #elif (($e.Val.Val.Value & 0x1) == 1) (
+ #([ptr] : ($T3)(($e.Val.Val.Value >> 2) << 2))
+ ) #else (
+ #([ptr] : ($T1)(($e.Val.Val.Value >> 2) << 2))
+ )
+ )
+ )
+}
+
+PointerUnion4<*,*,*,*>{
+ preview (
+ #if (($e.Val.Val.Value & 0x3) == 3) (
+ "PT4"
+ ) #elif (($e.Val.Val.Value & 0x2) == 2) (
+ "PT2"
+ ) #elif (($e.Val.Val.Value & 0x1) == 1) (
+ "PT3"
+ ) #else (
+ "PT1"
+ )
+ )
+
+ children (
+ #(
+ #if (($e.Val.Val.Value & 0x3) == 3) (
+ #([ptr] : ($T4)(($e.Val.Val.Value >> 2) << 2))
+ ) #elif (($e.Val.Val.Value & 0x2) == 2) (
+ #([ptr] : ($T2)(($e.Val.Val.Value >> 2) << 2))
+ ) #elif (($e.Val.Val.Value & 0x1) == 1) (
+ #([ptr] : ($T3)(($e.Val.Val.Value >> 2) << 2))
+ ) #else (
+ #([ptr] : ($T1)(($e.Val.Val.Value >> 2) << 2))
+ )
+ )
+ )
+}