#endif
#undef MACRO
#if defined(MACRO)
-#endif\r
-#define FUNCMACRO(ARG1) ARG1\r
+#endif
+#define FUNCMACRO(ARG1) ARG1
int j = FUNCMACRO(1);
-#define X X_IMPL(a+y,b) X_IMPL2(c)\r
-#define X_IMPL(p1,p2)\r
-#define X_IMPL2(p1)\r
-X\r
-\r
-// CHECK: ---\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: __STDC__\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: __STDC_HOSTED__\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: __cplusplus\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: __STDC_UTF_16__\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: __STDC_UTF_32__\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: MACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroExpands\r
-// CHECK-NEXT: MacroNameTok: MACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9"]\r
-// CHECK-NEXT: Args: (null)\r
-// CHECK-NEXT: - Callback: Defined\r
-// CHECK-NEXT: MacroNameTok: MACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:19"]\r
-// CHECK-NEXT: - Callback: If\r
-// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"\r
-// CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:4", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:6:1"]\r
-// CHECK-NEXT: ConditionValue: CVK_True\r
-// CHECK-NEXT: - Callback: Endif\r
-// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:6:2"\r
-// CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"\r
-// CHECK-NEXT: - Callback: MacroUndefined\r
-// CHECK-NEXT: MacroNameTok: MACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: Defined\r
-// CHECK-NEXT: MacroNameTok: MACRO\r
-// CHECK-NEXT: MacroDirective: (null)\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:19"]\r
-// CHECK-NEXT: - Callback: If\r
-// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"\r
-// CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:4", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:1"]\r
-// CHECK-NEXT: ConditionValue: CVK_False\r
-// CHECK-NEXT: - Callback: Endif\r
-// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"\r
-// CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"\r
-// CHECK-NEXT: - Callback: SourceRangeSkipped\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"]\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: FUNCMACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroExpands\r
-// CHECK-NEXT: MacroNameTok: FUNCMACRO\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:20"]\r
-// CHECK-NEXT: Args: [1]\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: X\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: X_IMPL\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroDefined\r
-// CHECK-NEXT: MacroNameTok: X_IMPL2\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: - Callback: MacroExpands\r
-// CHECK-NEXT: MacroNameTok: X\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1"]\r
-// CHECK-NEXT: Args: (null)\r
-// CHECK-NEXT: - Callback: MacroExpands\r
-// CHECK-NEXT: MacroNameTok: X_IMPL\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: [(nonfile), (nonfile)]\r
-// CHECK-NEXT: Args: [a <plus> y, b]\r
-// CHECK-NEXT: - Callback: MacroExpands\r
-// CHECK-NEXT: MacroNameTok: X_IMPL2\r
-// CHECK-NEXT: MacroDirective: MD_Define\r
-// CHECK-NEXT: Range: [(nonfile), (nonfile)]\r
-// CHECK-NEXT: Args: [c]\r
-// CHECK-NEXT: - Callback: EndOfMainFile\r
-// CHECK-NEXT: ...\r
+#define X X_IMPL(a+y,b) X_IMPL2(c)
+#define X_IMPL(p1,p2)
+#define X_IMPL2(p1)
+X
+
+// CHECK: ---
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: __STDC__
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: __STDC_HOSTED__
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: __cplusplus
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: __STDC_UTF_16__
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: __STDC_UTF_32__
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: MACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroExpands
+// CHECK-NEXT: MacroNameTok: MACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:4:9"]
+// CHECK-NEXT: Args: (null)
+// CHECK-NEXT: - Callback: Defined
+// CHECK-NEXT: MacroNameTok: MACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:19"]
+// CHECK-NEXT: - Callback: If
+// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"
+// CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:4", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:6:1"]
+// CHECK-NEXT: ConditionValue: CVK_True
+// CHECK-NEXT: - Callback: Endif
+// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:6:2"
+// CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:5:2"
+// CHECK-NEXT: - Callback: MacroUndefined
+// CHECK-NEXT: MacroNameTok: MACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: Defined
+// CHECK-NEXT: MacroNameTok: MACRO
+// CHECK-NEXT: MacroDirective: (null)
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:5", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:19"]
+// CHECK-NEXT: - Callback: If
+// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"
+// CHECK-NEXT: ConditionRange: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:4", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:1"]
+// CHECK-NEXT: ConditionValue: CVK_False
+// CHECK-NEXT: - Callback: Endif
+// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"
+// CHECK-NEXT: IfLoc: "{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2"
+// CHECK-NEXT: - Callback: SourceRangeSkipped
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:8:2", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:9:2"]
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: FUNCMACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroExpands
+// CHECK-NEXT: MacroNameTok: FUNCMACRO
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:9", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:11:20"]
+// CHECK-NEXT: Args: [1]
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: X
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: X_IMPL
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroDefined
+// CHECK-NEXT: MacroNameTok: X_IMPL2
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: - Callback: MacroExpands
+// CHECK-NEXT: MacroNameTok: X
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: ["{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1", "{{.*}}{{[/\\]}}pp-trace-macro.cpp:15:1"]
+// CHECK-NEXT: Args: (null)
+// CHECK-NEXT: - Callback: MacroExpands
+// CHECK-NEXT: MacroNameTok: X_IMPL
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: [(nonfile), (nonfile)]
+// CHECK-NEXT: Args: [a <plus> y, b]
+// CHECK-NEXT: - Callback: MacroExpands
+// CHECK-NEXT: MacroNameTok: X_IMPL2
+// CHECK-NEXT: MacroDirective: MD_Define
+// CHECK-NEXT: Range: [(nonfile), (nonfile)]
+// CHECK-NEXT: Args: [c]
+// CHECK-NEXT: - Callback: EndOfMainFile
+// CHECK-NEXT: ...
-//===- clang-modernize/PerfSupportTest.cpp - PerfSupport unit tests -------===//\r
-//\r
-// The LLVM Compiler Infrastructure\r
-//\r
-// This file is distributed under the University of Illinois Open Source\r
-// License. See LICENSE.TXT for details.\r
-//\r
-//===----------------------------------------------------------------------===//\r
-\r
-#include "gtest/gtest.h"\r
-#include "Core/PerfSupport.h"\r
-\r
-using namespace llvm;\r
-using namespace clang;\r
-\r
-class TransformA : public Transform {\r
-public:\r
- TransformA(const TransformOptions &Options)\r
- : Transform("TransformA", Options) {}\r
-\r
- virtual int apply(const tooling::CompilationDatabase &,\r
- const std::vector<std::string> &) {\r
- return 0;\r
- }\r
-\r
- void addTiming(StringRef Label, TimeRecord Duration) {\r
- Transform::addTiming(Label, Duration);\r
- }\r
-};\r
-\r
-class TransformB : public Transform {\r
-public:\r
- TransformB(const TransformOptions &Options)\r
- : Transform("TransformB", Options) {}\r
-\r
- virtual int apply(const tooling::CompilationDatabase &,\r
- const std::vector<std::string> &) {\r
- return 0;\r
- }\r
-\r
- void addTiming(StringRef Label, TimeRecord Duration) {\r
- Transform::addTiming(Label, Duration);\r
- }\r
-};\r
-\r
-struct ExpectedResults {\r
- const char *SourceName;\r
- unsigned DataCount;\r
- struct Datum {\r
- const char *Label;\r
- float Duration;\r
- } Data[2];\r
-};\r
-\r
-TEST(PerfSupport, collectSourcePerfData) {\r
- TransformOptions Options;\r
- TransformA A(Options);\r
- TransformB B(Options);\r
- \r
- // The actual durations don't matter. Below only their relative ordering is\r
- // tested to ensure times, labels, and sources all stay together properly.\r
- A.addTiming("FileA.cpp", TimeRecord::getCurrentTime(/*Start=*/true));\r
- A.addTiming("FileC.cpp", TimeRecord::getCurrentTime(/*Start=*/true));\r
- B.addTiming("FileC.cpp", TimeRecord::getCurrentTime(/*Start=*/true));\r
- B.addTiming("FileB.cpp", TimeRecord::getCurrentTime(/*Start=*/true));\r
-\r
- SourcePerfData PerfData;\r
- collectSourcePerfData(A, PerfData);\r
-\r
- SourcePerfData::const_iterator FileAI = PerfData.find("FileA.cpp");\r
- EXPECT_NE(FileAI, PerfData.end());\r
- SourcePerfData::const_iterator FileCI = PerfData.find("FileC.cpp");\r
- EXPECT_NE(FileCI, PerfData.end());\r
- EXPECT_EQ(2u, PerfData.size());\r
-\r
- EXPECT_EQ(1u, FileAI->second.size());\r
- EXPECT_EQ("TransformA", FileAI->second[0].Label);\r
- EXPECT_EQ(1u, FileCI->second.size());\r
- EXPECT_EQ("TransformA", FileCI->second[0].Label);\r
- EXPECT_LE(FileAI->second[0].Duration, FileCI->second[0].Duration);\r
-\r
- collectSourcePerfData(B, PerfData);\r
-\r
- SourcePerfData::const_iterator FileBI = PerfData.find("FileB.cpp");\r
- EXPECT_NE(FileBI, PerfData.end());\r
- EXPECT_EQ(3u, PerfData.size());\r
-\r
- EXPECT_EQ(1u, FileAI->second.size());\r
- EXPECT_EQ("TransformA", FileAI->second[0].Label);\r
- EXPECT_EQ(2u, FileCI->second.size());\r
- EXPECT_EQ("TransformA", FileCI->second[0].Label);\r
- EXPECT_EQ("TransformB", FileCI->second[1].Label);\r
- EXPECT_LE(FileCI->second[0].Duration, FileCI->second[1].Duration);\r
- EXPECT_EQ(1u, FileBI->second.size());\r
- EXPECT_EQ("TransformB", FileBI->second[0].Label);\r
- EXPECT_LE(FileCI->second[1].Duration, FileBI->second[0].Duration);\r
-}\r
+//===- clang-modernize/PerfSupportTest.cpp - PerfSupport unit tests -------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "Core/PerfSupport.h"
+
+using namespace llvm;
+using namespace clang;
+
+class TransformA : public Transform {
+public:
+ TransformA(const TransformOptions &Options)
+ : Transform("TransformA", Options) {}
+
+ virtual int apply(const tooling::CompilationDatabase &,
+ const std::vector<std::string> &) {
+ return 0;
+ }
+
+ void addTiming(StringRef Label, TimeRecord Duration) {
+ Transform::addTiming(Label, Duration);
+ }
+};
+
+class TransformB : public Transform {
+public:
+ TransformB(const TransformOptions &Options)
+ : Transform("TransformB", Options) {}
+
+ virtual int apply(const tooling::CompilationDatabase &,
+ const std::vector<std::string> &) {
+ return 0;
+ }
+
+ void addTiming(StringRef Label, TimeRecord Duration) {
+ Transform::addTiming(Label, Duration);
+ }
+};
+
+struct ExpectedResults {
+ const char *SourceName;
+ unsigned DataCount;
+ struct Datum {
+ const char *Label;
+ float Duration;
+ } Data[2];
+};
+
+TEST(PerfSupport, collectSourcePerfData) {
+ TransformOptions Options;
+ TransformA A(Options);
+ TransformB B(Options);
+
+ // The actual durations don't matter. Below only their relative ordering is
+ // tested to ensure times, labels, and sources all stay together properly.
+ A.addTiming("FileA.cpp", TimeRecord::getCurrentTime(/*Start=*/true));
+ A.addTiming("FileC.cpp", TimeRecord::getCurrentTime(/*Start=*/true));
+ B.addTiming("FileC.cpp", TimeRecord::getCurrentTime(/*Start=*/true));
+ B.addTiming("FileB.cpp", TimeRecord::getCurrentTime(/*Start=*/true));
+
+ SourcePerfData PerfData;
+ collectSourcePerfData(A, PerfData);
+
+ SourcePerfData::const_iterator FileAI = PerfData.find("FileA.cpp");
+ EXPECT_NE(FileAI, PerfData.end());
+ SourcePerfData::const_iterator FileCI = PerfData.find("FileC.cpp");
+ EXPECT_NE(FileCI, PerfData.end());
+ EXPECT_EQ(2u, PerfData.size());
+
+ EXPECT_EQ(1u, FileAI->second.size());
+ EXPECT_EQ("TransformA", FileAI->second[0].Label);
+ EXPECT_EQ(1u, FileCI->second.size());
+ EXPECT_EQ("TransformA", FileCI->second[0].Label);
+ EXPECT_LE(FileAI->second[0].Duration, FileCI->second[0].Duration);
+
+ collectSourcePerfData(B, PerfData);
+
+ SourcePerfData::const_iterator FileBI = PerfData.find("FileB.cpp");
+ EXPECT_NE(FileBI, PerfData.end());
+ EXPECT_EQ(3u, PerfData.size());
+
+ EXPECT_EQ(1u, FileAI->second.size());
+ EXPECT_EQ("TransformA", FileAI->second[0].Label);
+ EXPECT_EQ(2u, FileCI->second.size());
+ EXPECT_EQ("TransformA", FileCI->second[0].Label);
+ EXPECT_EQ("TransformB", FileCI->second[1].Label);
+ EXPECT_LE(FileCI->second[0].Duration, FileCI->second[1].Duration);
+ EXPECT_EQ(1u, FileBI->second.size());
+ EXPECT_EQ("TransformB", FileBI->second[0].Label);
+ EXPECT_LE(FileCI->second[1].Duration, FileBI->second[0].Duration);
+}
SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T,
NamedChain, D->getChainingSize());
- for (const auto *Attr : D->attrs())\r
- IndirectField->addAttr(Attr->clone(SemaRef.Context));\r
+ for (const auto *Attr : D->attrs())
+ IndirectField->addAttr(Attr->clone(SemaRef.Context));
IndirectField->setImplicit(D->isImplicit());
IndirectField->setAccess(D->getAccess());
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s\r
-\r
-#pragma detect_mismatch("test", "1")\r
-\r
-#define BAR "2"\r
-#pragma detect_mismatch("test2", BAR)\r
-\r
-// CHECK: !llvm.module.flags = !{{{.*}}}\r
-// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}\r
-// CHECK: ![[link_opts]] = metadata !{metadata ![[test:[0-9]+]], metadata ![[test2:[0-9]+]]}\r
-// CHECK: ![[test]] = metadata !{metadata !"/FAILIFMISMATCH:\22test=1\22"}\r
-// CHECK: ![[test2]] = metadata !{metadata !"/FAILIFMISMATCH:\22test2=2\22"}\r
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+
+#pragma detect_mismatch("test", "1")
+
+#define BAR "2"
+#pragma detect_mismatch("test2", BAR)
+
+// CHECK: !llvm.module.flags = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: ![[link_opts]] = metadata !{metadata ![[test:[0-9]+]], metadata ![[test2:[0-9]+]]}
+// CHECK: ![[test]] = metadata !{metadata !"/FAILIFMISMATCH:\22test=1\22"}
+// CHECK: ![[test2]] = metadata !{metadata !"/FAILIFMISMATCH:\22test2=2\22"}
-// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -ffake-address-space-map -triple i686-pc-darwin | FileCheck %s\r
-\r
-typedef struct {\r
- int cells[9];\r
-} Mat3X3;\r
-\r
-typedef struct {\r
- int cells[16];\r
-} Mat4X4;\r
-\r
-Mat4X4 __attribute__((noinline)) foo(Mat3X3 in) {\r
- Mat4X4 out;\r
- return out;\r
-}\r
-\r
-kernel void ker(global Mat3X3 *in, global Mat4X4 *out) {\r
- out[0] = foo(in[1]);\r
-}\r
-\r
-// Expect two mem copies: one for the argument "in", and one for\r
-// the return value.\r
-// CHECK: call void @llvm.memcpy.p0i8.p1i8.i32(i8*\r
-// CHECK: call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)*\r
+// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -ffake-address-space-map -triple i686-pc-darwin | FileCheck %s
+
+typedef struct {
+ int cells[9];
+} Mat3X3;
+
+typedef struct {
+ int cells[16];
+} Mat4X4;
+
+Mat4X4 __attribute__((noinline)) foo(Mat3X3 in) {
+ Mat4X4 out;
+ return out;
+}
+
+kernel void ker(global Mat3X3 *in, global Mat4X4 *out) {
+ out[0] = foo(in[1]);
+}
+
+// Expect two mem copies: one for the argument "in", and one for
+// the return value.
+// CHECK: call void @llvm.memcpy.p0i8.p1i8.i32(i8*
+// CHECK: call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)*
-// RUN: %clang_cc1 -triple arm-apple-darwin -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s\r
-\r
-__attribute__((interrupt)) void Test(void);\r
-// CHECK: FunctionDecl{{.*}}Test\r
-// CHECK-NEXT: ARMInterruptAttr\r
+// RUN: %clang_cc1 -triple arm-apple-darwin -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s
+
+__attribute__((interrupt)) void Test(void);
+// CHECK: FunctionDecl{{.*}}Test
+// CHECK-NEXT: ARMInterruptAttr
-// RUN: %clang_cc1 -triple msp430-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s\r
-\r
-__attribute__((interrupt(12))) void Test(void);\r
-// CHECK: FunctionDecl{{.*}}Test\r
-// CHECK-NEXT: MSP430InterruptAttr\r
+// RUN: %clang_cc1 -triple msp430-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s
+
+__attribute__((interrupt(12))) void Test(void);
+// CHECK: FunctionDecl{{.*}}Test
+// CHECK-NEXT: MSP430InterruptAttr
-// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s\r
-\r
-void f(int i) __attribute__((format_arg(1)));\r
-// CHECK: attr-source-range.cpp:3:30:{3:41-3:42}{3:8-3:13}\r
-\r
-void g(int i, ...) __attribute__((format(printf, 1, 1)));\r
-// CHECK: attr-source-range.cpp:6:35:{6:50-6:51}{6:8-6:13}\r
-\r
-int h(void) __attribute__((returns_nonnull));\r
-// CHECK: attr-source-range.cpp:9:28:{9:1-9:4}\r
-\r
-void i(int j) __attribute__((nonnull(1)));\r
-// CHECK: attr-source-range.cpp:12:30:{12:38-12:39}{12:8-12:13}\r
-\r
-void j(__attribute__((nonnull)) int i);\r
-// CHECK: attr-source-range.cpp:15:23:{15:8-15:38}\r
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s
+
+void f(int i) __attribute__((format_arg(1)));
+// CHECK: attr-source-range.cpp:3:30:{3:41-3:42}{3:8-3:13}
+
+void g(int i, ...) __attribute__((format(printf, 1, 1)));
+// CHECK: attr-source-range.cpp:6:35:{6:50-6:51}{6:8-6:13}
+
+int h(void) __attribute__((returns_nonnull));
+// CHECK: attr-source-range.cpp:9:28:{9:1-9:4}
+
+void i(int j) __attribute__((nonnull(1)));
+// CHECK: attr-source-range.cpp:12:30:{12:38-12:39}{12:8-12:13}
+
+void j(__attribute__((nonnull)) int i);
+// CHECK: attr-source-range.cpp:15:23:{15:8-15:38}
-// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t.a %s\r
-// RUN: %clang_cc1 -std=c++11 -include-pch %t.a %s -ast-print -o - | FileCheck %s\r
-\r
-#ifndef HEADER\r
-#define HEADER\r
-\r
-inline void test(int i) {\r
- switch (i) {\r
- case 1:\r
- // Notice that the NullStmt has two attributes.\r
- // CHECK: {{\[\[clang::fallthrough\]\] \[\[clang::fallthrough\]\]}}\r
- [[clang::fallthrough]] [[clang::fallthrough]];\r
- case 2:\r
- break;\r
- }\r
-}\r
-\r
-#else\r
-\r
-void foo(void) {\r
- test(1);\r
-}\r
-\r
-#endif\r
+// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t.a %s
+// RUN: %clang_cc1 -std=c++11 -include-pch %t.a %s -ast-print -o - | FileCheck %s
+
+#ifndef HEADER
+#define HEADER
+
+inline void test(int i) {
+ switch (i) {
+ case 1:
+ // Notice that the NullStmt has two attributes.
+ // CHECK: {{\[\[clang::fallthrough\]\] \[\[clang::fallthrough\]\]}}
+ [[clang::fallthrough]] [[clang::fallthrough]];
+ case 2:
+ break;
+ }
+}
+
+#else
+
+void foo(void) {
+ test(1);
+}
+
+#endif
-// RUN: %clang_cc1 -fsyntax-only %s\r
-// Make sure OpenBSD's bounded extension is accepted.\r
-\r
-typedef long ssize_t;\r
-typedef unsigned long size_t;\r
-typedef struct FILE FILE;\r
-\r
-ssize_t read(int, void *, size_t)\r
- __attribute__((__bounded__(__buffer__,2,3)));\r
-int readlink(const char *, char *, size_t)\r
- __attribute__((__bounded__(__string__,2,3)));\r
-size_t fread(void *, size_t, size_t, FILE *)\r
- __attribute__((__bounded__(__size__,1,3,2)));\r
-char *getwd(char *)\r
- __attribute__((__bounded__(__minbytes__,1,1024)));
\ No newline at end of file
+// RUN: %clang_cc1 -fsyntax-only %s
+// Make sure OpenBSD's bounded extension is accepted.
+
+typedef long ssize_t;
+typedef unsigned long size_t;
+typedef struct FILE FILE;
+
+ssize_t read(int, void *, size_t)
+ __attribute__((__bounded__(__buffer__,2,3)));
+int readlink(const char *, char *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
+size_t fread(void *, size_t, size_t, FILE *)
+ __attribute__((__bounded__(__size__,1,3,2)));
+char *getwd(char *)
+ __attribute__((__bounded__(__minbytes__,1,1024)));
-// RUN: %clang_cc1 -triple msp430-unknown-unknown -fsyntax-only -verify %s\r
-\r
-int i;\r
-void f(void) __attribute__((interrupt(i))); /* expected-error {{'interrupt' attribute requires an integer constant}} */\r
-\r
-void f2(void) __attribute__((interrupt(12)));\r
+// RUN: %clang_cc1 -triple msp430-unknown-unknown -fsyntax-only -verify %s
+
+int i;
+void f(void) __attribute__((interrupt(i))); /* expected-error {{'interrupt' attribute requires an integer constant}} */
+
+void f2(void) __attribute__((interrupt(12)));
-// RUN: %clang_cc1 %s -verify -fsyntax-only\r
-\r
-void f1(int *a1, int *a2, int *a3, int *a4, int *a5, int *a6, int *a7,\r
- int *a8, int *a9, int *a10, int *a11, int *a12, int *a13, int *a14,\r
- int *a15, int *a16) __attribute__((nonnull(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)));\r
-\r
-void f2(void) __attribute__((nonnull())); // expected-warning {{'nonnull' attribute applied to function with no pointer arguments}}\r
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+void f1(int *a1, int *a2, int *a3, int *a4, int *a5, int *a6, int *a7,
+ int *a8, int *a9, int *a10, int *a11, int *a12, int *a13, int *a14,
+ int *a15, int *a16) __attribute__((nonnull(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)));
+
+void f2(void) __attribute__((nonnull())); // expected-warning {{'nonnull' attribute applied to function with no pointer arguments}}
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts %s 2>/dev/null \\r
-// RUN: | FileCheck %s\r
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts %s 2>/dev/null \\r
-// RUN: | FileCheck %s\r
-\r
-typedef struct A {\r
- char x;\r
- int a : 22;\r
- int : 0;\r
- int c : 10;\r
- char b : 3;\r
- char d: 4;\r
- short y;\r
-} A;\r
-\r
-// CHECK: Type: struct A\r
-// CHECK: Size:128\r
-// CHECK: Alignment:32\r
-// CHECK: FieldOffsets: [0, 32, 64, 64, 96, 99, 112]>\r
-\r
-typedef struct B {\r
- char x;\r
- int : 0;\r
- short a : 4;\r
- char y;\r
-} B;\r
-\r
-// CHECK: Type: struct B\r
-// CHECK: Size:48\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 8, 16, 32]>\r
-\r
-typedef struct C {\r
- char x;\r
- short a : 4;\r
- int : 0;\r
- char y;\r
-} C;\r
-\r
-// CHECK: Type: struct C\r
-// CHECK: Size:64\r
-// CHECK: Alignment:32\r
-// CHECK: FieldOffsets: [0, 16, 32, 32]>\r
-\r
-typedef struct D {\r
- char x;\r
- short : 0;\r
- int : 0;\r
- char y;\r
-} D;\r
-\r
-// CHECK: Type: struct D\r
-// CHECK: Size:16\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 8, 8]>\r
-\r
-typedef union E {\r
- char x;\r
- long long a : 3;\r
- int b : 3;\r
- long long : 0;\r
- short y;\r
-} E;\r
-\r
-// CHECK: Type: union E\r
-// CHECK: Size:64\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>\r
-\r
-typedef struct F {\r
- char x;\r
- char a : 3;\r
- char b : 3;\r
- char c : 3;\r
- short d : 6;\r
- short e : 6;\r
- short f : 6;\r
- short g : 11;\r
- short h : 11;\r
- short i : 11;\r
- short y;\r
-} F;\r
-\r
-// CHECK: Type: struct F\r
-// CHECK: Size:128\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 8, 11, 16, 32, 38, 48, 64, 80, 96, 112]>\r
-\r
-typedef union G {\r
- char x;\r
- int a : 3;\r
- int : 0;\r
- long long : 0;\r
- short y;\r
-} G;\r
-\r
-// CHECK: Type: union G\r
-// CHECK: Size:32\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>\r
-\r
-typedef struct H {\r
- unsigned short a : 1;\r
- unsigned char : 0;\r
- unsigned long : 0;\r
- unsigned short c : 1;\r
-} H;\r
-\r
-// CHECK: Type: struct H\r
-// CHECK: Size:32\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 16, 16, 16]>\r
-\r
-typedef struct I {\r
- short : 8;\r
- __declspec(align(16)) short : 8;\r
-} I;\r
-\r
-// CHECK: Type: struct I\r
-// CHECK: Size:16\r
-// CHECK: Alignment:16\r
-// CHECK: FieldOffsets: [0, 8]\r
-\r
-#pragma pack(push, 1)\r
-\r
-typedef struct A1 {\r
- char x;\r
- int a : 22;\r
- int : 0;\r
- int c : 10;\r
- char b : 3;\r
- char d: 4;\r
- short y;\r
-} A1;\r
-\r
-// CHECK: Type: struct A1\r
-// CHECK: Size:96\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 40, 40, 72, 75, 80]>\r
-\r
-typedef struct B1 {\r
- char x;\r
- int : 0;\r
- short a : 4;\r
- char y;\r
-} B1;\r
-\r
-// CHECK: Type: struct B1\r
-// CHECK: Size:32\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 8, 24]>\r
-\r
-typedef struct C1 {\r
- char x;\r
- short a : 4;\r
- int : 0;\r
- char y;\r
-} C1;\r
-\r
-// CHECK: Type: struct C1\r
-// CHECK: Size:32\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 24, 24]>\r
-\r
-typedef struct D1 {\r
- char x;\r
- short : 0;\r
- int : 0;\r
- char y;\r
-} D1;\r
-\r
-// CHECK: Type: struct D1\r
-// CHECK: Size:16\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 8, 8]>\r
-\r
-typedef union E1 {\r
- char x;\r
- long long a : 3;\r
- int b : 3;\r
- long long : 0;\r
- short y;\r
-} E1;\r
-\r
-// CHECK: Type: union E1\r
-// CHECK: Size:64\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>\r
-\r
-typedef struct F1 {\r
- char x;\r
- char a : 3;\r
- char b : 3;\r
- char c : 3;\r
- short d : 6;\r
- short e : 6;\r
- short f : 6;\r
- short g : 11;\r
- short h : 11;\r
- short i : 11;\r
- short y;\r
-} F1;\r
-\r
-// CHECK: Type: struct F1\r
-// CHECK: Size:120\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8, 11, 16, 24, 30, 40, 56, 72, 88, 104]>\r
-\r
-typedef union G1 {\r
- char x;\r
- int a : 3;\r
- int : 0;\r
- long long : 0;\r
- short y;\r
-} G1;\r
-\r
-// CHECK: Type: union G1\r
-// CHECK: Size:32\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>\r
-\r
-typedef struct H1 {\r
- unsigned long a : 1;\r
- unsigned char : 0;\r
- unsigned long : 0;\r
- unsigned long c : 1;\r
-} H1;\r
-\r
-// CHECK: Type: struct H1\r
-// CHECK: Size:64\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 32, 32, 32]>\r
-\r
-typedef struct I1 {\r
- short : 8;\r
- __declspec(align(16)) short : 8;\r
-} I1;\r
-\r
-// CHECK: Type: struct I1\r
-// CHECK: Size:16\r
-// CHECK: Alignment:8\r
-// CHECK: FieldOffsets: [0, 8]\r
-\r
-#pragma pack(pop)\r
-\r
-int x[\r
-sizeof(A ) +\r
-sizeof(B ) +\r
-sizeof(C ) +\r
-sizeof(D ) +\r
-sizeof(E ) +\r
-sizeof(F ) +\r
-sizeof(G ) +\r
-sizeof(H ) +\r
-sizeof(I ) +\r
-sizeof(A1) +\r
-sizeof(B1) +\r
-sizeof(C1) +\r
-sizeof(D1) +\r
-sizeof(E1) +\r
-sizeof(F1) +\r
-sizeof(G1) +\r
-sizeof(H1) +\r
-sizeof(I1) +\r
-0];\r
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fms-extensions -fdump-record-layouts %s 2>/dev/null \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fms-extensions -fdump-record-layouts %s 2>/dev/null \
+// RUN: | FileCheck %s
+
+typedef struct A {
+ char x;
+ int a : 22;
+ int : 0;
+ int c : 10;
+ char b : 3;
+ char d: 4;
+ short y;
+} A;
+
+// CHECK: Type: struct A
+// CHECK: Size:128
+// CHECK: Alignment:32
+// CHECK: FieldOffsets: [0, 32, 64, 64, 96, 99, 112]>
+
+typedef struct B {
+ char x;
+ int : 0;
+ short a : 4;
+ char y;
+} B;
+
+// CHECK: Type: struct B
+// CHECK: Size:48
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 8, 16, 32]>
+
+typedef struct C {
+ char x;
+ short a : 4;
+ int : 0;
+ char y;
+} C;
+
+// CHECK: Type: struct C
+// CHECK: Size:64
+// CHECK: Alignment:32
+// CHECK: FieldOffsets: [0, 16, 32, 32]>
+
+typedef struct D {
+ char x;
+ short : 0;
+ int : 0;
+ char y;
+} D;
+
+// CHECK: Type: struct D
+// CHECK: Size:16
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 8]>
+
+typedef union E {
+ char x;
+ long long a : 3;
+ int b : 3;
+ long long : 0;
+ short y;
+} E;
+
+// CHECK: Type: union E
+// CHECK: Size:64
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct F {
+ char x;
+ char a : 3;
+ char b : 3;
+ char c : 3;
+ short d : 6;
+ short e : 6;
+ short f : 6;
+ short g : 11;
+ short h : 11;
+ short i : 11;
+ short y;
+} F;
+
+// CHECK: Type: struct F
+// CHECK: Size:128
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 8, 11, 16, 32, 38, 48, 64, 80, 96, 112]>
+
+typedef union G {
+ char x;
+ int a : 3;
+ int : 0;
+ long long : 0;
+ short y;
+} G;
+
+// CHECK: Type: union G
+// CHECK: Size:32
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct H {
+ unsigned short a : 1;
+ unsigned char : 0;
+ unsigned long : 0;
+ unsigned short c : 1;
+} H;
+
+// CHECK: Type: struct H
+// CHECK: Size:32
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 16, 16, 16]>
+
+typedef struct I {
+ short : 8;
+ __declspec(align(16)) short : 8;
+} I;
+
+// CHECK: Type: struct I
+// CHECK: Size:16
+// CHECK: Alignment:16
+// CHECK: FieldOffsets: [0, 8]
+
+#pragma pack(push, 1)
+
+typedef struct A1 {
+ char x;
+ int a : 22;
+ int : 0;
+ int c : 10;
+ char b : 3;
+ char d: 4;
+ short y;
+} A1;
+
+// CHECK: Type: struct A1
+// CHECK: Size:96
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 40, 40, 72, 75, 80]>
+
+typedef struct B1 {
+ char x;
+ int : 0;
+ short a : 4;
+ char y;
+} B1;
+
+// CHECK: Type: struct B1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 24]>
+
+typedef struct C1 {
+ char x;
+ short a : 4;
+ int : 0;
+ char y;
+} C1;
+
+// CHECK: Type: struct C1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 24, 24]>
+
+typedef struct D1 {
+ char x;
+ short : 0;
+ int : 0;
+ char y;
+} D1;
+
+// CHECK: Type: struct D1
+// CHECK: Size:16
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 8, 8]>
+
+typedef union E1 {
+ char x;
+ long long a : 3;
+ int b : 3;
+ long long : 0;
+ short y;
+} E1;
+
+// CHECK: Type: union E1
+// CHECK: Size:64
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct F1 {
+ char x;
+ char a : 3;
+ char b : 3;
+ char c : 3;
+ short d : 6;
+ short e : 6;
+ short f : 6;
+ short g : 11;
+ short h : 11;
+ short i : 11;
+ short y;
+} F1;
+
+// CHECK: Type: struct F1
+// CHECK: Size:120
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8, 11, 16, 24, 30, 40, 56, 72, 88, 104]>
+
+typedef union G1 {
+ char x;
+ int a : 3;
+ int : 0;
+ long long : 0;
+ short y;
+} G1;
+
+// CHECK: Type: union G1
+// CHECK: Size:32
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 0, 0, 0, 0]>
+
+typedef struct H1 {
+ unsigned long a : 1;
+ unsigned char : 0;
+ unsigned long : 0;
+ unsigned long c : 1;
+} H1;
+
+// CHECK: Type: struct H1
+// CHECK: Size:64
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 32, 32, 32]>
+
+typedef struct I1 {
+ short : 8;
+ __declspec(align(16)) short : 8;
+} I1;
+
+// CHECK: Type: struct I1
+// CHECK: Size:16
+// CHECK: Alignment:8
+// CHECK: FieldOffsets: [0, 8]
+
+#pragma pack(pop)
+
+int x[
+sizeof(A ) +
+sizeof(B ) +
+sizeof(C ) +
+sizeof(D ) +
+sizeof(E ) +
+sizeof(F ) +
+sizeof(G ) +
+sizeof(H ) +
+sizeof(I ) +
+sizeof(A1) +
+sizeof(B1) +
+sizeof(C1) +
+sizeof(D1) +
+sizeof(E1) +
+sizeof(F1) +
+sizeof(G1) +
+sizeof(H1) +
+sizeof(I1) +
+0];
-#define rsqrt(x) (1.f/sqrt(x))\r
+#define rsqrt(x) (1.f/sqrt(x))
public:
typedef ValueT key_type;
typedef ValueT value_type;
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
explicit DenseSet(unsigned NumInitBuckets = 0) : TheMap(NumInitBuckets) {}
TheMap.clear();
}
- /// Return 1 if the specified key is in the set, 0 otherwise.\r
+ /// Return 1 if the specified key is in the set, 0 otherwise.
size_type count(const ValueT &V) const {
return TheMap.count(V);
}
/// ScopeTy - This is a helpful typedef that allows clients to get easy access
/// to the name of the scope for this hash table.
typedef ScopedHashTableScope<K, V, KInfo, AllocatorTy> ScopeTy;
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
private:
typedef ScopedHashTableVal<K, V> ValTy;
DenseMap<K, ValTy*, KInfo> TopLevelMap;
AllocatorTy &getAllocator() { return Allocator; }
const AllocatorTy &getAllocator() const { return Allocator; }
- /// Return 1 if the specified key is in the table, 0 otherwise.\r
+ /// Return 1 if the specified key is in the table, 0 otherwise.
size_type count(const K &Key) const {
return TopLevelMap.count(Key);
}
};
public:
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
// Encapsulation of a single bit.
class reference {
SmallBitVector &TheVector;
: public ilist_node<SparseBitVectorElement<ElementSize> > {
public:
typedef unsigned long BitWord;
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
enum {
BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT,
BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
typedef const ValueT &const_reference;
typedef ValueT *pointer;
typedef const ValueT *const_pointer;
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
SparseMultiSet()
: Sparse(nullptr), Universe(0), FreelistIdx(SMSNode::INVALID), NumFree(0) {}
typedef typename KeyFunctorT::argument_type KeyT;
typedef SmallVector<ValueT, 8> DenseT;
- typedef unsigned size_type;\r
+ typedef unsigned size_type;
DenseT Dense;
SparseT *Sparse;
unsigned Universe;
-//===-- HexagonDisassembler.cpp - Disassembler for Hexagon ISA ------------===//\r
-//\r
-// The LLVM Compiler Infrastructure\r
-//\r
-// This file is distributed under the University of Illinois Open Source\r
-// License. See LICENSE.TXT for details.\r
-//\r
-//===----------------------------------------------------------------------===//\r
-\r
-#include "MCTargetDesc/HexagonBaseInfo.h"\r
-#include "MCTargetDesc/HexagonMCTargetDesc.h"\r
-\r
-#include "llvm/MC/MCContext.h"\r
-#include "llvm/MC/MCDisassembler.h"\r
-#include "llvm/MC/MCExpr.h"\r
-#include "llvm/MC/MCFixedLenDisassembler.h"\r
-#include "llvm/MC/MCInst.h"\r
-#include "llvm/MC/MCInstrDesc.h"\r
-#include "llvm/MC/MCSubtargetInfo.h"\r
-#include "llvm/Support/Debug.h"\r
-#include "llvm/Support/ErrorHandling.h"\r
-#include "llvm/Support/LEB128.h"\r
-#include "llvm/Support/MemoryObject.h"\r
-#include "llvm/Support/raw_ostream.h"\r
-#include "llvm/Support/TargetRegistry.h"\r
-#include "llvm/Support/Endian.h"\r
-\r
-#include <vector>\r
-#include <array>\r
-\r
-using namespace llvm;\r
-\r
-#define DEBUG_TYPE "hexagon-disassembler"\r
-\r
-// Pull DecodeStatus and its enum values into the global namespace.\r
-typedef llvm::MCDisassembler::DecodeStatus DecodeStatus;\r
-\r
-namespace {\r
-/// \brief Hexagon disassembler for all Hexagon platforms.\r
-class HexagonDisassembler : public MCDisassembler {\r
-public:\r
- HexagonDisassembler(MCSubtargetInfo const &STI, MCContext &Ctx)\r
- : MCDisassembler(STI, Ctx) {}\r
-\r
- DecodeStatus getInstruction(MCInst &instr, uint64_t &size,\r
- MemoryObject const ®ion, uint64_t address,\r
- raw_ostream &vStream, raw_ostream &cStream) const override;\r
-};\r
-}\r
-\r
-static const uint16_t IntRegDecoderTable[] = {\r
- Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,\r
- Hexagon::R5, Hexagon::R6, Hexagon::R7, Hexagon::R8, Hexagon::R9,\r
- Hexagon::R10, Hexagon::R11, Hexagon::R12, Hexagon::R13, Hexagon::R14,\r
- Hexagon::R15, Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,\r
- Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23, Hexagon::R24,\r
- Hexagon::R25, Hexagon::R26, Hexagon::R27, Hexagon::R28, Hexagon::R29,\r
- Hexagon::R30, Hexagon::R31};\r
-\r
-static const uint16_t PredRegDecoderTable[] = {Hexagon::P0, Hexagon::P1,\r
- Hexagon::P2, Hexagon::P3};\r
-\r
-static DecodeStatus DecodeIntRegsRegisterClass(MCInst &Inst, unsigned RegNo,\r
- uint64_t /*Address*/,\r
- void const *Decoder) {\r
- if (RegNo > 31)\r
- return MCDisassembler::Fail;\r
-\r
- unsigned Register = IntRegDecoderTable[RegNo];\r
- Inst.addOperand(MCOperand::CreateReg(Register));\r
- return MCDisassembler::Success;\r
-}\r
-\r
-static DecodeStatus DecodePredRegsRegisterClass(MCInst &Inst, unsigned RegNo,\r
- uint64_t /*Address*/,\r
- void const *Decoder) {\r
- if (RegNo > 3)\r
- return MCDisassembler::Fail;\r
-\r
- unsigned Register = PredRegDecoderTable[RegNo];\r
- Inst.addOperand(MCOperand::CreateReg(Register));\r
- return MCDisassembler::Success;\r
-}\r
-\r
-#include "HexagonGenDisassemblerTables.inc"\r
-\r
-static MCDisassembler *createHexagonDisassembler(Target const &T,\r
- MCSubtargetInfo const &STI,\r
- MCContext &Ctx) {\r
- return new HexagonDisassembler(STI, Ctx);\r
-}\r
-\r
-extern "C" void LLVMInitializeHexagonDisassembler() {\r
- TargetRegistry::RegisterMCDisassembler(TheHexagonTarget,\r
- createHexagonDisassembler);\r
-}\r
-\r
-DecodeStatus HexagonDisassembler::getInstruction(MCInst &MI, uint64_t &Size,\r
- MemoryObject const &Region,\r
- uint64_t Address,\r
- raw_ostream &os,\r
- raw_ostream &cs) const {\r
- std::array<uint8_t, 4> Bytes;\r
- Size = 4;\r
- if (Region.readBytes(Address, Bytes.size(), Bytes.data()) == -1) {\r
- return MCDisassembler::Fail;\r
- }\r
- uint32_t insn =\r
- llvm::support::endian::read<uint32_t, llvm::support::little,\r
- llvm::support::unaligned>(Bytes.data());\r
-\r
- // Remove parse bits.\r
- insn &= ~static_cast<uint32_t>(HexagonII::InstParseBits::INST_PARSE_MASK);\r
- return decodeInstruction(DecoderTable32, MI, insn, Address, this, STI);\r
-}\r
+//===-- HexagonDisassembler.cpp - Disassembler for Hexagon ISA ------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "MCTargetDesc/HexagonBaseInfo.h"
+#include "MCTargetDesc/HexagonMCTargetDesc.h"
+
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCDisassembler.h"
+#include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCFixedLenDisassembler.h"
+#include "llvm/MC/MCInst.h"
+#include "llvm/MC/MCInstrDesc.h"
+#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LEB128.h"
+#include "llvm/Support/MemoryObject.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/TargetRegistry.h"
+#include "llvm/Support/Endian.h"
+
+#include <vector>
+#include <array>
+
+using namespace llvm;
+
+#define DEBUG_TYPE "hexagon-disassembler"
+
+// Pull DecodeStatus and its enum values into the global namespace.
+typedef llvm::MCDisassembler::DecodeStatus DecodeStatus;
+
+namespace {
+/// \brief Hexagon disassembler for all Hexagon platforms.
+class HexagonDisassembler : public MCDisassembler {
+public:
+ HexagonDisassembler(MCSubtargetInfo const &STI, MCContext &Ctx)
+ : MCDisassembler(STI, Ctx) {}
+
+ DecodeStatus getInstruction(MCInst &instr, uint64_t &size,
+ MemoryObject const ®ion, uint64_t address,
+ raw_ostream &vStream, raw_ostream &cStream) const override;
+};
+}
+
+static const uint16_t IntRegDecoderTable[] = {
+ Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,
+ Hexagon::R5, Hexagon::R6, Hexagon::R7, Hexagon::R8, Hexagon::R9,
+ Hexagon::R10, Hexagon::R11, Hexagon::R12, Hexagon::R13, Hexagon::R14,
+ Hexagon::R15, Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
+ Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23, Hexagon::R24,
+ Hexagon::R25, Hexagon::R26, Hexagon::R27, Hexagon::R28, Hexagon::R29,
+ Hexagon::R30, Hexagon::R31};
+
+static const uint16_t PredRegDecoderTable[] = {Hexagon::P0, Hexagon::P1,
+ Hexagon::P2, Hexagon::P3};
+
+static DecodeStatus DecodeIntRegsRegisterClass(MCInst &Inst, unsigned RegNo,
+ uint64_t /*Address*/,
+ void const *Decoder) {
+ if (RegNo > 31)
+ return MCDisassembler::Fail;
+
+ unsigned Register = IntRegDecoderTable[RegNo];
+ Inst.addOperand(MCOperand::CreateReg(Register));
+ return MCDisassembler::Success;
+}
+
+static DecodeStatus DecodePredRegsRegisterClass(MCInst &Inst, unsigned RegNo,
+ uint64_t /*Address*/,
+ void const *Decoder) {
+ if (RegNo > 3)
+ return MCDisassembler::Fail;
+
+ unsigned Register = PredRegDecoderTable[RegNo];
+ Inst.addOperand(MCOperand::CreateReg(Register));
+ return MCDisassembler::Success;
+}
+
+#include "HexagonGenDisassemblerTables.inc"
+
+static MCDisassembler *createHexagonDisassembler(Target const &T,
+ MCSubtargetInfo const &STI,
+ MCContext &Ctx) {
+ return new HexagonDisassembler(STI, Ctx);
+}
+
+extern "C" void LLVMInitializeHexagonDisassembler() {
+ TargetRegistry::RegisterMCDisassembler(TheHexagonTarget,
+ createHexagonDisassembler);
+}
+
+DecodeStatus HexagonDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
+ MemoryObject const &Region,
+ uint64_t Address,
+ raw_ostream &os,
+ raw_ostream &cs) const {
+ std::array<uint8_t, 4> Bytes;
+ Size = 4;
+ if (Region.readBytes(Address, Bytes.size(), Bytes.data()) == -1) {
+ return MCDisassembler::Fail;
+ }
+ uint32_t insn =
+ llvm::support::endian::read<uint32_t, llvm::support::little,
+ llvm::support::unaligned>(Bytes.data());
+
+ // Remove parse bits.
+ insn &= ~static_cast<uint32_t>(HexagonII::InstParseBits::INST_PARSE_MASK);
+ return decodeInstruction(DecoderTable32, MI, insn, Address, this, STI);
+}
#ifndef LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONBASEINFO_H
#define LLVM_LIB_TARGET_HEXAGON_MCTARGETDESC_HEXAGONBASEINFO_H
-#include "HexagonMCTargetDesc.h"\r
-#include "llvm/Support/ErrorHandling.h"\r
-\r
-#include <stdint.h>\r
-\r
-namespace llvm {\r
-\r
-/// HexagonII - This namespace holds all of the target specific flags that\r
+#include "HexagonMCTargetDesc.h"
+#include "llvm/Support/ErrorHandling.h"
+
+#include <stdint.h>
+
+namespace llvm {
+
+/// HexagonII - This namespace holds all of the target specific flags that
/// instruction info tracks.
///
namespace HexagonII {
MO_LO16, MO_HI16,
// Offset from the base of the SDA.
- MO_GPREL\r
- };\r
-\r
- enum class InstParseBits : uint32_t {\r
- INST_PARSE_MASK = 0x0000c000,\r
- INST_PARSE_PACKET_END = 0x0000c000,\r
- INST_PARSE_LOOP_END = 0x00008000,\r
- INST_PARSE_NOT_END = 0x00004000,\r
- INST_PARSE_DUPLEX = 0x00000000,\r
- INST_PARSE_EXTENDER = 0x00000000\r
- };\r
-\r
-} // End namespace HexagonII.\r
-\r
-} // End namespace llvm.\r
+ MO_GPREL
+ };
+
+ enum class InstParseBits : uint32_t {
+ INST_PARSE_MASK = 0x0000c000,
+ INST_PARSE_PACKET_END = 0x0000c000,
+ INST_PARSE_LOOP_END = 0x00008000,
+ INST_PARSE_NOT_END = 0x00004000,
+ INST_PARSE_DUPLEX = 0x00000000,
+ INST_PARSE_EXTENDER = 0x00000000
+ };
+
+} // End namespace HexagonII.
+
+} // End namespace llvm.
#endif