summaryrefslogtreecommitdiffstats
path: root/clang/tools/index-test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-10 19:03:04 +0000
committerChris Lattner <sabre@nondot.org>2009-08-10 19:03:04 +0000
commit30ba674391ae528f1fdae3f1974f7ba17e4dae0f (patch)
treed2b871c238b5ff60fe37ad9409a9c83bb2573319 /clang/tools/index-test
parent0bdbee14cd801af0af94fedcdc76932ca41b7cbd (diff)
downloadbcm5719-llvm-30ba674391ae528f1fdae3f1974f7ba17e4dae0f.tar.gz
bcm5719-llvm-30ba674391ae528f1fdae3f1974f7ba17e4dae0f.zip
fix a couple of problems with section attributes:
1. Passing something that isn't a string used to cause: "argument to annotate attribute was not a string literal" make it say "section attribute" instead. 2. Fix the location of the above message to point to the bad argument instead of the section token. 3. Implement rdar://4341926, by diagnosing invalid section specifiers in the frontend rather than letting them slip all the way to the assembler (a QoI win). An example of #3 is that we used to produce something like this: /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.). Daniel improved clang to use llvm_report_error, so now we got: $ clang t.c -c fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier requires a segment and section separated by a comma. with no loc info. Now we get: $ clang t.c -fsyntax-only t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma int x __attribute__((section("sadf"))); ^ which is nice :) llvm-svn: 78586
Diffstat (limited to 'clang/tools/index-test')
-rw-r--r--clang/tools/index-test/CMakeLists.txt1
-rw-r--r--clang/tools/index-test/Makefile2
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/index-test/CMakeLists.txt b/clang/tools/index-test/CMakeLists.txt
index 880539bbe31..9c9656a1130 100644
--- a/clang/tools/index-test/CMakeLists.txt
+++ b/clang/tools/index-test/CMakeLists.txt
@@ -11,6 +11,7 @@ set( LLVM_USED_LIBS
set( LLVM_LINK_COMPONENTS
bitreader
+ mc
)
add_clang_executable(index-test
diff --git a/clang/tools/index-test/Makefile b/clang/tools/index-test/Makefile
index cec0eee2861..0a43d2f47f9 100644
--- a/clang/tools/index-test/Makefile
+++ b/clang/tools/index-test/Makefile
@@ -17,7 +17,7 @@ TOOL_NO_EXPORTS = 1
include $(LEVEL)/Makefile.config
-LINK_COMPONENTS := bitreader
+LINK_COMPONENTS := bitreader mc
USEDLIBS = clangIndex.a clangFrontend.a clangSema.a clangAST.a clangLex.a clangBasic.a
include $(LLVM_SRC_ROOT)/Makefile.rules
OpenPOWER on IntegriCloud